Use GL_COLOR_ATTACHMENT in depth prepass when using Multiview.

I am certain this is a driver bug. But on some devices when no draw buffer is specified, the depth operations fail when there is no color buffer.
This commit is contained in:
clayjohn 2024-07-08 12:52:20 -07:00
parent 16f98cd707
commit 5b213dcd26
1 changed files with 3 additions and 1 deletions

View File

@ -2499,7 +2499,9 @@ void RasterizerSceneGLES3::render_scene(const Ref<RenderSceneBuffers> &p_render_
glColorMask(0, 0, 0, 0); glColorMask(0, 0, 0, 0);
RasterizerGLES3::clear_depth(0.0); RasterizerGLES3::clear_depth(0.0);
glClear(GL_DEPTH_BUFFER_BIT); glClear(GL_DEPTH_BUFFER_BIT);
glDrawBuffers(0, nullptr); // Some desktop GL implementations fall apart when using Multiview with GL_NONE.
GLuint db = p_camera_data->view_count > 1 ? GL_COLOR_ATTACHMENT0 : GL_NONE;
glDrawBuffers(1, &db);
uint64_t spec_constant = SceneShaderGLES3::DISABLE_FOG | SceneShaderGLES3::DISABLE_LIGHT_DIRECTIONAL | uint64_t spec_constant = SceneShaderGLES3::DISABLE_FOG | SceneShaderGLES3::DISABLE_LIGHT_DIRECTIONAL |
SceneShaderGLES3::DISABLE_LIGHTMAP | SceneShaderGLES3::DISABLE_LIGHT_OMNI | SceneShaderGLES3::DISABLE_LIGHTMAP | SceneShaderGLES3::DISABLE_LIGHT_OMNI |