Skip to content

Commit 46d136c

Browse files
authored
Follow-up fix to 7360 (#7399)
Turns out 7360 causes cockpits to not render. That PR had updated `GL_DEPTH_ATTACHMENT` to `GL_DEPTH_STENCIL_ATTACHMENT` but missed two spots. This PR fixes that and tests show cockpits now work. (Root cause was the save/restore zbuffer swap using the old GL_DEPTH_ATTACHMENT point — once the scene texture became a combined depth-stencil, re-binding just the depth slot left stencil dangling and made the FBO incomplete.)
1 parent 7fa37f3 commit 46d136c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

code/graphics/opengl/gropenglpostprocessing.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ void gr_opengl_post_process_save_zbuffer()
761761
GR_DEBUG_SCOPE("Save z-Buffer");
762762
if (Post_initialized)
763763
{
764-
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, Cockpit_depth_texture, 0);
764+
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, Cockpit_depth_texture, 0);
765765
gr_zbuffer_clear(TRUE);
766766
zbuffer_saved = true;
767767
}
@@ -777,7 +777,7 @@ void gr_opengl_post_process_restore_zbuffer()
777777
GR_DEBUG_SCOPE("Restore z-Buffer");
778778

779779
if (zbuffer_saved) {
780-
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, Scene_depth_texture, 0);
780+
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, Scene_depth_texture, 0);
781781

782782
zbuffer_saved = false;
783783
}

0 commit comments

Comments
 (0)