diff options
author | clayjohn <claynjohn@gmail.com> | 2024-07-08 12:52:20 -0700 |
---|---|---|
committer | clayjohn <claynjohn@gmail.com> | 2024-07-08 12:52:20 -0700 |
commit | 5b213dcd264a989a214f00b016c9e653a29d90b3 (patch) | |
tree | 27e1144e390cc03e805957a8599d1756aa3e1537 /drivers/gles3 | |
parent | 16f98cd7079c2b22248ec358371f17bca355e42e (diff) | |
download | redot-engine-5b213dcd264a989a214f00b016c9e653a29d90b3.tar.gz |
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.
Diffstat (limited to 'drivers/gles3')
-rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 8e89889fd1..a6796a1a6b 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -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 | |