mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Test APIs where scissor can be disabled doesn't affect overlays
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user