Merge pull request #94095 from clayjohn/GLES3-drawbuffers

Use `GL_COLOR_ATTACHMENT` in depth prepass when using Multiview.
This commit is contained in:
Rémi Verschelde 2024-07-09 00:03:23 +02:00
commit c10fde6137
No known key found for this signature in database
GPG Key ID: C3336907360768E1
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);
RasterizerGLES3::clear_depth(0.0);
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 |
SceneShaderGLES3::DISABLE_LIGHTMAP | SceneShaderGLES3::DISABLE_LIGHT_OMNI |