diff --git a/util/test/tests/D3D12/D3D12_Execute_Indirect.py b/util/test/tests/D3D12/D3D12_Execute_Indirect.py index 8be33df9a..790ada0a7 100644 --- a/util/test/tests/D3D12/D3D12_Execute_Indirect.py +++ b/util/test/tests/D3D12/D3D12_Execute_Indirect.py @@ -1,11 +1,23 @@ import renderdoc as rd import rdtest import struct - +from typing import List class D3D12_Execute_Indirect(rdtest.TestCase): demos_test_name = 'D3D12_Execute_Indirect' + def check_pixel_history_succeeds(self): + pipe: rd.PipeState = self.controller.GetPipelineState() + rt = pipe.GetOutputTargets()[0] + tex = rt.resource + sub = rd.Subresource() + x = 200 + y = 150 + modifs: List[rd.PixelModification] = self.controller.PixelHistory(tex, x, y, sub, rt.format.compType) + if len(modifs) == 0: + raise rdtest.TestFailureException("No pixel history found") + rdtest.log.success("Pixel History Worked") + def check_capture(self): from_eid = self.find_action("Multiple draws").eventId for i in range(8): @@ -60,6 +72,8 @@ class D3D12_Execute_Indirect(rdtest.TestCase): } self.check_mesh_data(postvs_ref, postvs_data) + self.check_pixel_history_succeeds() + from_eid = action.eventId + 1 pipe = self.controller.GetPipelineState() @@ -91,6 +105,8 @@ class D3D12_Execute_Indirect(rdtest.TestCase): rdtest.log.success("State is reset after execute") + self.check_pixel_history_succeeds() + action = self.find_action("Post Single dispatch") self.controller.SetFrameEvent(action.eventId, False) @@ -110,6 +126,8 @@ class D3D12_Execute_Indirect(rdtest.TestCase): rdtest.log.success("Dispatch buffer output is correct") + self.check_pixel_history_succeeds() + # The final draw is in indeterminate order because the parameters are defined by a compute shader in # indeterminate order # If the vertex buffer is referenced in the wrong order (e.g. by cached draw parameters) it will show exploding @@ -172,6 +190,8 @@ class D3D12_Execute_Indirect(rdtest.TestCase): raise rdtest.TestFailureException( "Detected an exploded polygon with {} selected".format(action.GetName(sdfile))) + self.check_pixel_history_succeeds() + rdtest.log.success(f"Pass {passNum} of unordered draw was correct") # This does not draw anything but its argument buffer is fully used with no spare bytes @@ -184,6 +204,7 @@ class D3D12_Execute_Indirect(rdtest.TestCase): if len(pipe.GetOutputTargets()) != 1: raise rdtest.TestFailureException( f"With event {action.eventId + drawNum} selected we should have one output target but there is {len(pipe.GetOutputTargets())}") + self.check_pixel_history_succeeds() rdtest.log.success("Fully used argument buffer with multiple draws replayed") # This does not draw anything but its argument buffer is fully used with no spare bytes @@ -191,9 +212,11 @@ class D3D12_Execute_Indirect(rdtest.TestCase): action = self.find_action("Full Arg Buffer: State + Draw") action = self.find_action("IndirectDraw", action.eventId) for drawNum in range(3): - self.controller.SetFrameEvent(action.eventId + drawNum, False) + self.controller.SetFrameEvent(action.eventId, False) pipe = self.controller.GetPipelineState() if len(pipe.GetOutputTargets()) != 1: raise rdtest.TestFailureException( f"With event {action.eventId + drawNum} selected we should have one output target but there is {len(pipe.GetOutputTargets())}") + self.check_pixel_history_succeeds() + action = action.next rdtest.log.success("Fully used argument buffer with multiple states + draws replayed")