diff --git a/util/test/demos/gl/gl_draw_zoo.cpp b/util/test/demos/gl/gl_draw_zoo.cpp index f559a70d4..d734742b6 100644 --- a/util/test/demos/gl/gl_draw_zoo.cpp +++ b/util/test/demos/gl/gl_draw_zoo.cpp @@ -306,6 +306,15 @@ void main() glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA32F, screenWidth, screenHeight); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colattach, 0); + // Depth texture + 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); + glClearDepth(0.0f); + while(Running()) { glBindFramebuffer(GL_FRAMEBUFFER, 0); @@ -313,6 +322,9 @@ void main() float col[] = {0.2f, 0.2f, 0.2f, 1.0f}; glClearBufferfv(GL_COLOR, 0, col); + setMarker("GL_ClearDepth"); + glClear(GL_DEPTH_BUFFER_BIT); + glBindFramebuffer(GL_FRAMEBUFFER, fbo); glBindVertexBuffer(0, vb, 0, sizeof(DefaultA2V)); glBindVertexBuffer(0, instvb, 0, sizeof(Vec4f)); diff --git a/util/test/tests/GL/GL_Draw_Zoo.py b/util/test/tests/GL/GL_Draw_Zoo.py index b990c15c6..9dea647ec 100644 --- a/util/test/tests/GL/GL_Draw_Zoo.py +++ b/util/test/tests/GL/GL_Draw_Zoo.py @@ -39,3 +39,11 @@ class GL_Draw_Zoo(rdtest.Draw_Zoo): self.check(pipe.IsStripRestartEnabled()) self.check((pipe.GetStripRestartIndex() & ((1 << (ib.byteStride*8)) - 1)) == 0xffff) + + draw = self.find_draw("GL_ClearDepth") + self.check(draw is not None) + + draw = draw.next + + self.check(draw.flags & (rd.DrawFlags.Clear|rd.DrawFlags.ClearDepthStencil) == (rd.DrawFlags.Clear|rd.DrawFlags.ClearDepthStencil)) +