From 96de2703203ee9a1bc23750b7542266b5118207d Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 11 May 2015 20:31:10 +0200 Subject: [PATCH 1/3] Fall back to depth textures when depth-stencil textures aren't supported --- panda/src/glstuff/glGraphicsBuffer_src.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/panda/src/glstuff/glGraphicsBuffer_src.cxx b/panda/src/glstuff/glGraphicsBuffer_src.cxx index ced71cdddd..36aa82684d 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.cxx +++ b/panda/src/glstuff/glGraphicsBuffer_src.cxx @@ -381,6 +381,10 @@ rebuild_bitplanes() { // buffer was requested. _use_depth_stencil = true; } + } else if (attach[RTP_depth_stencil] != NULL && attach[RTP_depth] == NULL) { + // The depth stencil slot was assigned a texture, but we don't support it. + // Downgrade to a regular depth texture. + swap(attach[RTP_depth], attach[RTP_depth_stencil]); } // Knowing this, we can already be a tiny bit more accurate about the From 5def6a6261202f15ebf2dcf340b15582a196f72a Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 11 May 2015 20:31:37 +0200 Subject: [PATCH 2/3] Fix flickering when using trans_model_to_apiview in Cg --- panda/src/gobj/shader.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/panda/src/gobj/shader.cxx b/panda/src/gobj/shader.cxx index 4d926ccd80..4c1bf76f17 100644 --- a/panda/src/gobj/shader.cxx +++ b/panda/src/gobj/shader.cxx @@ -413,8 +413,10 @@ cp_dependency(ShaderMatInput inp) { if (inp == SMO_attr_fog || inp == SMO_attr_fogcolor) { dep |= SSD_fog; } - if ((inp == SMO_model_to_view)|| - (inp == SMO_view_to_model)) { + if ((inp == SMO_model_to_view) || + (inp == SMO_view_to_model) || + (inp == SMO_model_to_apiview) || + (inp == SMO_apiview_to_model)) { dep |= SSD_transform; } if ((inp == SMO_texpad_x) || From b9440d634c2eec6d9ad06f0ba7ce6ac740728d24 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 11 May 2015 20:33:14 +0200 Subject: [PATCH 3/3] Fix regression with depth-stencil textures reported as unsupported --- 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 7f5718cd4b..2f634ae472 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -1114,6 +1114,9 @@ reset() { #else _supports_depth_texture = (is_at_least_gl_version(1, 4) || has_extension("GL_ARB_depth_texture")); + _supports_depth_stencil = (is_at_least_gl_version(3, 0) || + has_extension("GL_ARB_framebuffer_object") || + has_extension("GL_EXT_packed_depth_stencil")); #endif #ifdef OPENGLES_2