For Test D3D12_Sharing validate the D3D12 Drawcall results

In addition to the Copy results
This commit is contained in:
Jake Turner
2024-09-18 12:45:55 +01:00
parent 33fb099a37
commit 42a1b4e641
2 changed files with 32 additions and 17 deletions
+2
View File
@@ -142,6 +142,8 @@ RD_TEST(D3D12_Sharing, D3D12GraphicsTest)
OMSetRenderTargets(cmd, {rtv}, {});
setMarker(cmd, "Draw");
cmd->DrawInstanced(3, 1, 0, 0);
ResourceBarrier(cmd, d3d12tex, D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_COMMON);
+30 -17
View File
@@ -6,29 +6,42 @@ class D3D12_Sharing(rdtest.TestCase):
demos_test_name = 'D3D12_Sharing'
def check_capture(self):
action = self.find_action("Copy")
markers = ["Draw", "Copy"]
for marker in markers:
action = self.find_action(marker)
action: rd.ActionDescription = action.next
action: rd.ActionDescription = action.next
self.controller.SetFrameEvent(action.eventId, False)
self.controller.SetFrameEvent(action.eventId, False)
pipe: rd.PipeState = self.controller.GetPipelineState()
pipe: rd.PipeState = self.controller.GetPipelineState()
# Should be white in the top left, green in the bottom right, and red elsewhere
self.check_pixel_value(action.copyDestination, 0.2, 0.2, [1.0, 1.0, 1.0, 1.0])
self.check_pixel_value(action.copyDestination, 0.3, 0.3, [1.0, 1.0, 1.0, 1.0])
self.check_pixel_value(action.copyDestination, 0.4, 0.4, [1.0, 1.0, 1.0, 1.0])
rdtest.log.print(f"Checking Event: {marker}")
draw = marker == "Draw"
target = action.outputs[0] if draw else action.copyDestination
self.check_pixel_value(action.copyDestination, 0.6, 0.6, [0.0, 1.0, 0.0, 1.0])
self.check_pixel_value(action.copyDestination, 0.7, 0.7, [0.0, 1.0, 0.0, 1.0])
self.check_pixel_value(action.copyDestination, 0.8, 0.8, [0.0, 1.0, 0.0, 1.0])
# Draw : Should be red in the top left
# Copy : Should be white in the top left
expected = [1.0, 0.0, 0.0, 1.0] if draw else [1.0, 1.0, 1.0, 1.0]
self.check_pixel_value(target, 0.2, 0.2, expected)
self.check_pixel_value(target, 0.3, 0.3, expected)
self.check_pixel_value(target, 0.4, 0.4, expected)
self.check_pixel_value(action.copyDestination, 0.1, 0.6, [1.0, 0.0, 0.0, 1.0])
self.check_pixel_value(action.copyDestination, 0.1, 0.7, [1.0, 0.0, 0.0, 1.0])
self.check_pixel_value(action.copyDestination, 0.1, 0.8, [1.0, 0.0, 0.0, 1.0])
# green in the bottom right
expected = [0.0, 1.0, 0.0, 1.0]
self.check_pixel_value(target, 0.6, 0.6, expected)
self.check_pixel_value(target, 0.7, 0.7, expected)
self.check_pixel_value(target, 0.8, 0.8, expected)
self.check_pixel_value(action.copyDestination, 0.6, 0.1, [1.0, 0.0, 0.0, 1.0])
self.check_pixel_value(action.copyDestination, 0.7, 0.1, [1.0, 0.0, 0.0, 1.0])
self.check_pixel_value(action.copyDestination, 0.8, 0.1, [1.0, 0.0, 0.0, 1.0])
# red elsewhere
expected = [1.0, 0.0, 0.0, 1.0]
self.check_pixel_value(target, 0.1, 0.6, expected)
self.check_pixel_value(target, 0.1, 0.7, expected)
self.check_pixel_value(target, 0.1, 0.8, expected)
expected = [1.0, 0.0, 0.0, 1.0]
self.check_pixel_value(target, 0.6, 0.1, expected)
self.check_pixel_value(target, 0.7, 0.1, expected)
self.check_pixel_value(target, 0.8, 0.1, expected)
rdtest.log.success("Picked values are as expected")