From 910f1dcd7ecec524f952a5a544af6089709e4b47 Mon Sep 17 00:00:00 2001 From: Dan Hawson Date: Mon, 6 Nov 2023 14:04:10 +0000 Subject: [PATCH] Add new d3d12_multi_wait_before_signal.py test It's currently forcibly disabled via 'check_support' because it's known to fail due to the fact that the commands are always serialised and replayed in submission order instead of the order that respects queues blocked on fence waits that get signalled later from other queues. --- .../d3d12/d3d12_multi_wait_before_signal.cpp | 1 + .../D3D12/D3D12_Multi_Wait_Before_Signal.py | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 util/test/tests/D3D12/D3D12_Multi_Wait_Before_Signal.py diff --git a/util/test/demos/d3d12/d3d12_multi_wait_before_signal.cpp b/util/test/demos/d3d12/d3d12_multi_wait_before_signal.cpp index fe416de04..6273a3824 100644 --- a/util/test/demos/d3d12/d3d12_multi_wait_before_signal.cpp +++ b/util/test/demos/d3d12/d3d12_multi_wait_before_signal.cpp @@ -433,6 +433,7 @@ float4 mainPS(in float4 pos : SV_POSITION) : SV_Target0 rootConstants[0] = 1; // myBufferIdx cmd->SetGraphicsRoot32BitConstants(0, 1, &rootConstants[0], 0); cmd->DrawInstanced(3, 1, 3, 0); + setMarker(cmd, "Last draw"); // Help locate this draw through 'find_action' in python test ResourceBarrier(cmd, bbTex[texIdx], D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_PRESENT); diff --git a/util/test/tests/D3D12/D3D12_Multi_Wait_Before_Signal.py b/util/test/tests/D3D12/D3D12_Multi_Wait_Before_Signal.py new file mode 100644 index 000000000..9cc7e29df --- /dev/null +++ b/util/test/tests/D3D12/D3D12_Multi_Wait_Before_Signal.py @@ -0,0 +1,23 @@ +import renderdoc as rd +import rdtest + +class D3D12_Multi_Wait_Before_Signal(rdtest.TestCase): + demos_test_name = 'D3D12_Multi_Wait_Before_Signal' + + def check_support(self): + # TODO: Enable this if/when rdoc can reorder from the original submission + # order, which blocks multiple queues with waits that get signalled by + # later submissions to other queues. + return False, 'Renderdoc does not yet adequately reorder capture replay' + + def check_capture(self): + draw_marker: rd.ActionDescription = self.find_action("Last draw") + self.controller.SetFrameEvent(draw_marker.eventId, False) + + pipe: rd.PipeState = self.controller.GetPipelineState() + + tex = pipe.GetOutputTargets()[0].resourceId + self.check_pixel_value(tex, 270, 194, [0.20117, 0.20117, 0.20117, 0.0]) + self.check_pixel_value(tex, 180, 170, [0.5031, 0.25, 1.0, 1.0]) + self.check_pixel_value(tex, 180, 194, [0.25, 0.75391, 1.0, 1.0]) +