Fix DH framebuffer UNSUPPORTED after resize (#1741)

This commit is contained in:
DarkShadow44 authored and GitHub committed 2026-05-23 21:19:45 -07:00
1 parent 3046b043a0
commit e2e94b2958
1 file changed
+3
@@ -48,6 +48,9 @@ public class GlFramebuffer extends GlResource {
public void addDepthAttachmentBypass(int texture) {
final int fb = getGlId();
RenderSystem.framebufferTexture2D(fb, GL30.GL_FRAMEBUFFER, GL30.GL_DEPTH_ATTACHMENT, GL11.GL_TEXTURE_2D, texture, 0);
// Detach any stale stencil left over from a prior combined-stencil attach; otherwise drivers
// reject the FBO as UNSUPPORTED when the depth attachment no longer matches the stencil.
RenderSystem.framebufferTexture2D(fb, GL30.GL_FRAMEBUFFER, GL30.GL_STENCIL_ATTACHMENT, GL11.GL_TEXTURE_2D, 0, 0);
this.hasDepthAttachment = true;
}