Test that overlays work on D3D12 with no viewport or scissor bound

This commit is contained in:
baldurk
2020-10-22 14:48:33 +01:00
parent 3f8fb1e1b6
commit ec73718cf0
3 changed files with 69 additions and 4 deletions
+29 -2
View File
@@ -182,6 +182,7 @@ float4 main() : SV_Target0
pipe[1] = creator;
creator.GraphicsDesc.DepthStencilState.StencilEnable = FALSE;
creator.GraphicsDesc.DepthStencilState.DepthEnable = FALSE;
creator.GraphicsDesc.DepthStencilState.DepthFunc = D3D12_COMPARISON_FUNC_ALWAYS;
creator.PS(whitepsblob);
creator.DSV(DXGI_FORMAT_UNKNOWN);
@@ -309,12 +310,38 @@ float4 main() : SV_Target0
setMarker(cmd, "Subresources mip 3");
cmd->DrawInstanced(24, 1, 9, 0);
FinishUsingBackbuffer(cmd, D3D12_RESOURCE_STATE_RENDER_TARGET);
cmd->Close();
Submit({cmd});
{
cmd = GetCommandBuffer();
Reset(cmd);
D3D12_CPU_DESCRIPTOR_HANDLE rtv =
MakeRTV(bb).Format(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB).CreateCPU(0);
cmd->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
IASetVertexBuffer(cmd, vb, sizeof(DefaultA2V), 0);
cmd->SetGraphicsRootSignature(sig);
OMSetRenderTargets(cmd, {rtv}, {});
cmd->SetPipelineState(whitepipe);
setMarker(cmd, "NoView draw");
cmd->DrawInstanced(3, 1, 33, 0);
FinishUsingBackbuffer(cmd, D3D12_RESOURCE_STATE_RENDER_TARGET);
cmd->Close();
}
Submit({cmd});
Present();
}
+1 -1
View File
@@ -633,7 +633,7 @@ class Overlay_Test(rdtest.TestCase):
if overlay == rd.DebugOverlay.ClearBeforeDraw or overlay == rd.DebugOverlay.ClearBeforePass:
continue
rdtest.log.success("Checking overlay {} with mip/slice rendering".format(str(overlay)))
rdtest.log.print("Checking overlay {} with mip/slice rendering".format(str(overlay)))
tex.resourceId = col_tex
tex.overlay = overlay
+39 -1
View File
@@ -4,4 +4,42 @@ import renderdoc as rd
class D3D12_Overlay_Test(rdtest.Overlay_Test):
demos_test_name = 'D3D12_Overlay_Test'
internal = False
internal = False
def check_capture(self):
super(D3D12_Overlay_Test, self).check_capture()
out: rd.ReplayOutput = self.controller.CreateOutput(rd.CreateHeadlessWindowingData(100, 100), rd.ReplayOutputType.Texture)
# Don't check any pixel values, but ensure all overlays at least work with no viewport/scissor bound
sub_marker: rd.DrawcallDescription = self.find_draw("NoView draw")
self.controller.SetFrameEvent(sub_marker.next.eventId, True)
pipe: rd.PipeState = self.controller.GetPipelineState()
tex = rd.TextureDisplay()
tex.resourceId = pipe.GetOutputTargets()[0].resourceId
for overlay in rd.DebugOverlay:
if overlay == rd.DebugOverlay.NoOverlay:
continue
# These overlays are just displaymodes really, not actually separate overlays
if overlay == rd.DebugOverlay.NaN or overlay == rd.DebugOverlay.Clipping:
continue
if overlay == rd.DebugOverlay.ClearBeforeDraw or overlay == rd.DebugOverlay.ClearBeforePass:
continue
rdtest.log.success("Checking overlay {} with no viewport/scissor".format(str(overlay)))
tex.overlay = overlay
out.SetTextureDisplay(tex)
out.Display()
overlay_id: rd.ResourceId = out.GetDebugOverlayTexID()
rdtest.log.success("Overlay {} rendered with no viewport/scissor".format(str(overlay)))
out.Shutdown()