From 69c6050fa88abf8a129657b8838be377cde8b13d Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 9 Apr 2021 10:45:47 +0200 Subject: [PATCH] glgsg: Only copy depth of 32-bit float depth-stencil framebuffer We don't support float-32-unsigned-int-24-8 component types in texture yet, so this is the only choice. Avoids a GL error when binding to RTP_depth_stencil slot. Fixes case 2 of #1142 --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 4ea487626a..e97755acc2 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -7174,7 +7174,10 @@ framebuffer_copy_to_ram(Texture *tex, int view, int z, switch (format) { case Texture::F_depth_stencil: if (_current_properties->get_float_depth()) { + //NB. In the future we may need a T_float_32_unsigned_int_24_8 format, but + // for now we'll just try to grab the depth component. component_type = Texture::T_float; + format = Texture::F_depth_component32; } else { component_type = Texture::T_unsigned_int_24_8; }