Ensure we have a depth buffer for GL depth bounds test

This commit is contained in:
baldurk
2026-08-24 17:04:14 +01:00
parent b7f009212f
commit 57a0d90aac
+19
View File
@@ -57,6 +57,23 @@ RD_TEST(GL_Depth_Bounds, OpenGLGraphicsTest)
GLuint program = MakeProgram(GLDefaultVertex, GLDefaultPixel);
GLuint fbo = MakeFBO();
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
// Color render texture
GLuint colattach = MakeTexture();
glBindTexture(GL_TEXTURE_2D, colattach);
glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, screenWidth, screenHeight);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colattach, 0);
GLuint depthattach = MakeTexture();
glBindTexture(GL_TEXTURE_2D, depthattach);
glTexStorage2D(GL_TEXTURE_2D, 1, GL_DEPTH24_STENCIL8, screenWidth, screenHeight);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, depthattach,
0);
while(Running())
{
glDisable(GL_DEPTH_BOUNDS_TEST_EXT);
@@ -80,6 +97,8 @@ RD_TEST(GL_Depth_Bounds, OpenGLGraphicsTest)
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glDrawArrays(GL_TRIANGLES, 0, 3);
blitToSwap(colattach);
Present();
}