diff --git a/util/test/demos/d3d11/d3d11_parameter_zoo.cpp b/util/test/demos/d3d11/d3d11_parameter_zoo.cpp index e25773bbc..faab657cc 100644 --- a/util/test/demos/d3d11/d3d11_parameter_zoo.cpp +++ b/util/test/demos/d3d11/d3d11_parameter_zoo.cpp @@ -89,6 +89,11 @@ RD_TEST(D3D11_Parameter_Zoo, D3D11GraphicsTest) ctx->PSSetShader(ps, NULL, 0); RSSetViewport({0.0f, 0.0f, (float)screenWidth, (float)screenHeight, 0.0f, 1.0f}); + RSSetScissor({0, 0, 1, 1}); + + D3D11_RASTERIZER_DESC raster = GetRasterState(); + raster.ScissorEnable = FALSE; + SetRasterState(raster); ctx->OMSetRenderTargets(1, &bbRTV.GetInterfacePtr(), NULL); diff --git a/util/test/demos/gl/gl_parameter_zoo.cpp b/util/test/demos/gl/gl_parameter_zoo.cpp index eada123f5..f6f58e907 100644 --- a/util/test/demos/gl/gl_parameter_zoo.cpp +++ b/util/test/demos/gl/gl_parameter_zoo.cpp @@ -159,8 +159,6 @@ void main() glDeleteShader(vs); glDeleteShader(fs); - glEnable(GL_SCISSOR_TEST); - GLuint trash = MakeBuffer(); glBindBuffer(GL_PIXEL_UNPACK_BUFFER, trash); glBufferStorage(GL_PIXEL_UNPACK_BUFFER, 1024, 0, 0); @@ -195,13 +193,23 @@ void main() glPixelStorei(GL_PACK_ALIGNMENT, 8); glViewport(0, 0, GLsizei(screenWidth), GLsizei(screenHeight)); - glScissor(0, 0, GLsizei(screenWidth), GLsizei(screenHeight)); glBindBuffersBase(GL_SHADER_STORAGE_BUFFER, 0, 4, NULL); float col[] = {1.0f, 0.0f, 1.0f, 1.0f}; glClearBufferfv(GL_COLOR, 0, col); + setMarker("NoScissor"); + glDisable(GL_SCISSOR_TEST); + glScissor(0, 0, 1, 1); + glProgramUniform1i(program, glGetUniformLocation(program, "mode"), 0); + glDrawArrays(GL_TRIANGLES, 0, 3); + + glEnable(GL_SCISSOR_TEST); + glScissor(0, 0, GLsizei(screenWidth), GLsizei(screenHeight)); + + glClearBufferfv(GL_COLOR, 0, col); + glBindVertexArray(vao); glUseProgram(program); diff --git a/util/test/tests/D3D11/D3D11_Parameter_Zoo.py b/util/test/tests/D3D11/D3D11_Parameter_Zoo.py index e9c063de9..a83141c88 100644 --- a/util/test/tests/D3D11/D3D11_Parameter_Zoo.py +++ b/util/test/tests/D3D11/D3D11_Parameter_Zoo.py @@ -9,5 +9,31 @@ class D3D11_Parameter_Zoo(rdtest.TestCase): def check_capture(self): rdtest.log.success("Got {} captures as expected".format(self.demos_frame_count)) - # if we successfully got all the captures, so far that's all we care about - pass + + draw = self.find_draw("Draw") + self.check(draw is not None) + self.controller.SetFrameEvent(draw.eventId, False) + + pipe: rd.PipeState = self.controller.GetPipelineState() + + tex = rd.TextureDisplay() + tex.overlay = rd.DebugOverlay.Drawcall + tex.resourceId = pipe.GetOutputTargets()[0].resourceId + + out: rd.ReplayOutput = self.controller.CreateOutput(rd.CreateHeadlessWindowingData(100, 100), + rd.ReplayOutputType.Texture) + + out.SetTextureDisplay(tex) + + out.Display() + + overlay_id = out.GetDebugOverlayTexID() + + v = pipe.GetViewport(0) + + self.check_pixel_value(overlay_id, int(0.5 * v.width), int(0.5 * v.height), [0.8, 0.1, 0.8, 1.0], + eps=1.0 / 256.0) + + out.Shutdown() + + rdtest.log.success("Overlay color is as expected") diff --git a/util/test/tests/GL/GL_Parameter_Zoo.py b/util/test/tests/GL/GL_Parameter_Zoo.py index 5d80b3789..7efad7b69 100644 --- a/util/test/tests/GL/GL_Parameter_Zoo.py +++ b/util/test/tests/GL/GL_Parameter_Zoo.py @@ -108,3 +108,32 @@ class GL_Parameter_Zoo(rdtest.TestCase): raise rdtest.TestFailureException("Unexpected counter result {}".format(r.counter)) rdtest.log.success("Counter data retrieved successfully") + + draw = self.find_draw("NoScissor") + + self.check(draw is not None) + draw = draw.next + pipe: rd.PipeState = self.controller.GetPipelineState() + + tex = rd.TextureDisplay() + tex.overlay = rd.DebugOverlay.Drawcall + tex.resourceId = pipe.GetOutputTargets()[0].resourceId + + out: rd.ReplayOutput = self.controller.CreateOutput(rd.CreateHeadlessWindowingData(100, 100), + rd.ReplayOutputType.Texture) + + out.SetTextureDisplay(tex) + + out.Display() + + overlay_id = out.GetDebugOverlayTexID() + + v = pipe.GetViewport(0) + + self.check_pixel_value(overlay_id, int(0.5 * v.width), int(0.5 * v.height), [0.8, 0.1, 0.8, 1.0], + eps=1.0 / 256.0) + + out.Shutdown() + + rdtest.log.success("Overlay color is as expected") +