Use local helper function for setting current EID

* This lets the testcase track the current EID and print it when a failure
  happens
This commit is contained in:
baldurk committed 2026-09-11 19:19:27 +01:00
1 parent 4fffe30bd4
commit 2a0989ba9a
155 files changed
+413 -389

No files matched your search

+10 -1
View File
@@ -7,7 +7,7 @@ import mimetypes
import threading
import difflib
import shutil
from typing import IO, Any, List, Type
from typing import IO, Any, Callable, List, Type
from . import util
@@ -29,6 +29,7 @@ class TestLogger:
def __init__(self):
self.indentation = 0
self.test_name = ''
self.ctx_callback: Callable[[], None] | None = None
self.outputs: List[IO[str]] = [sys.stdout]
self.failed = False
self.section_failed = False
@@ -70,6 +71,9 @@ class TestLogger:
else:
self.outputs.append(o)
def set_context(self, ctx: Callable[[], None] | None | None):
self.ctx_callback = ctx
def print(self, line: str, with_stdout=True):
self.rawprint('.. ' + line, with_stdout)
@@ -177,6 +181,11 @@ class TestLogger:
else:
self.rawprint(f"!+ FAILURE in {self.test_name}: {type(ex).__name__} {ex!s}")
if self.ctx_callback is not None:
self.rawprint('>> Section Context')
self.ctx_callback()
self.rawprint('<< Section Context')
self.rawprint('>> Callstack')
for frame in reversed(tb):
filename = util.sanitise_filename(frame.filename)
+3
View File
@@ -529,6 +529,7 @@ def internal_run_test(thread: int, test_name: str):
try:
instance = testclass()
log.set_context(lambda: instance.log_context())
instance.worker_thread = thread
instance.invoketest(False)
suceeded = True
@@ -538,6 +539,8 @@ def internal_run_test(thread: int, test_name: str):
except Exception as ex:
log.failure(ex)
suceeded = False
finally:
log.set_context(None)
logfile = rd.GetLogFile()
if server is not None:
+1 -1
View File
@@ -14,7 +14,7 @@ class Buffer_Truncation(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
vsin_ref: rdtest.MeshReference = {
0: {
+2 -2
View File
@@ -184,7 +184,7 @@ class Discard_Zoo(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, True)
self.set_event(action.eventId, True)
for tex in self.controller.GetTextures():
res = self.get_resource(tex.resourceId)
@@ -196,7 +196,7 @@ class Discard_Zoo(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, True)
self.set_event(action.eventId, True)
for tex in self.controller.GetTextures():
res = self.get_resource(tex.resourceId)
+1 -1
View File
@@ -51,7 +51,7 @@ class Draw_Zoo(rdtest.TestCase):
def check_action(self, action: rd.ActionDescription, ref_data: ActionRef):
rdtest.log.print(f"Checking action {action.eventId}")
self.controller.SetFrameEvent(action.eventId, True)
self.set_event(action.eventId, True)
self.pipe = self.controller.GetPipelineState()
+1 -1
View File
@@ -57,7 +57,7 @@ class Groupshared(rdtest.TestCase):
for test, action in enumerate(tests):
failed = False
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
csrefl = pipe.GetShaderReflection(rd.ShaderStage.Compute)
+8 -7
View File
@@ -75,10 +75,11 @@ class Mesh_Zoo():
rdtest.log.success(f"Picking {x},{y} returns vertex {result[0]} in instance {result[1]} as expected")
def check_capture(self, capture_filename: str, controller: rd.ReplayController):
self.controller = controller
def check_capture(self, capture_filename: str, test: rdtest.testcase.TestCase):
self.test = test
self.controller = test.controller
self.controller.SetFrameEvent(self.find_action("Quad").nextAction.eventId, False)
self.test.set_event(self.find_action("Quad").nextAction.eventId, False)
self.out = self.controller.CreateOutput(
rd.CreateHeadlessWindowingData(200, 200), rd.ReplayOutputType.Mesh
@@ -358,7 +359,7 @@ class Mesh_Zoo():
rdtest.log.success("Both instance picking is as expected")
self.controller.SetFrameEvent(self.find_action("Points").nextAction.eventId, False)
self.test.set_event(self.find_action("Points").nextAction.eventId, False)
# Only one instance, just check we can see the points
self.cfg.curInstance = 0
@@ -388,7 +389,7 @@ class Mesh_Zoo():
rdtest.log.success("Point solid and lit rendering works as expected")
self.controller.SetFrameEvent(self.find_action("Lines").nextAction.eventId, False)
self.test.set_event(self.find_action("Lines").nextAction.eventId, False)
self.cache_output()
self.cfg.visualisationMode = rd.Visualisation.Lit
@@ -396,7 +397,7 @@ class Mesh_Zoo():
rdtest.log.success("Lines solid and lit rendering works as expected")
self.controller.SetFrameEvent(self.find_action("Stride 0").nextAction.eventId, False)
self.test.set_event(self.find_action("Stride 0").nextAction.eventId, False)
self.cfg.position = self.controller.GetPostVSData(0, 0, self.cfg.type)
self.cfg.position.nearPlane = 1.0
@@ -411,7 +412,7 @@ class Mesh_Zoo():
self.check_vertex(105, 65, (rd.ReplayOutput.NoResult, rd.ReplayOutput.NoResult))
self.check_vertex(115, 135, (rd.ReplayOutput.NoResult, rd.ReplayOutput.NoResult))
self.controller.SetFrameEvent(self.find_action("Empty").nextAction.eventId, False)
self.test.set_event(self.find_action("Empty").nextAction.eventId, False)
self.cfg.position = self.controller.GetPostVSData(0, 0, self.cfg.type)
self.cfg.position.nearPlane = 1.0
+6 -6
View File
@@ -40,7 +40,7 @@ class Overlay_Test(rdtest.TestCase):
marker_name += fmt
test_marker = self.find_action(marker_name, base_event)
self.controller.SetFrameEvent(test_marker.nextAction.eventId, True)
self.set_event(test_marker.nextAction.eventId, True)
rdtest.log.print(f"Checking overlays at event {test_marker.nextAction.eventId}: {marker_name}")
@@ -429,7 +429,7 @@ class Overlay_Test(rdtest.TestCase):
# Shader with discard
test_marker = self.find_action("Discard " + marker_name, base_event)
self.controller.SetFrameEvent(test_marker.nextAction.eventId, True)
self.set_event(test_marker.nextAction.eventId, True)
pipe = self.controller.GetPipelineState()
tex.overlay = rd.DebugOverlay.Depth
out.SetTextureDisplay(tex)
@@ -440,7 +440,7 @@ class Overlay_Test(rdtest.TestCase):
# Check the viewport overlay especially
view_marker = self.find_action("Viewport Test " + fmt, base_event)
self.controller.SetFrameEvent(view_marker.nextAction.eventId, True)
self.set_event(view_marker.nextAction.eventId, True)
pipe = self.controller.GetPipelineState()
@@ -559,7 +559,7 @@ class Overlay_Test(rdtest.TestCase):
# Check the sample mask test
mask_marker = self.find_action("Sample Mask Test " + fmt, base_event)
self.controller.SetFrameEvent(mask_marker.nextAction.eventId, True)
self.set_event(mask_marker.nextAction.eventId, True)
col_tex = pipe.GetOutputTargets()[0].resource
@@ -589,7 +589,7 @@ class Overlay_Test(rdtest.TestCase):
test_marker = self.find_action("Normal Test " + fmt, base_event)
# Now check clear-before-X by hand, for colour and for depth
self.controller.SetFrameEvent(test_marker.nextAction.eventId, True)
self.set_event(test_marker.nextAction.eventId, True)
col_tex = pipe.GetOutputTargets()[0].resource
@@ -728,7 +728,7 @@ class Overlay_Test(rdtest.TestCase):
for mip in [2, 3]:
sub_marker = self.find_action(f"Subresources mip {mip}", base_event)
self.controller.SetFrameEvent(sub_marker.nextAction.eventId, True)
self.set_event(sub_marker.nextAction.eventId, True)
pipe = self.controller.GetPipelineState()
+11 -11
View File
@@ -72,7 +72,7 @@ class Pixel_History(rdtest.TestCase):
def batch_test(self, base_eid: int):
test_marker = self.find_action("Simple Test", base_eid)
self.controller.SetFrameEvent(test_marker.nextAction.eventId, True)
self.set_event(test_marker.nextAction.eventId, True)
pipe = self.controller.GetPipelineState()
@@ -437,7 +437,7 @@ class Pixel_History(rdtest.TestCase):
rdtest.log.print("Testing stencil/scissor checks")
test_marker = self.find_action("Stencil Mask", base_eid)
self.controller.SetFrameEvent(test_marker.nextAction.eventId, True)
self.set_event(test_marker.nextAction.eventId, True)
x, y = self.relative_xy(106, 248)
rdtest.log.print(f"Testing pixel {x}, {y}")
@@ -478,7 +478,7 @@ class Pixel_History(rdtest.TestCase):
rdtest.log.print("Testing depth test for per fragment reporting")
test_marker = self.find_action("Depth Test", base_eid)
self.controller.SetFrameEvent(test_marker.nextAction.eventId, True)
self.set_event(test_marker.nextAction.eventId, True)
x, y = self.relative_xy(275, 258)
rdtest.log.print(f"Testing pixel {x}, {y}")
@@ -585,7 +585,7 @@ class Pixel_History(rdtest.TestCase):
# For pixel 60, 130 inside the light green triangle which is 300 draws of 1 instance of 1 triangle
rdtest.log.print("Testing Lots of Drawcalls")
test_marker = self.find_action("300 Instances", base_eid)
self.controller.SetFrameEvent(test_marker.nextAction.eventId, True)
self.set_event(test_marker.nextAction.eventId, True)
x, y = self.relative_xy(60, 130)
rdtest.log.print(f"Testing pixel {x}, {y}")
modifs = self.controller.PixelHistory(tex, x, y, sub, comp)
@@ -616,7 +616,7 @@ class Pixel_History(rdtest.TestCase):
rdtest.log.print("Testing Sample colouring")
test_marker = self.find_action("Sample Colouring", base_eid)
self.controller.SetFrameEvent(test_marker.nextAction.eventId, True)
self.set_event(test_marker.nextAction.eventId, True)
x, y = self.relative_xy(330, 200)
rdtest.log.print(f"Testing pixel {x}, {y}")
modifs = self.controller.PixelHistory(tex, x, y, sub, comp)
@@ -693,7 +693,7 @@ class Pixel_History(rdtest.TestCase):
rdtest.log.print("Testing depth-equal testing")
test_marker = self.find_action("Depth Equal Pass", base_eid)
self.controller.SetFrameEvent(test_marker.nextAction.eventId, True)
self.set_event(test_marker.nextAction.eventId, True)
x, y = self.relative_xy(200, 250)
rdtest.log.print(f"Testing pixel {x}, {y}")
@@ -735,7 +735,7 @@ class Pixel_History(rdtest.TestCase):
rdtest.log.print("Testing colour masking")
test_marker = self.find_action("Colour Masked", base_eid)
self.controller.SetFrameEvent(test_marker.nextAction.eventId, True)
self.set_event(test_marker.nextAction.eventId, True)
x, y = self.relative_xy(60, 80)
rdtest.log.print(f"Testing pixel {x}, {y}")
@@ -760,7 +760,7 @@ class Pixel_History(rdtest.TestCase):
# don't have compute writes in secondaries and some tests like D3D MSAA won't have compute writes
if test_marker is not None and not self.is_secondary and base_eid in self.get_hierarchy(test_marker.eventId):
self.controller.SetFrameEvent(test_marker.nextAction.eventId, True)
self.set_event(test_marker.nextAction.eventId, True)
x, y = self.relative_xy(225, 85)
rdtest.log.print(f"Testing pixel {x}, {y}")
modifs = self.controller.PixelHistory(tex, x, y, sub, comp)
@@ -787,7 +787,7 @@ class Pixel_History(rdtest.TestCase):
rdtest.log.print("Testing overflowed writes")
test_marker = self.find_action("Overflowing", base_eid)
self.controller.SetFrameEvent(test_marker.nextAction.eventId, True)
self.set_event(test_marker.nextAction.eventId, True)
x, y = self.relative_xy(105, 50)
rdtest.log.print(f"Testing pixel {x}, {y}")
@@ -834,7 +834,7 @@ class Pixel_History(rdtest.TestCase):
rdtest.log.print("Testing per-fragment discards")
test_marker = self.find_action("Per-Fragment discarding", base_eid)
self.controller.SetFrameEvent(test_marker.nextAction.eventId, True)
self.set_event(test_marker.nextAction.eventId, True)
x, y = self.relative_xy(60, 160)
rdtest.log.print(f"Testing pixel {x}, {y}")
@@ -884,7 +884,7 @@ class Pixel_History(rdtest.TestCase):
x, y = self.relative_xy(120, 110)
rdtest.log.print(f"Testing D3D no-output shader {x}, {y}")
test_marker = self.find_action("No Output Shader", base_eid)
self.controller.SetFrameEvent(test_marker.nextAction.eventId, True)
self.set_event(test_marker.nextAction.eventId, True)
modifs = self.controller.PixelHistory(tex, x, y, sub, comp)
events = [
+2 -2
View File
@@ -69,7 +69,7 @@ class Subgroup_Zoo(rdtest.TestCase):
for test, action in enumerate(compute_tests):
failed = False
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
csrefl = pipe.GetShaderReflection(rd.ShaderStage.Compute)
@@ -145,7 +145,7 @@ class Subgroup_Zoo(rdtest.TestCase):
overallFailed = False
for idx, action in enumerate(graphics_tests):
failed = False
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
+8 -5
View File
@@ -561,7 +561,7 @@ class Texture_Zoo():
if 'slice tests' in d.customName:
for sub in d.children:
if sub.flags & rd.ActionFlags.Drawcall:
self.controller.SetFrameEvent(sub.eventId, True)
self.test.set_event(sub.eventId, True)
pipe = self.controller.GetPipelineState()
@@ -629,7 +629,7 @@ class Texture_Zoo():
tests_run = tests_run + 1
try:
# Set this event as current
self.controller.SetFrameEvent(sub.eventId, True)
self.test.set_event(sub.eventId, True)
self.filename = (d.customName + '@' + name).replace('->', '_')
@@ -653,8 +653,9 @@ class Texture_Zoo():
else:
raise rdtest.TestFailureException("Some tests were not as expected")
def check_capture(self, capture_filename: str, controller: rd.ReplayController):
self.controller = controller
def check_capture(self, capture_filename: str, test: rdtest.testcase.TestCase):
self.test = test
self.controller = test.controller
self.pipeType = self.controller.GetAPIProperties().pipelineType
self.opengl_mode = (self.controller.GetAPIProperties().pipelineType == rd.GraphicsAPI.OpenGL)
@@ -705,6 +706,7 @@ class Texture_Zoo():
result, self.controller = remote.OpenCapture(
proxies.index(api), capture_filename, rd.ReplayOptions(), None
)
self.test.controller = self.controller
# Now check with the proxy
self.check_capture_with_controller(api)
@@ -741,6 +743,7 @@ class Texture_Zoo():
continue
result, self.controller = cap.OpenCapture(rd.ReplayOptions(), None)
self.test.controller = self.controller
if not result:
rdtest.log.error(f"Couldn't open {file.name}")
@@ -751,7 +754,7 @@ class Texture_Zoo():
[a, b] = file.name.replace('.dds', ' (DDS)').replace('.png', ' (PNG)').split('@')
self.controller.SetFrameEvent(self.controller.GetRootActions()[0].eventId, True)
self.test.set_event(self.controller.GetRootActions()[0].eventId, True)
try:
self.opengl_mode = False
+9 -1
View File
@@ -166,6 +166,7 @@ class TestCase:
self.worker_thread = 0
self.controller: rd.ReplayController | None = None
self.sdfile: rd.SDFile | None = None
self.cur_event = 0
self._variables = []
def get_time(self):
@@ -241,6 +242,13 @@ class TestCase:
return self.sdfile.chunks[action.events[-1].chunkIndex].name
def set_event(self, eid: int, force: bool):
self.cur_event = eid
self.controller.SetFrameEvent(eid, force)
def log_context(self):
log.print(f"Current Event: {self.cur_event}")
def _find_action(self, name: str, start_event: int, action_list: List[rd.ActionDescription]) -> rd.ActionDescription | None:
bestMatch = None
distance = 1000000
@@ -694,7 +702,7 @@ class TestCase:
last_action = self.get_last_action()
self.controller.SetFrameEvent(last_action.eventId, True)
self.set_event(last_action.eventId, True)
save_data = rd.TextureSave()
save_data.resourceId = last_action.copyDestination
@@ -11,7 +11,7 @@ class D3D11_AMD_Shader_Extensions(rdtest.TestCase):
def check_capture(self):
action = self.get_last_action()
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
# Should have barycentrics showing the closest vertex for each pixel in the triangle
# Without relying on barycentric order, ensure that the three pixels are red, green, and blue
@@ -81,7 +81,7 @@ class D3D11_AMD_Shader_Extensions(rdtest.TestCase):
rdtest.log.success("compute shader disassembly is as expected")
if refl.debugInfo.debuggable:
self.controller.SetFrameEvent(self.find_action("Dispatch").eventId, False)
self.set_event(self.find_action("Dispatch").eventId, False)
trace = self.controller.DebugThread((0, 0, 0), (0, 0, 0))
+1 -1
View File
@@ -12,7 +12,7 @@ class D3D11_CBuffer_Zoo(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
+1 -1
View File
@@ -8,7 +8,7 @@ class D3D11_Deferred_Map(rdtest.TestCase):
# Check at the last action
action = self.get_last_action()
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
+2 -2
View File
@@ -16,7 +16,7 @@ class D3D11_Discard_Zoo(rdtest.Discard_Zoo):
assert action is not None
self.controller.SetFrameEvent(action.eventId, True)
self.set_event(action.eventId, True)
# Check the buffer
for res in self.controller.GetResources():
@@ -29,7 +29,7 @@ class D3D11_Discard_Zoo(rdtest.Discard_Zoo):
assert action is not None
self.controller.SetFrameEvent(action.eventId, True)
self.set_event(action.eventId, True)
# Check the buffers
for res in self.controller.GetResources():
@@ -8,7 +8,7 @@ class D3D11_Feature_Level_9(rdtest.TestCase):
def check_capture(self):
last_action = self.get_last_action()
self.controller.SetFrameEvent(last_action.eventId, True)
self.set_event(last_action.eventId, True)
self.check_triangle(out=last_action.copyDestination)
@@ -16,7 +16,7 @@ class D3D11_Feature_Level_9(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices)
+2 -2
View File
@@ -21,7 +21,7 @@ class D3D11_Frame0(rdtest.TestCase):
last_action = self.get_last_action()
self.controller.SetFrameEvent(last_action.eventId, True)
self.set_event(last_action.eventId, True)
self.check_triangle(out=last_action.copyDestination)
@@ -31,7 +31,7 @@ class D3D11_Frame0(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices)
+1 -1
View File
@@ -10,7 +10,7 @@ class D3D11_Large_Buffer(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
vsin_ref: rdtest.MeshReference = {
0: {
+1 -1
View File
@@ -10,4 +10,4 @@ class D3D11_Mesh_Zoo(rdtest.TestCase):
def check_capture(self):
assert self.controller is not None
self.zoo_helper.check_capture(self.capture_filename, self.controller)
self.zoo_helper.check_capture(self.capture_filename, self)
+2 -2
View File
@@ -12,7 +12,7 @@ class D3D11_Parameter_Zoo(rdtest.TestCase):
action = self.find_action("Draw")
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -68,7 +68,7 @@ class D3D11_Parameter_Zoo(rdtest.TestCase):
action = self.find_action("RastState")
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe11 = self.controller.GetD3D11PipelineState()
+1 -1
View File
@@ -15,7 +15,7 @@ class D3D11_PrimitiveID(rdtest.TestCase):
expected_prim: rdtest.VectorValue,
expected_output: rdtest.VectorValue | None,
):
self.controller.SetFrameEvent(action.eventId, True)
self.set_event(action.eventId, True)
pipe = self.controller.GetPipelineState()
pixel_inputs = rd.DebugPixelInputs()
@@ -10,7 +10,7 @@ class D3D11_Primitive_Restart(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -56,7 +56,7 @@ class D3D11_Primitive_Restart(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices)
@@ -22,7 +22,7 @@ class D3D11_Refcount_Check(rdtest.TestCase):
action = action.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -8,7 +8,7 @@ class D3D11_Resource_Lifetimes(rdtest.TestCase):
def check_capture(self):
last_action = self.get_last_action()
self.controller.SetFrameEvent(last_action.eventId, True)
self.set_event(last_action.eventId, True)
tex = last_action.copyDestination
@@ -17,7 +17,7 @@ class D3D11_Shader_Debug_Zoo(rdtest.TestCase):
action = action.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -57,7 +57,7 @@ class D3D11_Shader_Debug_Zoo(rdtest.TestCase):
rdtest.log.begin_section("Flow tests")
action = self.find_action("Flow Test").nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
# Debug the shader
@@ -85,7 +85,7 @@ class D3D11_Shader_Debug_Zoo(rdtest.TestCase):
rdtest.log.begin_section("MSAA tests")
action = self.find_action("MSAA Test").nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
for (x,y) in [(4, 4), (4, 5), (3, 4), (3, 5)]:
for test in range(4):
@@ -7,14 +7,14 @@ class D3D11_Shader_Editing(rdtest.TestCase):
def check_capture(self):
eid = self.find_action("Draw 1").nextAction.eventId
self.controller.SetFrameEvent(eid, False)
self.set_event(eid, False)
pipe = self.controller.GetPipelineState()
psrefl1 = pipe.GetShaderReflection(rd.ShaderStage.Pixel)
eid = self.find_action("Draw 2").nextAction.eventId
self.controller.SetFrameEvent(eid, False)
self.set_event(eid, False)
pipe = self.controller.GetPipelineState()
@@ -102,7 +102,7 @@ class D3D11_Shader_Editing(rdtest.TestCase):
self.controller.ReplaceResource(psrefl2.resourceId, ps2)
# Refresh the replay if it didn't happen already
self.controller.SetFrameEvent(eid, True)
self.set_event(eid, True)
# Triangles have green and blue channel
self.check_pixel_value(tex, 0.25, 0.5, [0.0, 1.0, 1.0, 1.0])
@@ -112,7 +112,7 @@ class D3D11_Shader_Editing(rdtest.TestCase):
# Now "edit" the VS but don't change it. We should still get the same values
self.controller.ReplaceResource(vsrefl.resourceId, nochangeVS)
self.controller.SetFrameEvent(eid, True)
self.set_event(eid, True)
# Triangles have green and blue channel
self.check_pixel_value(tex, 0.25, 0.5, [0.0, 1.0, 1.0, 1.0])
@@ -122,7 +122,7 @@ class D3D11_Shader_Editing(rdtest.TestCase):
# Change the VS to one that has ofpset the triangles off-centre
self.controller.ReplaceResource(vsrefl.resourceId, offsetVS)
self.controller.SetFrameEvent(eid, True)
self.set_event(eid, True)
# Original sample positions are now the clear color
self.check_pixel_value(tex, 0.25, 0.5, [0.2, 0.2, 0.2, 1.0])
@@ -136,7 +136,7 @@ class D3D11_Shader_Editing(rdtest.TestCase):
# Now undo the first ps edit
self.controller.RemoveReplacement(psrefl1.resourceId)
self.controller.SetFrameEvent(eid, True)
self.set_event(eid, True)
# Original sample positions are still the clear color
self.check_pixel_value(tex, 0.25, 0.5, [0.2, 0.2, 0.2, 1.0])
@@ -150,7 +150,7 @@ class D3D11_Shader_Editing(rdtest.TestCase):
# Now undo the first VS edit
self.controller.RemoveReplacement(vsrefl.resourceId)
self.controller.SetFrameEvent(eid, True)
self.set_event(eid, True)
# The right triangle is the edited colour, but they are back in the original positions
self.check_pixel_value(tex, 0.25, 0.5, [0.0, 1.0, 0.0, 1.0])
@@ -160,7 +160,7 @@ class D3D11_Shader_Editing(rdtest.TestCase):
# finally undo the second ps edit
self.controller.RemoveReplacement(psrefl2.resourceId)
self.controller.SetFrameEvent(eid, True)
self.set_event(eid, True)
# We should be back to where we started
self.check_pixel_value(tex, 0.25, 0.5, [0.0, 1.0, 0.0, 1.0])
+1 -1
View File
@@ -12,7 +12,7 @@ class D3D11_Shader_ISA(rdtest.TestCase):
is_amd = 'AMD' in action.customName
self.controller.SetFrameEvent(action.nextAction.eventId, False)
self.set_event(action.nextAction.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -14,7 +14,7 @@ class D3D11_Shader_Linkage_Zoo(rdtest.TestCase):
event_name = test_marker.customName
test_marker = self.find_action("draw", action.eventId)
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
# Debug the shader
@@ -8,7 +8,7 @@ class D3D11_Simple_Triangle(rdtest.TestCase):
def check_capture(self):
last_action = self.get_last_action()
self.controller.SetFrameEvent(last_action.eventId, True)
self.set_event(last_action.eventId, True)
self.check_triangle(out=last_action.copyDestination)
@@ -18,7 +18,7 @@ class D3D11_Simple_Triangle(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices)
+1 -1
View File
@@ -10,7 +10,7 @@ class D3D11_Stream_Out(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
+1 -1
View File
@@ -12,7 +12,7 @@ class D3D11_Swapchain_Zoo(rdtest.TestCase):
action = self.find_action("DrawIndexed")
while action is not None:
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
self.check_triangle(back=[0.0, 0.0, 0.0, 1.0])
+1 -1
View File
@@ -13,5 +13,5 @@ class D3D11_Texture_Zoo(rdtest.TestCase):
assert self.controller is not None
# This takes ownership of the controller and shuts it down when it's finished
self.zoo_helper.worker_thread = self.worker_thread
self.zoo_helper.check_capture(self.capture_filename, self.controller)
self.zoo_helper.check_capture(self.capture_filename, self)
self.controller = None
@@ -8,7 +8,7 @@ class D3D11_Untyped_Backbuffer_Descriptor(rdtest.TestCase):
# find the first action
action = self.find_action("Draw")
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -19,7 +19,7 @@ class D3D11_Untyped_Backbuffer_Descriptor(rdtest.TestCase):
# find the second action
action = self.find_action("Draw", action.eventId+1)
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -11,7 +11,7 @@ class D3D11_Vertex_Attr_Zoo(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
ref: rdtest.MeshReference = {
0: {
@@ -13,7 +13,7 @@ class D3D12_AMD_Shader_Extensions(rdtest.TestCase):
action = self.find_action(pass_type + " Draw")
if action is not None:
self.controller.SetFrameEvent(action.nextAction.eventId, False)
self.set_event(action.nextAction.eventId, False)
pipe = self.controller.GetPipelineState()
tex = pipe.GetOutputTargets()[0].resource
@@ -41,7 +41,7 @@ class D3D12_AMD_Shader_Extensions(rdtest.TestCase):
action = self.find_action(pass_type + " Dispatch")
self.controller.SetFrameEvent(action.nextAction.eventId, False)
self.set_event(action.nextAction.eventId, False)
# find the cpuMax and gpuMax actions
cpuMax = self.find_action(pass_type + " cpuMax")
@@ -110,7 +110,7 @@ class D3D12_AMD_Shader_Extensions(rdtest.TestCase):
rdtest.log.success("compute shader disassembly is as expected")
if refl.debugInfo.debuggable:
self.controller.SetFrameEvent(self.find_action("Dispatch").eventId, False)
self.set_event(self.find_action("Dispatch").eventId, False)
trace = self.controller.DebugThread((0, 0, 0), (0, 0, 0))
@@ -19,7 +19,7 @@ class D3D12_Blend_Pixel_History(rdtest.TestCase):
assert test_marker is not None
self.controller.SetFrameEvent(test_marker.eventId, True)
self.set_event(test_marker.eventId, True)
pipe = self.controller.GetPipelineState()
+3 -3
View File
@@ -12,7 +12,7 @@ class D3D12_CBuffer_Zoo(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.nextAction.eventId, False)
self.set_event(action.nextAction.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -38,7 +38,7 @@ class D3D12_CBuffer_Zoo(rdtest.TestCase):
return
rdtest.log.begin_section("SM6.0 Draw")
self.controller.SetFrameEvent(action.nextAction.eventId, False)
self.set_event(action.nextAction.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -59,7 +59,7 @@ class D3D12_CBuffer_Zoo(rdtest.TestCase):
return
rdtest.log.begin_section("SM6.6 Draw")
self.controller.SetFrameEvent(action.nextAction.eventId, False)
self.set_event(action.nextAction.eventId, False)
pipe = self.controller.GetPipelineState()
+2 -2
View File
@@ -12,7 +12,7 @@ class D3D12_Compute_Only(rdtest.TestCase):
self.check_pixel_value(tex, 0, 0, [0.25, 0.5, 0.75, 1.0])
self.controller.SetFrameEvent(self.find_action("Pre-Dispatch").eventId, True)
self.set_event(self.find_action("Pre-Dispatch").eventId, True)
uints = struct.unpack_from('=4L', self.controller.GetBufferData(bufin, 0, 0), 0)
@@ -26,7 +26,7 @@ class D3D12_Compute_Only(rdtest.TestCase):
raise rdtest.TestFailureException(
f'bufout data is incorrect before dispatch: {uints}')
self.controller.SetFrameEvent(self.find_action("Post-Dispatch").eventId, True)
self.set_event(self.find_action("Post-Dispatch").eventId, True)
uints = struct.unpack_from('=4L', self.controller.GetBufferData(bufout, 0, 0), 0)
@@ -10,7 +10,7 @@ class D3D12_Descriptor_Indexing(rdtest.TestCase):
def check_compute(self, eventId: int):
action = self.find_action("Dispatch", eventId)
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
d3d12pipe = self.controller.GetD3D12PipelineState()
@@ -44,7 +44,7 @@ class D3D12_Descriptor_Indexing(rdtest.TestCase):
action = self.find_action("Draw", base.eventId)
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
d3d12pipe = self.controller.GetD3D12PipelineState()
@@ -164,7 +164,7 @@ class D3D12_Descriptor_Indexing(rdtest.TestCase):
action = self.find_action("Draw", base.eventId)
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
+2 -2
View File
@@ -16,7 +16,7 @@ class D3D12_Discard_Zoo(rdtest.Discard_Zoo):
assert action is not None
self.controller.SetFrameEvent(action.eventId, True)
self.set_event(action.eventId, True)
# Check the buffer
for res in self.controller.GetResources():
@@ -29,7 +29,7 @@ class D3D12_Discard_Zoo(rdtest.Discard_Zoo):
assert action is not None
self.controller.SetFrameEvent(action.eventId, True)
self.set_event(action.eventId, True)
# Check the buffer
for res in self.controller.GetResources():
+12 -12
View File
@@ -74,10 +74,10 @@ class D3D12_Execute_Indirect(rdtest.TestCase):
with rdtest.log.auto_section('EI without Root Signature'):
action = self.find_action("EI without Root Signature");
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
action = self.find_action("IndirectDraw", action.eventId)
for drawNum in range(3):
self.controller.SetFrameEvent(action.eventId + drawNum, False)
self.set_event(action.eventId + drawNum, False)
pipe = self.controller.GetPipelineState()
if len(pipe.GetOutputTargets()) != 1:
raise rdtest.TestFailureException(
@@ -89,7 +89,7 @@ class D3D12_Execute_Indirect(rdtest.TestCase):
with rdtest.log.auto_section('Multiple draws'):
from_eid = self.find_action("Multiple draws").eventId
ei_eid = self.find_action("ExecuteIndirect", from_eid).eventId
self.controller.SetFrameEvent(ei_eid - 1, False)
self.set_event(ei_eid - 1, False)
self.check_root_consts([10.0, 9.0, 8.0, 7.0])
viewX = 0
viewY = 0
@@ -100,7 +100,7 @@ class D3D12_Execute_Indirect(rdtest.TestCase):
action = self.find_action("IndirectDraw", from_eid)
assert action is not None
eid = action.eventId
self.controller.SetFrameEvent(eid, False)
self.set_event(eid, False)
self.check_root_consts([123.0, 9.0, 8.0, 7.0])
# Should be a green triangle in the centre of the screen on a black background
@@ -176,7 +176,7 @@ class D3D12_Execute_Indirect(rdtest.TestCase):
viewX = 0
viewY = 0
action = self.find_action("Post draw")
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
# triangle should still be visible
self.check_triangle(back=[0.0, 0.0, 0.0, 1.0], vp=[viewX, viewY, viewW, viewH])
@@ -196,7 +196,7 @@ class D3D12_Execute_Indirect(rdtest.TestCase):
with rdtest.log.auto_section('Dispatch buffer output is correct'):
action = self.find_action("Post Single dispatch")
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
rw = pipe.GetReadWriteResources(rd.ShaderStage.Compute)
@@ -243,7 +243,7 @@ class D3D12_Execute_Indirect(rdtest.TestCase):
# do N passes since it will be unpredictable
for passNum in range(50):
for drawNum in range(8):
self.controller.SetFrameEvent(action.eventId + drawNum, False)
self.set_event(action.eventId + drawNum, False)
pipe = self.controller.GetPipelineState()
out = pipe.GetOutputTargets()[0].resource
@@ -286,7 +286,7 @@ class D3D12_Execute_Indirect(rdtest.TestCase):
action = self.find_action("Full Arg Buffer")
action = self.find_action("IndirectDraw", action.eventId)
for drawNum in range(3):
self.controller.SetFrameEvent(action.eventId + drawNum, False)
self.set_event(action.eventId + drawNum, False)
pipe = self.controller.GetPipelineState()
if len(pipe.GetOutputTargets()) != 1:
raise rdtest.TestFailureException(
@@ -300,7 +300,7 @@ class D3D12_Execute_Indirect(rdtest.TestCase):
action = self.find_action("IndirectDraw", action.eventId)
for drawNum in range(3):
eid = action.eventId
self.controller.SetFrameEvent(eid, False)
self.set_event(eid, False)
pipe = self.controller.GetPipelineState()
if len(pipe.GetOutputTargets()) != 1:
raise rdtest.TestFailureException(
@@ -335,7 +335,7 @@ class D3D12_Execute_Indirect(rdtest.TestCase):
action = self.find_action("IndirectDraw", executeAction.eventId)
for drawNum in range(min(countDraws, 12)):
eid = action.eventId
self.controller.SetFrameEvent(eid, False)
self.set_event(eid, False)
pipe = self.controller.GetPipelineState()
if len(pipe.GetOutputTargets()) != 1:
raise rdtest.TestFailureException(
@@ -369,7 +369,7 @@ class D3D12_Execute_Indirect(rdtest.TestCase):
action = self.find_action("IndirectDraw", action.eventId+1)
eid = action.eventId
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
if len(pipe.GetOutputTargets()) != 1:
raise rdtest.TestFailureException(
@@ -400,7 +400,7 @@ class D3D12_Execute_Indirect(rdtest.TestCase):
for eid in range(self.get_first_action().eventId, self.get_last_action().eventId + 1):
if eid >= skipEIDmin and eid <= skipEIDmax:
continue
self.controller.SetFrameEvent(eid, False)
self.set_event(eid, False)
pipe = self.controller.GetPipelineState()
if len(pipe.GetOutputTargets()) == 0:
continue
+2 -2
View File
@@ -8,7 +8,7 @@ class D3D12_Existing_Heap(rdtest.TestCase):
def check_capture(self):
last_action = self.get_last_action()
self.controller.SetFrameEvent(last_action.eventId, True)
self.set_event(last_action.eventId, True)
self.check_triangle(out=last_action.copyDestination)
@@ -16,7 +16,7 @@ class D3D12_Existing_Heap(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices)
+2 -2
View File
@@ -21,7 +21,7 @@ class D3D12_Frame0(rdtest.TestCase):
last_action = self.get_last_action()
self.controller.SetFrameEvent(last_action.eventId, True)
self.set_event(last_action.eventId, True)
self.check_triangle(out=last_action.copyDestination)
@@ -31,7 +31,7 @@ class D3D12_Frame0(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices)
+1 -1
View File
@@ -10,7 +10,7 @@ class D3D12_Large_Buffer(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
vsin_ref: rdtest.MeshReference = {
0: {
@@ -12,7 +12,7 @@ class D3D12_List_Alloc_Tests(rdtest.TestCase):
action = action.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
+1 -1
View File
@@ -10,7 +10,7 @@ class D3D12_List_Types(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
self.check_triangle(out=action.outputs[0], fore=[0.0, 1.0, 1.0, 1.0])
@@ -7,6 +7,6 @@ class D3D12_Map_PlacedAlias(rdtest.TestCase):
def check_capture(self):
action = self.find_action("Draw")
self.controller.SetFrameEvent(action.eventId, True)
self.set_event(action.eventId, True)
self.check_triangle()
@@ -7,6 +7,6 @@ class D3D12_Memory_Overlap(rdtest.TestCase):
def check_capture(self):
last_action = self.get_last_action()
self.controller.SetFrameEvent(last_action.eventId, True)
self.set_event(last_action.eventId, True)
self.check_triangle(out=last_action.copyDestination)
+4 -4
View File
@@ -59,7 +59,7 @@ class D3D12_Mesh_Shader(rdtest.TestCase):
def check_capture(self):
last_action = self.get_last_action()
self.controller.SetFrameEvent(last_action.eventId, True)
self.set_event(last_action.eventId, True)
action = self.find_action("Mesh Shaders")
@@ -67,7 +67,7 @@ class D3D12_Mesh_Shader(rdtest.TestCase):
assert action is not None
name = f"Pure Mesh Shader Test EID:{action.eventId}"
rdtest.log.begin_section(name)
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
x = 70
y = 70
@@ -85,7 +85,7 @@ class D3D12_Mesh_Shader(rdtest.TestCase):
assert action is not None
name = f"Amplification Shader with Global Payload EID:{action.eventId}"
rdtest.log.begin_section(name)
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
postts_ref = self.build_global_taskout_reference()
postts_data = self.get_task_data(action)
@@ -104,7 +104,7 @@ class D3D12_Mesh_Shader(rdtest.TestCase):
assert action is not None
name = f"Amplification Shader with Local Payload EID:{action.eventId}"
rdtest.log.begin_section(name)
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
postts_ref = self.build_local_taskout_reference()
postts_data = self.get_task_data(action)
+1 -1
View File
@@ -10,4 +10,4 @@ class D3D12_Mesh_Zoo(rdtest.TestCase):
def check_capture(self):
assert self.controller is not None
self.zoo_helper.check_capture(self.capture_filename, self.controller)
self.zoo_helper.check_capture(self.capture_filename, self)
@@ -14,7 +14,7 @@ class D3D12_Multi_Wait_Before_Signal(rdtest.TestCase):
assert draw_marker is not None
self.controller.SetFrameEvent(draw_marker.eventId, False)
self.set_event(draw_marker.eventId, False)
pipe = self.controller.GetPipelineState()
+1 -1
View File
@@ -25,7 +25,7 @@ class D3D12_Overlay_Test(rdtest.Overlay_Test):
# Don't check any pixel values, but ensure all overlays at least work with no viewport/scissor bound
sub_marker = self.find_action("NoView draw", base_event)
self.controller.SetFrameEvent(sub_marker.nextAction.eventId, True)
self.set_event(sub_marker.nextAction.eventId, True)
pipe = self.controller.GetPipelineState()
+4 -4
View File
@@ -12,7 +12,7 @@ class D3D12_Parameter_Zoo(rdtest.TestCase):
action = action.nextAction
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -100,7 +100,7 @@ class D3D12_Parameter_Zoo(rdtest.TestCase):
action = self.find_action("No Sig Draw")
action = action.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -111,14 +111,14 @@ class D3D12_Parameter_Zoo(rdtest.TestCase):
action = self.find_action("No Sig Dispatch")
action = action.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
# nothing to actually check here
action = self.find_action("Temp heap Draw")
action = action.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
+6 -6
View File
@@ -16,7 +16,7 @@ class D3D12_Predication(rdtest.TestCase):
viewport_array: Callable[[rd.Viewport], Tuple[float,float,float,float]] = lambda view: (view.x, view.y, view.width, view.height)
self.controller.SetFrameEvent(a.eventId, False)
self.set_event(a.eventId, False)
pipe = self.controller.GetPipelineState()
self.check_triangle(vp=viewport_array(pipe.GetViewport(0)))
@@ -24,7 +24,7 @@ class D3D12_Predication(rdtest.TestCase):
assert self.controller.GetD3D12PipelineState().predication.resourceId == rd.ResourceId()
self.controller.SetFrameEvent(b.eventId, False)
self.set_event(b.eventId, False)
pipe = self.controller.GetPipelineState()
self.check_triangle(vp=viewport_array(pipe.GetViewport(0)))
@@ -33,7 +33,7 @@ class D3D12_Predication(rdtest.TestCase):
rdtest.log.success("Fixed data predicated triangle is correct")
self.controller.SetFrameEvent(c.eventId, False)
self.set_event(c.eventId, False)
pipe = self.controller.GetPipelineState()
self.check_triangle(vp=viewport_array(pipe.GetViewport(0)))
@@ -42,13 +42,13 @@ class D3D12_Predication(rdtest.TestCase):
rdtest.log.success("Current frame query-predicated triangle is correct")
self.controller.SetFrameEvent(d.eventId, False)
self.set_event(d.eventId, False)
pipe = self.controller.GetPipelineState()
self.check_triangle(vp=viewport_array(pipe.GetViewport(0)))
rdtest.log.success("Previous frame query-predicated triangle is correct")
self.controller.SetFrameEvent(e.eventId, False)
self.set_event(e.eventId, False)
pipe = self.controller.GetPipelineState()
self.check_pixel_value(pipe.GetOutputTargets()[0].resource, 200, 150, [0.2, 0.2, 0.2, 1.0])
@@ -58,7 +58,7 @@ class D3D12_Predication(rdtest.TestCase):
rdtest.log.success("Failing predicated triangle is correct")
for eid in range(self.get_last_action().eventId):
self.controller.SetFrameEvent(eid, False)
self.set_event(eid, False)
if not self.controller.GetFatalErrorStatus().OK():
raise rdtest.TestFailureException(self.controller.GetFatalErrorStatus().Message())
+1 -1
View File
@@ -15,7 +15,7 @@ class D3D12_PrimitiveID(rdtest.TestCase):
expected_prim: rdtest.VectorValue,
expected_output: rdtest.VectorValue | None,
):
self.controller.SetFrameEvent(action.eventId, True)
self.set_event(action.eventId, True)
pipe = self.controller.GetPipelineState()
if not pipe.GetShaderReflection(rd.ShaderStage.Pixel).debugInfo.debuggable:
@@ -13,7 +13,7 @@ class D3D12_Reflection_Zoo(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.nextAction.eventId, False)
self.set_event(action.nextAction.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -37,7 +37,7 @@ class D3D12_Reflection_Zoo(rdtest.TestCase):
rdtest.log.print("No SM6.0 DXIL action to test")
return
self.controller.SetFrameEvent(action.nextAction.eventId, False)
self.set_event(action.nextAction.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -58,7 +58,7 @@ class D3D12_Reflection_Zoo(rdtest.TestCase):
rdtest.log.print("No SM6.7 DXIL action to test")
return
self.controller.SetFrameEvent(action.nextAction.eventId, False)
self.set_event(action.nextAction.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -8,7 +8,7 @@ class D3D12_RenderTarget_Binds(rdtest.TestCase):
# find the clear
action = self.find_action("ClearRenderTargetView")
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -20,7 +20,7 @@ class D3D12_RenderTarget_Binds(rdtest.TestCase):
action = action.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -36,7 +36,7 @@ class D3D12_RenderTarget_Binds(rdtest.TestCase):
action = action.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -52,7 +52,7 @@ class D3D12_RenderTarget_Binds(rdtest.TestCase):
action = action.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -68,7 +68,7 @@ class D3D12_RenderTarget_Binds(rdtest.TestCase):
action = action.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
+3 -3
View File
@@ -11,19 +11,19 @@ class D3D12_Render_Pass(rdtest.TestCase):
action = next(d for d in rp1.children if d.flags & rd.ActionFlags.Drawcall)
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
self.check_triangle(back=[0.0, 0.0, 1.0, 1.0])
action = next(d for d in rp2.children if d.flags & rd.ActionFlags.Drawcall)
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
self.check_triangle(back=[1.0, 0.0, 1.0, 1.0])
action = self.get_last_action()
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
self.check_pixel_value(action.copyDestination, 0.45, 0.45, [0.0, 0.0, 1.0, 1.0])
self.check_pixel_value(action.copyDestination, 0.55, 0.55, [1.0, 0.0, 1.0, 1.0])
@@ -8,7 +8,7 @@ class D3D12_Resource_Lifetimes(rdtest.TestCase):
def check_capture(self):
last_action = self.get_last_action()
self.controller.SetFrameEvent(last_action.eventId, True)
self.set_event(last_action.eventId, True)
tex = last_action.copyDestination
@@ -49,18 +49,18 @@ class D3D12_Resource_Mapping_Zoo(rdtest.TestCase):
rdtest.log.begin_section("SM5.x tests")
test_marker = self.find_action("sm_5_0")
action = test_marker.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
failed = not self.test_debug_pixel(200, 200, "sm_5_0") or failed
test_marker = self.find_action("sm_5_1")
action = test_marker.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
failed = not self.test_debug_pixel(200, 200, "sm_5_1") or failed
rdtest.log.begin_section("Resource array tests")
test_marker = self.find_action("ResArray")
action = test_marker.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
for y in range(4):
for x in range(4):
@@ -71,7 +71,7 @@ class D3D12_Resource_Mapping_Zoo(rdtest.TestCase):
rdtest.log.begin_section("Bindless tests")
test_marker = self.find_action("Bindless")
action = test_marker.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
for y in range(4):
for x in range(4):
@@ -88,18 +88,18 @@ class D3D12_Resource_Mapping_Zoo(rdtest.TestCase):
rdtest.log.begin_section("SM6.0 tests")
action = test_marker.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
failed = not self.test_debug_pixel(200, 200, "SM6.0") or failed
test_marker = self.find_action("SM6.0 Table")
action = test_marker.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
failed = not self.test_debug_pixel(200, 200, "SM6.0 Table") or failed
rdtest.log.begin_section("Resource array tests")
test_marker = self.find_action("SM6.0 ResArray")
action = test_marker.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
for y in range(4):
for x in range(4):
@@ -110,7 +110,7 @@ class D3D12_Resource_Mapping_Zoo(rdtest.TestCase):
rdtest.log.begin_section("Bindless tests")
test_marker = self.find_action("SM6.0 Bindless")
action = test_marker.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
for y in range(4):
for x in range(4):
@@ -127,18 +127,18 @@ class D3D12_Resource_Mapping_Zoo(rdtest.TestCase):
rdtest.log.begin_section("SM6.6 tests")
action = test_marker.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
failed = not self.test_debug_pixel(200, 200, "SM6.6") or failed
test_marker = self.find_action("SM6.6 Table")
action = test_marker.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
failed = not self.test_debug_pixel(200, 200, "SM6.6 Table") or failed
rdtest.log.begin_section("Resource array tests")
test_marker = self.find_action("SM6.6 ResArray")
action = test_marker.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
for y in range(4):
for x in range(4):
@@ -149,7 +149,7 @@ class D3D12_Resource_Mapping_Zoo(rdtest.TestCase):
rdtest.log.begin_section("Bindless tests")
test_marker = self.find_action("SM6.6 Bindless")
action = test_marker.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
for y in range(4):
for x in range(4):
@@ -93,7 +93,7 @@ class D3D12_Shader_DebugData_Zoo(rdtest.TestCase):
rdtest.log.end_section(shaderModels[sm] + " tests")
continue
action = test_marker.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -250,7 +250,7 @@ class D3D12_Shader_DebugData_Zoo(rdtest.TestCase):
rdtest.log.end_section(section)
continue
action = test_marker.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
if not pipe.GetShaderReflection(rd.ShaderStage.Compute).debugInfo.debuggable:
rdtest.log.print(f"Skipping undebuggable Compute shader at {action.eventId} for {csShaderModels[sm]}.")
@@ -28,7 +28,7 @@ class D3D12_Shader_Debug_Zoo(rdtest.TestCase):
a for a in comp_dim.children if a.flags & rd.ActionFlags.Dispatch]
for test, action in enumerate(compute_tests):
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
csrefl = pipe.GetShaderReflection(rd.ShaderStage.Compute)
if not csrefl.debugInfo.debuggable:
@@ -134,7 +134,7 @@ class D3D12_Shader_Debug_Zoo(rdtest.TestCase):
continue
action = test_marker.nextAction
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -196,7 +196,7 @@ class D3D12_Shader_Debug_Zoo(rdtest.TestCase):
rdtest.log.begin_section(marker)
test_marker = self.find_action(marker)
action = test_marker.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
for (x,y) in [(4, 4), (4, 5), (3, 4), (3, 5)]:
for test in range(4):
@@ -240,7 +240,7 @@ class D3D12_Shader_Debug_Zoo(rdtest.TestCase):
continue
action = test_marker.nextAction
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
if pipe.GetShaderReflection(rd.ShaderStage.Vertex).debugInfo.debuggable:
@@ -283,7 +283,7 @@ class D3D12_Shader_Debug_Zoo(rdtest.TestCase):
test_marker = self.find_action("Banned")
action = test_marker.nextAction
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
# Debug the banned vertex shader
@@ -324,7 +324,7 @@ class D3D12_Shader_Debug_Zoo(rdtest.TestCase):
rdtest.log.end_section(section)
continue
action = test_marker.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
if not pipe.GetShaderReflection(rd.ShaderStage.Compute).debugInfo.debuggable:
rdtest.log.print(f"Skipping undebuggable Compute shader at {action.eventId} for {csShaderModels[sm]}.")
@@ -7,14 +7,14 @@ class D3D12_Shader_Editing(rdtest.TestCase):
def check_capture(self):
eid = self.find_action("Draw 1").nextAction.eventId
self.controller.SetFrameEvent(eid, False)
self.set_event(eid, False)
pipe = self.controller.GetPipelineState()
psrefl1 = pipe.GetShaderReflection(rd.ShaderStage.Pixel)
eid = self.find_action("Draw 2").nextAction.eventId
self.controller.SetFrameEvent(eid, False)
self.set_event(eid, False)
pipe = self.controller.GetPipelineState()
@@ -95,7 +95,7 @@ class D3D12_Shader_Editing(rdtest.TestCase):
self.controller.ReplaceResource(psrefl2.resourceId, ps2)
# Refresh the replay if it didn't happen already
self.controller.SetFrameEvent(eid, True)
self.set_event(eid, True)
# Triangles have green and blue channel
self.check_pixel_value(tex, 0.25, 0.5, [0.0, 1.0, 1.0, 1.0])
@@ -105,7 +105,7 @@ class D3D12_Shader_Editing(rdtest.TestCase):
# Now "edit" the VS but don't change it. We should still get the same values
self.controller.ReplaceResource(vsrefl.resourceId, nochangeVS)
self.controller.SetFrameEvent(eid, True)
self.set_event(eid, True)
# Triangles have green and blue channel
self.check_pixel_value(tex, 0.25, 0.5, [0.0, 1.0, 1.0, 1.0])
@@ -115,7 +115,7 @@ class D3D12_Shader_Editing(rdtest.TestCase):
# Change the VS to one that has ofpset the triangles off-centre
self.controller.ReplaceResource(vsrefl.resourceId, offsetVS)
self.controller.SetFrameEvent(eid, True)
self.set_event(eid, True)
# Original sample positions are now the clear color
self.check_pixel_value(tex, 0.25, 0.5, [0.2, 0.2, 0.2, 1.0])
@@ -129,7 +129,7 @@ class D3D12_Shader_Editing(rdtest.TestCase):
# Now undo the first ps edit
self.controller.RemoveReplacement(psrefl1.resourceId)
self.controller.SetFrameEvent(eid, True)
self.set_event(eid, True)
# Original sample positions are still the clear color
self.check_pixel_value(tex, 0.25, 0.5, [0.2, 0.2, 0.2, 1.0])
@@ -143,7 +143,7 @@ class D3D12_Shader_Editing(rdtest.TestCase):
# Now undo the first VS edit
self.controller.RemoveReplacement(vsrefl.resourceId)
self.controller.SetFrameEvent(eid, True)
self.set_event(eid, True)
# The right triangle is the edited colour, but they are back in the original positions
self.check_pixel_value(tex, 0.25, 0.5, [0.0, 1.0, 0.0, 1.0])
@@ -153,7 +153,7 @@ class D3D12_Shader_Editing(rdtest.TestCase):
# finally undo the second ps edit
self.controller.RemoveReplacement(psrefl2.resourceId)
self.controller.SetFrameEvent(eid, True)
self.set_event(eid, True)
# We should be back to where we started
self.check_pixel_value(tex, 0.25, 0.5, [0.0, 1.0, 0.0, 1.0])
+1 -1
View File
@@ -12,7 +12,7 @@ class D3D12_Shader_ISA(rdtest.TestCase):
is_amd = 'AMD' in action.customName
self.controller.SetFrameEvent(action.nextAction.eventId, False)
self.set_event(action.nextAction.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -18,7 +18,7 @@ class D3D12_Shader_Linkage_Zoo(rdtest.TestCase):
event_name = test_marker.customName
test_marker = self.find_action("draw", action.eventId)
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
if not pipe.GetShaderReflection(rd.ShaderStage.Pixel).debugInfo.debuggable:
+1 -1
View File
@@ -11,7 +11,7 @@ class D3D12_Sharing(rdtest.TestCase):
action = action.nextAction
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -8,7 +8,7 @@ class D3D12_Simple_Triangle(rdtest.TestCase):
def check_capture(self):
last_action = self.get_last_action()
self.controller.SetFrameEvent(last_action.eventId, True)
self.set_event(last_action.eventId, True)
self.check_triangle(out=last_action.copyDestination)
@@ -18,7 +18,7 @@ class D3D12_Simple_Triangle(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices)
+2 -2
View File
@@ -8,13 +8,13 @@ class D3D12_Swapchain_Zoo(rdtest.TestCase):
action1 = self.find_action("Draw 1")
action2 = self.find_action("Draw 2")
self.controller.SetFrameEvent(action1.nextAction.eventId, False)
self.set_event(action1.nextAction.eventId, False)
self.check_triangle(back=[0.0, 0.0, 0.0, 1.0])
rdtest.log.success("Triangle in first action (on first window) is OK")
self.controller.SetFrameEvent(action2.nextAction.eventId, False)
self.set_event(action2.nextAction.eventId, False)
self.check_triangle(back=[0.0, 0.0, 0.0, 1.0])
+1 -1
View File
@@ -13,5 +13,5 @@ class D3D12_Texture_Zoo(rdtest.TestCase):
assert self.controller is not None
# This takes ownership of the controller and shuts it down when it's finished
self.zoo_helper.worker_thread = self.worker_thread
self.zoo_helper.check_capture(self.capture_filename, self.controller)
self.zoo_helper.check_capture(self.capture_filename, self)
self.controller = None
@@ -8,7 +8,7 @@ class D3D12_Untyped_Backbuffer_Descriptor(rdtest.TestCase):
# find the first action
action = self.find_action("Draw")
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -19,7 +19,7 @@ class D3D12_Untyped_Backbuffer_Descriptor(rdtest.TestCase):
# find the second action
action = self.find_action("Draw", action.eventId+1)
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
+7 -7
View File
@@ -49,7 +49,7 @@ class D3D12_VRS(rdtest.TestCase):
action = self.find_action("Default", pass_action.eventId)
assert action is not None
self.controller.SetFrameEvent(action.nextAction.eventId, False)
self.set_event(action.nextAction.eventId, False)
num_checks = 0
@@ -57,39 +57,39 @@ class D3D12_VRS(rdtest.TestCase):
num_checks += 1
action = self.find_action("Base", pass_action.eventId)
self.controller.SetFrameEvent(action.nextAction.eventId, False)
self.set_event(action.nextAction.eventId, False)
assert self.get_shading_rates() == ("2x2", "2x2"), f"{action.customName} shading rates unexpected: {self.get_shading_rates()}"
num_checks += 1
action = self.find_action("Vertex", pass_action.eventId)
if action is not None:
self.controller.SetFrameEvent(action.nextAction.eventId, False)
self.set_event(action.nextAction.eventId, False)
assert self.get_shading_rates() == ("1x1", "2x2"), f"{action.customName} shading rates unexpected: {self.get_shading_rates()}"
num_checks += 1
rdtest.log.success("Shading rates were as expected in per-vertex case")
action = self.find_action("Image", pass_action.eventId)
if action is not None:
self.controller.SetFrameEvent(action.nextAction.eventId, False)
self.set_event(action.nextAction.eventId, False)
assert self.get_shading_rates() == ("2x2", "1x1"), f"{action.customName} shading rates unexpected: {self.get_shading_rates()}"
num_checks += 1
rdtest.log.success("Shading rates were as expected in image-based case")
action = self.find_action("Base + Vertex", pass_action.eventId)
if action is not None:
self.controller.SetFrameEvent(action.nextAction.eventId, False)
self.set_event(action.nextAction.eventId, False)
assert self.get_shading_rates() == ("2x2", "2x2"), f"{action.customName} shading rates unexpected: {self.get_shading_rates()}"
num_checks += 1
action = self.find_action("Base + Image", pass_action.eventId)
if action is not None:
self.controller.SetFrameEvent(action.nextAction.eventId, False)
self.set_event(action.nextAction.eventId, False)
assert self.get_shading_rates() == ("2x2", "2x2"), f"{action.customName} shading rates unexpected: {self.get_shading_rates()}"
num_checks += 1
action = self.find_action("Vertex + Image", pass_action.eventId)
if action is not None:
self.controller.SetFrameEvent(action.nextAction.eventId, False)
self.set_event(action.nextAction.eventId, False)
assert self.get_shading_rates() == ("2x2", "2x2"), f"{action.customName} shading rates unexpected: {self.get_shading_rates()}"
num_checks += 1
@@ -11,7 +11,7 @@ class D3D12_Vertex_Attr_Zoo(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
ref: rdtest.MeshReference = {
0: {
+1 -1
View File
@@ -22,7 +22,7 @@ class D3D12_Vertex_UAV(rdtest.TestCase):
rdtest.log.print(f"Checking quad overdraw on {name}")
self.controller.SetFrameEvent(marker.nextAction.eventId, True)
self.set_event(marker.nextAction.eventId, True)
pipe = self.controller.GetPipelineState()
@@ -7,7 +7,7 @@ class D3D12_Write_Subresource(rdtest.TestCase):
def check_capture(self):
action = self.find_action("Draw")
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
+1 -1
View File
@@ -44,7 +44,7 @@ class GL_Buffer_Resizing(rdtest.TestCase):
if action is None:
break
self.controller.SetFrameEvent(action.eventId, True)
self.set_event(action.eventId, True)
self.check_triangle(out=action.outputs[0])
+1 -1
View File
@@ -10,7 +10,7 @@ class GL_Buffer_Spam(rdtest.TestCase):
action = self.find_action("Draw")
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
# Check that we get green in the centre of the screen, indicating that the
# triangle's buffer serialised with the right data and rendered
+1 -1
View File
@@ -11,7 +11,7 @@ class GL_Buffer_Updates(rdtest.TestCase):
# At each action, the centre pixel of the viewport should be green
action = self.get_first_action()
while action is not None:
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
if action.flags & rd.ActionFlags.Drawcall:
pipe = self.controller.GetPipelineState()
+1 -1
View File
@@ -12,7 +12,7 @@ class GL_CBuffer_Zoo(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
+1 -1
View File
@@ -8,7 +8,7 @@ class GL_DX_Interop(rdtest.TestCase):
def check_capture(self):
last_action = self.get_last_action()
self.controller.SetFrameEvent(last_action.eventId, True)
self.set_event(last_action.eventId, True)
out = last_action.copyDestination
+1 -1
View File
@@ -6,7 +6,7 @@ class GL_Depth_Bounds(rdtest.TestCase):
def check_capture(self):
eid = self.find_action("Test").nextAction.eventId
self.controller.SetFrameEvent(eid, False)
self.set_event(eid, False)
glpipe = self.controller.GetGLPipelineState()
+2 -2
View File
@@ -16,7 +16,7 @@ class GL_Discard_Zoo(rdtest.Discard_Zoo):
assert action is not None
self.controller.SetFrameEvent(action.eventId, True)
self.set_event(action.eventId, True)
# Check the buffer
for res in self.controller.GetResources():
@@ -29,7 +29,7 @@ class GL_Discard_Zoo(rdtest.Discard_Zoo):
assert action is not None
self.controller.SetFrameEvent(action.eventId, True)
self.set_event(action.eventId, True)
# Check the buffer
for res in self.controller.GetResources():
+2 -2
View File
@@ -15,7 +15,7 @@ class GL_Draw_Zoo(rdtest.Draw_Zoo):
action = action.nextAction
self.controller.SetFrameEvent(action.eventId, True)
self.set_event(action.eventId, True)
pipe = self.controller.GetPipelineState()
@@ -31,7 +31,7 @@ class GL_Draw_Zoo(rdtest.Draw_Zoo):
action = action.nextAction
self.controller.SetFrameEvent(action.eventId, True)
self.set_event(action.eventId, True)
pipe = self.controller.GetPipelineState()
+2 -2
View File
@@ -21,7 +21,7 @@ class GL_Frame0(rdtest.TestCase):
last_action = self.get_last_action()
self.controller.SetFrameEvent(last_action.eventId, True)
self.set_event(last_action.eventId, True)
self.check_triangle(out=last_action.copyDestination)
@@ -31,7 +31,7 @@ class GL_Frame0(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices)
+1 -1
View File
@@ -10,7 +10,7 @@ class GL_Large_Buffer(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
vsin_ref: rdtest.MeshReference = {
0: {
+4 -4
View File
@@ -11,12 +11,12 @@ class GL_Mesh_Zoo(rdtest.TestCase):
def check_capture(self):
assert self.controller is not None
self.zoo_helper.check_capture(self.capture_filename, self.controller)
self.zoo_helper.check_capture(self.capture_filename, self)
# Test GL-only thing with geometry shader only and completely no-op vertex shader
action = self.zoo_helper.find_action("Geom Only").nextAction
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pos = self.controller.GetPostVSData(0, 0, rd.MeshDataStage.VSOut)
@@ -44,13 +44,13 @@ class GL_Mesh_Zoo(rdtest.TestCase):
# Test GL-only thing with geometry shader only and completely no-op vertex shader
multibase = self.zoo_helper.find_action("Multi Draw").nextAction.parent
self.controller.SetFrameEvent(multibase.children[-1].eventId, False)
self.set_event(multibase.children[-1].eventId, False)
baseVertex = [10, 11]
baseInstance = [20, 22]
for d, action in enumerate(multibase.children):
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
@@ -7,7 +7,7 @@ class GL_Multithread_Rendering(rdtest.TestCase):
def check_capture(self):
action = self.get_last_action()
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
+3 -3
View File
@@ -13,7 +13,7 @@ class GL_Parameter_Zoo(rdtest.TestCase):
tex_details = self.get_texture(id)
self.controller.SetFrameEvent(self.get_last_action().eventId, True)
self.set_event(self.get_last_action().eventId, True)
data = self.controller.GetTextureData(id, rd.Subresource(0, 0, 0))
first_pixel = struct.unpack_from("BBBB", data, 0)
@@ -33,7 +33,7 @@ class GL_Parameter_Zoo(rdtest.TestCase):
img_path = rdtest.get_tmp_path('preserved_alpha.png')
self.controller.SetFrameEvent(self.get_last_action().eventId, True)
self.set_event(self.get_last_action().eventId, True)
save_data = rd.TextureSave()
save_data.resourceId = id
@@ -54,7 +54,7 @@ class GL_Parameter_Zoo(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices)
+1 -1
View File
@@ -9,7 +9,7 @@ class GL_Per_Type_Tex_Units(rdtest.TestCase):
def check_capture(self):
action = self.find_action("Draw")
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
+2 -2
View File
@@ -8,14 +8,14 @@ class GL_Queries_In_Use(rdtest.TestCase):
def check_capture(self):
last_action = self.get_last_action()
self.controller.SetFrameEvent(last_action.eventId, True)
self.set_event(last_action.eventId, True)
tex_details = self.get_texture(last_action.copyDestination)
action = self.find_action("XFB Draw").nextAction
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices)
+1 -1
View File
@@ -11,7 +11,7 @@ class GL_Renderbuffer_Zoo(rdtest.TestCase):
action = self.find_action('glDraw')
while action is not None:
self.controller.SetFrameEvent(action.eventId, True)
self.set_event(action.eventId, True)
self.check_triangle(fore=[0.2, 0.75, 0.2, 1.0])
+3 -3
View File
@@ -9,7 +9,7 @@ class GL_Resource_Lifetimes(rdtest.TestCase):
def check_capture(self):
action = self.find_action("glDraw")
self.controller.SetFrameEvent(action.eventId, True)
self.set_event(action.eventId, True)
pipe = self.controller.GetPipelineState()
@@ -23,7 +23,7 @@ class GL_Resource_Lifetimes(rdtest.TestCase):
action = self.find_action("glDraw", action.eventId+1)
self.controller.SetFrameEvent(action.eventId, True)
self.set_event(action.eventId, True)
pipe = self.controller.GetPipelineState()
@@ -38,7 +38,7 @@ class GL_Resource_Lifetimes(rdtest.TestCase):
last_action = self.get_last_action()
self.controller.SetFrameEvent(last_action.eventId, True)
self.set_event(last_action.eventId, True)
tex = last_action.copyDestination
@@ -8,7 +8,7 @@ class GL_Separable_Geometry_Shaders(rdtest.TestCase):
def check_capture(self):
action = self.find_action("Draw")
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
assert action is not None
+1 -1
View File
@@ -26,7 +26,7 @@ class GL_Shader_Debug_Zoo(rdtest.TestCase):
x += 4
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
if not pipe.GetShaderReflection(rd.ShaderStage.Vertex).debugInfo.debuggable:
+14 -14
View File
@@ -7,14 +7,14 @@ class GL_Shader_Editing(rdtest.TestCase):
def check_capture(self):
eid = self.find_action("fixedprog").eventId
self.controller.SetFrameEvent(eid, False)
self.set_event(eid, False)
pipe = self.controller.GetPipelineState()
fixedrefl = pipe.GetShaderReflection(rd.ShaderStage.Fragment)
eid = self.find_action("dynamicprog").eventId
self.controller.SetFrameEvent(eid, False)
self.set_event(eid, False)
pipe = self.controller.GetPipelineState()
@@ -22,13 +22,13 @@ class GL_Shader_Editing(rdtest.TestCase):
vsrefl = pipe.GetShaderReflection(rd.ShaderStage.Vertex)
eid = self.find_action("sepprog").eventId
self.controller.SetFrameEvent(eid, False)
self.set_event(eid, False)
vsseprefl = pipe.GetShaderReflection(rd.ShaderStage.Vertex)
fsseprefl = pipe.GetShaderReflection(rd.ShaderStage.Fragment)
# Work at the last action, where the uniforms have been trashed
self.controller.SetFrameEvent(self.get_last_action().eventId, False)
self.set_event(self.get_last_action().eventId, False)
tex = pipe.GetOutputTargets()[0].resource
@@ -135,7 +135,7 @@ class GL_Shader_Editing(rdtest.TestCase):
self.controller.ReplaceResource(dynamicrefl.resourceId, dynamicFS)
# Refresh the replay if it didn't happen already
self.controller.SetFrameEvent(self.get_last_action().eventId, True)
self.set_event(self.get_last_action().eventId, True)
# Triangles have green propagated across to the blue channel
self.check_pixel_value(tex, 0.25, 0.25, [0.0, 1.0, 1.0, 1.0])
@@ -146,7 +146,7 @@ class GL_Shader_Editing(rdtest.TestCase):
# Now "edit" the VS but don't change it. We should still get the same values
self.controller.ReplaceResource(vsrefl.resourceId, nochangeVS)
self.controller.SetFrameEvent(self.get_last_action().eventId, True)
self.set_event(self.get_last_action().eventId, True)
# Triangles have green propagated across to the blue channel
self.check_pixel_value(tex, 0.25, 0.25, [0.0, 1.0, 1.0, 1.0])
@@ -157,7 +157,7 @@ class GL_Shader_Editing(rdtest.TestCase):
# Change the VS to one that has offset the triangles off-centre
self.controller.ReplaceResource(vsrefl.resourceId, offsetVS)
self.controller.SetFrameEvent(self.get_last_action().eventId, True)
self.set_event(self.get_last_action().eventId, True)
# Original sample positions are now the clear color
self.check_pixel_value(tex, 0.25, 0.25, [0.2, 0.2, 0.2, 1.0])
@@ -173,7 +173,7 @@ class GL_Shader_Editing(rdtest.TestCase):
# Now undo the first FS edit
self.controller.RemoveReplacement(fixedrefl.resourceId)
self.controller.SetFrameEvent(self.get_last_action().eventId, True)
self.set_event(self.get_last_action().eventId, True)
# Original sample positions are still the clear color
self.check_pixel_value(tex, 0.25, 0.25, [0.2, 0.2, 0.2, 1.0])
@@ -189,7 +189,7 @@ class GL_Shader_Editing(rdtest.TestCase):
# Now undo the first VS edit
self.controller.RemoveReplacement(vsrefl.resourceId)
self.controller.SetFrameEvent(self.get_last_action().eventId, True)
self.set_event(self.get_last_action().eventId, True)
# Only the lower triangle is the edited colour, but they are back in the original positions
self.check_pixel_value(tex, 0.25, 0.25, [0.0, 1.0, 0.0, 1.0])
@@ -200,7 +200,7 @@ class GL_Shader_Editing(rdtest.TestCase):
# finally undo the second FS edit
self.controller.RemoveReplacement(dynamicrefl.resourceId)
self.controller.SetFrameEvent(self.get_last_action().eventId, True)
self.set_event(self.get_last_action().eventId, True)
# We should be back to where we started
self.check_pixel_value(tex, 0.25, 0.25, [0.0, 1.0, 0.0, 1.0])
@@ -217,27 +217,27 @@ class GL_Shader_Editing(rdtest.TestCase):
self.check_pixel_value(tex, 0.75, 0.75, [0.0, 1.0, 0.0, 1.0])
self.controller.ReplaceResource(fsseprefl.resourceId, sepFS)
self.controller.SetFrameEvent(self.get_last_action().eventId, True)
self.set_event(self.get_last_action().eventId, True)
# Now it should be green-blue
self.check_pixel_value(tex, 0.75, 0.75, [0.0, 1.0, 1.0, 1.0])
self.controller.ReplaceResource(vsseprefl.resourceId, sepVS)
self.controller.SetFrameEvent(self.get_last_action().eventId, True)
self.set_event(self.get_last_action().eventId, True)
# Now it should be green-blue and offset
self.check_pixel_value(tex, 0.75, 0.75, [0.2, 0.2, 0.2, 1.0])
self.check_pixel_value(tex, 0.95, 0.55, [0.0, 1.0, 1.0, 1.0])
self.controller.RemoveReplacement(fsseprefl.resourceId)
self.controller.SetFrameEvent(self.get_last_action().eventId, True)
self.set_event(self.get_last_action().eventId, True)
# Now it should be back to green and offset
self.check_pixel_value(tex, 0.75, 0.75, [0.2, 0.2, 0.2, 1.0])
self.check_pixel_value(tex, 0.95, 0.55, [0.0, 1.0, 0.0, 1.0])
self.controller.RemoveReplacement(vsseprefl.resourceId)
self.controller.SetFrameEvent(self.get_last_action().eventId, True)
self.set_event(self.get_last_action().eventId, True)
# We should be back to where we started
self.check_pixel_value(tex, 0.75, 0.75, [0.0, 1.0, 0.0, 1.0])
+1 -1
View File
@@ -12,7 +12,7 @@ class GL_Shader_ISA(rdtest.TestCase):
is_amd = 'AMD' in action.customName
self.controller.SetFrameEvent(action.nextAction.eventId, False)
self.set_event(action.nextAction.eventId, False)
pipe = self.controller.GetPipelineState()
+2 -2
View File
@@ -8,7 +8,7 @@ class GL_Simple_Triangle(rdtest.TestCase):
def check_capture(self):
last_action = self.get_last_action()
self.controller.SetFrameEvent(last_action.eventId, True)
self.set_event(last_action.eventId, True)
self.check_triangle(out=last_action.copyDestination)
@@ -18,7 +18,7 @@ class GL_Simple_Triangle(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices)
+2 -2
View File
@@ -8,7 +8,7 @@ class GL_State_Trashing(rdtest.TestCase):
def check_capture(self):
last_action = self.get_last_action()
self.controller.SetFrameEvent(last_action.eventId, True)
self.set_event(last_action.eventId, True)
self.check_triangle(out=last_action.copyDestination)
@@ -16,7 +16,7 @@ class GL_State_Trashing(rdtest.TestCase):
assert action is not None
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
postvs_data = self.get_postvs(action, rd.MeshDataStage.VSOut, 0, action.numIndices)
+1 -1
View File
@@ -13,5 +13,5 @@ class GL_Texture_Zoo(rdtest.TestCase):
assert self.controller is not None
# This takes ownership of the controller and shuts it down when it's finished
self.zoo_helper.worker_thread = self.worker_thread
self.zoo_helper.check_capture(self.capture_filename, self.controller)
self.zoo_helper.check_capture(self.capture_filename, self)
self.controller = None
+1 -1
View File
@@ -9,7 +9,7 @@ class GL_Unshared_Context(rdtest.TestCase):
action = self.find_action("Draw")
self.controller.SetFrameEvent(action.eventId, False)
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
Loaded 100 of 155 files, more files were not shown because too many files have changed in this diff. Show more