Remove checks for shader debuggability

* All APIs now support shader debugging by default and we assume/require all
  shaders in tests to be debuggable.
This commit is contained in:
baldurk
2026-09-11 21:17:17 +01:00
parent 04af66d71f
commit ae019398cb
18 changed files with 202 additions and 316 deletions
+25 -27
View File
@@ -120,40 +120,38 @@ class Buffer_Truncation(rdtest.TestCase):
if not rdtest.value_compare(outcol.value.f32v[0:4], [0.0, 0.0, 0.0, 0.0]):
raise rdtest.TestFailureException(f"expected outcol to be 0s, but got {outcol.value.f32v[0:4]}")
if self.controller.GetAPIProperties().shaderDebugging and pipe.GetShaderReflection(
rd.ShaderStage.Pixel).debugInfo.debuggable:
# Debug the shader
trace = self.controller.DebugPixel(
int(pipe.GetViewport(0).width / 2),
int(pipe.GetViewport(0).height / 2),
rd.DebugPixelInputs(),
)
# Debug the shader
trace = self.controller.DebugPixel(
int(pipe.GetViewport(0).width / 2),
int(pipe.GetViewport(0).height / 2),
rd.DebugPixelInputs(),
)
cycles, variables = self.process_trace(trace)
cycles, variables = self.process_trace(trace)
cbuf_sourceVars = [s for s in trace.sourceVars if s.variables[0].type == rd.DebugVariableType.Constant and s.rows > 0]
cbuf_sourceVars = [s for s in trace.sourceVars if s.variables[0].type == rd.DebugVariableType.Constant and s.rows > 0]
# Vulkan style, one source var for the cbuffer
if len(cbuf_sourceVars) == 1:
debugged_cb = trace.constantBlocks[0]
# Vulkan style, one source var for the cbuffer
if len(cbuf_sourceVars) == 1:
debugged_cb = trace.constantBlocks[0]
assert debugged_cb.members[0].name == 'padding'
assert debugged_cb.members[1].name == 'outcol'
assert debugged_cb.members[0].name == 'padding'
assert debugged_cb.members[1].name == 'outcol'
if not rdtest.value_compare(debugged_cb.members[1].value.f32v[0:4], [0.0, 0.0, 0.0, 0.0]):
raise rdtest.TestFailureException(f"expected outcol to be 0s, but got {debugged_cb.members[1].value.f32v[0:4]}")
# D3D style, one source var for each member mapping to a register
elif len(cbuf_sourceVars) == 17:
debugged_cb = trace.constantBlocks[0].members[16]
if not rdtest.value_compare(debugged_cb.members[1].value.f32v[0:4], [0.0, 0.0, 0.0, 0.0]):
raise rdtest.TestFailureException(f"expected outcol to be 0s, but got {debugged_cb.members[1].value.f32v[0:4]}")
# D3D style, one source var for each member mapping to a register
elif len(cbuf_sourceVars) == 17:
debugged_cb = trace.constantBlocks[0].members[16]
assert all(['consts.padding[' in c.name for c in cbuf_sourceVars[0:16]])
assert cbuf_sourceVars[16].name == 'consts.outcol'
assert all(['consts.padding[' in c.name for c in cbuf_sourceVars[0:16]])
assert cbuf_sourceVars[16].name == 'consts.outcol'
assert cbuf_sourceVars[16].variables[0].name == 'cb0[16]' or cbuf_sourceVars[16].variables[0].name == 'consts[16]'
assert cbuf_sourceVars[16].variables[0].name == 'cb0[16]' or cbuf_sourceVars[16].variables[0].name == 'consts[16]'
if not rdtest.value_compare(debugged_cb.value.f32v[0:4], [0.0, 0.0, 0.0, 0.0]):
raise rdtest.TestFailureException(f"expected outcol to be 0s, but got {debugged_cb.members[1].value.f32v[0:4]}")
else:
raise rdtest.TestFailureException(f"Unexpected number of constant buffer source vars {len(cbuf_sourceVars)}")
if not rdtest.value_compare(debugged_cb.value.f32v[0:4], [0.0, 0.0, 0.0, 0.0]):
raise rdtest.TestFailureException(f"expected outcol to be 0s, but got {debugged_cb.members[1].value.f32v[0:4]}")
else:
raise rdtest.TestFailureException(f"Unexpected number of constant buffer source vars {len(cbuf_sourceVars)}")
rdtest.log.success("CBuffer value was truncated as expected")
+6 -9
View File
@@ -131,18 +131,15 @@ class Draw_Zoo(rdtest.TestCase):
rdtest.log.success(f"Checked vertex out data in instance {inst}")
if self.props.shaderDebugging and refl.debugInfo.debuggable:
for vtx in range(num_verts):
if vtx in restarts:
continue
for vtx in range(num_verts):
if vtx in restarts:
continue
idx = vsout_ref[vtx]['idx']
idx = vsout_ref[vtx]['idx']
assert isinstance(idx, int)
assert isinstance(idx, int)
self.check_vertex_debug(vtx, idx, inst, postvs)
else:
rdtest.log.print('Not checking shader debugging, unsupported')
self.check_vertex_debug(vtx, idx, inst, postvs)
for vert, coord in enumerate(ref_data.pixels[inst]):
if coord[0] == 0 and coord[1] == 0:
-3
View File
@@ -1158,9 +1158,6 @@ class TestCase:
def check_debug_pixel(self, x: int, y: int):
pipe = self.controller.GetPipelineState()
if not pipe.GetShaderReflection(rd.ShaderStage.Pixel).debugInfo.debuggable:
log.print("Skipping undebuggable shader.")
return
# Debug the shader
trace = self.controller.DebugPixel(x, y, rd.DebugPixelInputs())
@@ -80,17 +80,13 @@ class D3D11_AMD_Shader_Extensions(rdtest.TestCase):
rdtest.log.success("compute shader disassembly is as expected")
if refl.debugInfo.debuggable:
self.set_event(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))
trace = self.controller.DebugThread((0, 0, 0), (0, 0, 0))
cycles, variables = self.process_trace(trace)
cycles, variables = self.process_trace(trace)
if cycles < 3:
raise rdtest.TestFailureException(f"Compute shader has too few cycles {cycles}")
else:
raise rdtest.TestFailureException(
f"Compute shader is listed as non-debuggable: {refl.debugInfo.debugStatus}")
if cycles < 3:
raise rdtest.TestFailureException(f"Compute shader has too few cycles {cycles}")
rdtest.log.success("compute shader debugged successfully")
+32 -34
View File
@@ -34,55 +34,53 @@ class D3D11_CBuffer_Zoo(rdtest.TestCase):
rdtest.log.success("CBuffer variables are as expected")
if self.controller.GetAPIProperties().shaderDebugging and pipe.GetShaderReflection(
rd.ShaderStage.Pixel).debugInfo.debuggable:
trace = self.controller.DebugPixel(
int(pipe.GetViewport(0).width / 2.0),
int(pipe.GetViewport(0).height / 2.0),
rd.DebugPixelInputs(),
)
trace = self.controller.DebugPixel(
int(pipe.GetViewport(0).width / 2.0),
int(pipe.GetViewport(0).height / 2.0),
rd.DebugPixelInputs(),
)
debugVars: Dict[str, rd.ShaderVariable] = dict()
debugVars: Dict[str, rd.ShaderVariable] = dict()
for base in trace.constantBlocks:
for var in base.members:
debugVars[base.name + var.name] = var
for base in trace.constantBlocks:
for var in base.members:
debugVars[base.name + var.name] = var
cbufferVars: List[rd.ShaderVariable] = []
cbufferVars: List[rd.ShaderVariable] = []
for sourceVar in trace.sourceVars:
if sourceVar.variables[0].name not in debugVars.keys():
continue
for sourceVar in trace.sourceVars:
if sourceVar.variables[0].name not in debugVars.keys():
continue
eval = self.evaluate_source_var(sourceVar, debugVars)
cbufferVars.append(eval)
eval = self.evaluate_source_var(sourceVar, debugVars)
cbufferVars.append(eval)
cbufferVars = self.combine_source_vars(cbufferVars)
cbufferVars = self.combine_source_vars(cbufferVars)
assert len(cbufferVars) == 2
assert cbufferVars[0].name == 'consts'
assert cbufferVars[1].name == 'packed_consts'
var_check = rdtest.ConstantBufferChecker(cbufferVars[0].members)
packed_check = rdtest.ConstantBufferChecker(cbufferVars[1].members)
self.check_cbuffer(var_check, packed_check)
assert len(cbufferVars) == 2
assert cbufferVars[0].name == 'consts'
assert cbufferVars[1].name == 'packed_consts'
var_check = rdtest.ConstantBufferChecker(cbufferVars[0].members)
packed_check = rdtest.ConstantBufferChecker(cbufferVars[1].members)
self.check_cbuffer(var_check, packed_check)
rdtest.log.success("Debugged CBuffer variables are as expected")
rdtest.log.success("Debugged CBuffer variables are as expected")
cycles, variables = self.process_trace(trace)
cycles, variables = self.process_trace(trace)
output = self.find_output_source_var(trace, rd.ShaderBuiltin.ColorOutput, 0)
output = self.find_output_source_var(trace, rd.ShaderBuiltin.ColorOutput, 0)
assert output is not None
assert output is not None
debugged = self.evaluate_source_var(output, variables)
debugged = self.evaluate_source_var(output, variables)
if not rdtest.util.value_compare(debugged.value.f32v[0:4], [542.1, 543.0, 544.0, 545.0]):
raise rdtest.TestFailureException(
f"Debugged output {debugged.value.f32v[0:4]} did not match expected {[542.1, 543.0, 544.0, 545.0]}")
if not rdtest.util.value_compare(debugged.value.f32v[0:4], [542.1, 543.0, 544.0, 545.0]):
raise rdtest.TestFailureException(
f"Debugged output {debugged.value.f32v[0:4]} did not match expected {[542.1, 543.0, 544.0, 545.0]}")
rdtest.log.success("Debugged output matched as expected")
rdtest.log.success("Debugged output matched as expected")
self.controller.FreeTrace(trace)
self.controller.FreeTrace(trace)
self.check_pixel_value(pipe.GetOutputTargets()[0].resource, 0.5, 0.5, [542.1, 543.0, 544.0, 545.0])
@@ -109,17 +109,13 @@ class D3D12_AMD_Shader_Extensions(rdtest.TestCase):
rdtest.log.success("compute shader disassembly is as expected")
if refl.debugInfo.debuggable:
self.set_event(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))
trace = self.controller.DebugThread((0, 0, 0), (0, 0, 0))
cycles, variables = self.process_trace(trace)
cycles, variables = self.process_trace(trace)
if cycles < 3:
raise rdtest.TestFailureException(f"Compute shader has too few cycles {cycles}")
else:
raise rdtest.TestFailureException(
f"Compute shader is listed as non-debuggable: {refl.debugInfo.debugStatus}")
if cycles < 3:
raise rdtest.TestFailureException(f"Compute shader has too few cycles {cycles}")
rdtest.log.success("compute shader debugged successfully")
+44 -46
View File
@@ -154,69 +154,67 @@ class D3D12_CBuffer_Zoo(rdtest.TestCase):
rdtest.log.success("Array cbuffer variables are as expected")
if self.controller.GetAPIProperties().shaderDebugging and pipe.GetShaderReflection(
rd.ShaderStage.Pixel).debugInfo.debuggable:
trace = self.controller.DebugPixel(
int(pipe.GetViewport(0).width / 2.0),
int(pipe.GetViewport(0).height / 2.0),
rd.DebugPixelInputs(),
)
trace = self.controller.DebugPixel(
int(pipe.GetViewport(0).width / 2.0),
int(pipe.GetViewport(0).height / 2.0),
rd.DebugPixelInputs(),
)
debugVars: Dict[str, rd.ShaderVariable] = dict()
debugVars: Dict[str, rd.ShaderVariable] = dict()
for base in trace.constantBlocks:
for var in base.members:
debugVars[base.name + var.name] = var
for base in trace.constantBlocks:
for var in base.members:
debugVars[base.name + var.name] = var
cbufferVars: List[rd.ShaderVariable] = []
cbufferVars: List[rd.ShaderVariable] = []
for sourceVar in trace.sourceVars:
if sourceVar.variables[0].name not in debugVars.keys():
continue
for sourceVar in trace.sourceVars:
if sourceVar.variables[0].name not in debugVars.keys():
continue
eval = self.evaluate_source_var(sourceVar, debugVars)
cbufferVars.append(eval)
eval = self.evaluate_source_var(sourceVar, debugVars)
cbufferVars.append(eval)
cbufferVars = self.combine_source_vars(cbufferVars)
cbufferVars = self.combine_source_vars(cbufferVars)
assert len(cbufferVars) == 5
assert cbufferVars[0].name == 'consts'
assert cbufferVars[1].name == 'rootconsts'
assert cbufferVars[2].name == 'packed_consts'
assert cbufferVars[3].name == 'array_consts'
assert cbufferVars[4].name == 'hugespace'
assert len(cbufferVars) == 5
assert cbufferVars[0].name == 'consts'
assert cbufferVars[1].name == 'rootconsts'
assert cbufferVars[2].name == 'packed_consts'
assert cbufferVars[3].name == 'array_consts'
assert cbufferVars[4].name == 'hugespace'
var_check = rdtest.ConstantBufferChecker(cbufferVars[0].members)
root_check = rdtest.ConstantBufferChecker(cbufferVars[1].members)
packed_check = rdtest.ConstantBufferChecker(cbufferVars[2].members)
arrays_check = rdtest.ConstantBufferChecker(cbufferVars[3].members)
huge_check = rdtest.ConstantBufferChecker(cbufferVars[4].members)
var_check = rdtest.ConstantBufferChecker(cbufferVars[0].members)
root_check = rdtest.ConstantBufferChecker(cbufferVars[1].members)
packed_check = rdtest.ConstantBufferChecker(cbufferVars[2].members)
arrays_check = rdtest.ConstantBufferChecker(cbufferVars[3].members)
huge_check = rdtest.ConstantBufferChecker(cbufferVars[4].members)
self.check_cbuffers(var_check, root_check, huge_check, packed_check)
rdtest.log.success("Debugged CBuffer variables are as expected")
self.check_cbuffers(var_check, root_check, huge_check, packed_check)
rdtest.log.success("Debugged CBuffer variables are as expected")
arrays_check.check('[0]').rows(0).cols(0).members({
'a' : lambda y : y.rows(1).cols(4).value([0.0, 1.0, 0.5, 0.5])})
arrays_check.check('[1]').rows(0).cols(0).members({
'a' : lambda y : y.rows(1).cols(4).value([1.0, 2.0, 0.5, 0.5])})
arrays_check.done()
rdtest.log.success("Array cbuffer variables are as expected")
arrays_check.check('[0]').rows(0).cols(0).members({
'a' : lambda y : y.rows(1).cols(4).value([0.0, 1.0, 0.5, 0.5])})
arrays_check.check('[1]').rows(0).cols(0).members({
'a' : lambda y : y.rows(1).cols(4).value([1.0, 2.0, 0.5, 0.5])})
arrays_check.done()
rdtest.log.success("Array cbuffer variables are as expected")
cycles, variables = self.process_trace(trace)
cycles, variables = self.process_trace(trace)
output = self.find_output_source_var(trace, rd.ShaderBuiltin.ColorOutput, 0)
output = self.find_output_source_var(trace, rd.ShaderBuiltin.ColorOutput, 0)
assert output is not None
assert output is not None
debugged = self.evaluate_source_var(output, variables)
debugged = self.evaluate_source_var(output, variables)
if not rdtest.util.value_compare(debugged.value.f32v[0:4], [543.1, 546.0, 545.0, 546.0]):
raise rdtest.TestFailureException(
f"Debugged output {debugged.value.f32v[0:4]} did not match expected {[543.1, 546.0, 545.0, 546.0]}")
if not rdtest.util.value_compare(debugged.value.f32v[0:4], [543.1, 546.0, 545.0, 546.0]):
raise rdtest.TestFailureException(
f"Debugged output {debugged.value.f32v[0:4]} did not match expected {[543.1, 546.0, 545.0, 546.0]}")
rdtest.log.success("Debugged output matched as expected")
rdtest.log.success("Debugged output matched as expected")
self.controller.FreeTrace(trace)
self.controller.FreeTrace(trace)
self.check_pixel_value(pipe.GetOutputTargets()[0].resource, 0.5, 0.5, [543.1, 546.0, 545.0, 546.0])
@@ -18,10 +18,6 @@ class D3D12_PrimitiveID(rdtest.TestCase):
self.set_event(action.eventId, True)
pipe = self.controller.GetPipelineState()
if not pipe.GetShaderReflection(rd.ShaderStage.Pixel).debugInfo.debuggable:
rdtest.log.print(f"Skipping undebuggable shader at {action.eventId}.")
return True
pixel_inputs = rd.DebugPixelInputs()
pixel_inputs.primitive = prim
trace = self.controller.DebugPixel(x, y, pixel_inputs)
@@ -70,10 +66,6 @@ class D3D12_PrimitiveID(rdtest.TestCase):
return True
def check_capture(self):
if not self.controller.GetAPIProperties().shaderDebugging:
rdtest.log.success("Shader debugging not enabled, skipping test")
return
success = True
markers = ["SM5.0", "SM6.0"]
@@ -8,10 +8,6 @@ class D3D12_Resource_Mapping_Zoo(rdtest.TestCase):
def test_debug_pixel(self, x: int, y: int, test_name: str):
pipe = self.controller.GetPipelineState()
if not pipe.GetShaderReflection(rd.ShaderStage.Pixel).debugInfo.debuggable:
rdtest.log.print(f"Skipping undebuggable shader at {test_name}.")
return True
# Debug the shader
trace = self.controller.DebugPixel(x, y, rd.DebugPixelInputs())
@@ -35,9 +31,6 @@ class D3D12_Resource_Mapping_Zoo(rdtest.TestCase):
return True
def check_capture(self):
if not self.controller.GetAPIProperties().shaderDebugging:
rdtest.log.success("Shader debugging not enabled, skipping test")
return
if not self.check_capture_internal():
raise rdtest.TestFailureException("Some tests were not as expected")
@@ -74,10 +74,6 @@ class D3D12_Shader_DebugData_Zoo(rdtest.TestCase):
return varsToCheck
def check_capture(self):
if not self.controller.GetAPIProperties().shaderDebugging:
rdtest.log.success("Shader debugging not enabled, skipping test")
return
failed = False
shaderModels = [
@@ -97,58 +93,49 @@ class D3D12_Shader_DebugData_Zoo(rdtest.TestCase):
pipe = self.controller.GetPipelineState()
if pipe.GetShaderReflection(rd.ShaderStage.Vertex).debugInfo.debuggable:
# Debug the vertex shader
instId = 1
with self.debug_vertex(0, instId, 0, 0) as debug:
cycles, variables = self.process_trace(debug.trace)
output = self.find_output_source_var(debug.trace, rd.ShaderBuiltin.Undefined, 1)
assert output is not None
debugged = self.evaluate_source_var(output, variables)
actual = debugged.value.u32v[0]
expected = instId
if not rdtest.value_compare(actual, expected):
# Debug the vertex shader
instId = 1
with self.debug_vertex(0, instId, 0, 0) as debug:
cycles, variables = self.process_trace(debug.trace)
output = self.find_output_source_var(debug.trace, rd.ShaderBuiltin.Undefined, 1)
assert output is not None
debugged = self.evaluate_source_var(output, variables)
actual = debugged.value.u32v[0]
expected = instId
if not rdtest.value_compare(actual, expected):
failed = True
rdtest.log.error(
f"Vertex shader TRIANGLE output did not match expectation {actual} != {expected}")
if not failed:
rdtest.log.success("Basic VS debugging was successful")
# Look for MAT0 variable in the trace initial source variables
matched = True
varsToCheck: List[Tuple[str, str, rdtest.ScalarOrVectorValue]] = []
varsToCheck.append((f"MAT0[0]", "float4", [1.0, 2.0, 3.0, 4.0]))
varsToCheck.append((f"MAT0[1]", "float4", [5.0, 6.0, 7.0, 8.0]))
varsToCheck.append((f"MAT0[2]", "float4", [9.0, 10.0, 11.0, 12.0]))
for name, varType, expectedValue in varsToCheck:
debuggedValue = None
try:
debuggedValue = self.get_source_shader_var_value(debug.trace.sourceVars, name, varType, variables)
except KeyError as ex:
matched = False
failed = True
except rdtest.TestFailureException as ex:
matched = False
failed = True
rdtest.log.error(
f"Vertex shader TRIANGLE output did not match expectation {actual} != {expected}")
if not failed:
rdtest.log.success("Basic VS debugging was successful")
if debuggedValue is None:
raise rdtest.TestFailureException(f"Couldn't find source variable {name} type:{varType}")
if not rdtest.value_compare(expectedValue, debuggedValue):
matched = False
failed = True
rdtest.log.error(f"'{name}' {varType} debugger {debuggedValue} doesn't match expected {expectedValue}")
# Look for MAT0 variable in the trace initial source variables
matched = True
varsToCheck: List[Tuple[str, str, rdtest.ScalarOrVectorValue]] = []
varsToCheck.append((f"MAT0[0]", "float4", [1.0, 2.0, 3.0, 4.0]))
varsToCheck.append((f"MAT0[1]", "float4", [5.0, 6.0, 7.0, 8.0]))
varsToCheck.append((f"MAT0[2]", "float4", [9.0, 10.0, 11.0, 12.0]))
for name, varType, expectedValue in varsToCheck:
debuggedValue = None
try:
debuggedValue = self.get_source_shader_var_value(debug.trace.sourceVars, name, varType, variables)
except KeyError as ex:
matched = False
failed = True
except rdtest.TestFailureException as ex:
matched = False
failed = True
if debuggedValue is None:
raise rdtest.TestFailureException(f"Couldn't find source variable {name} type:{varType}")
if not rdtest.value_compare(expectedValue, debuggedValue):
matched = False
failed = True
rdtest.log.error(f"'{name}' {varType} debugger {debuggedValue} doesn't match expected {expectedValue}")
if matched:
rdtest.log.success("VS MAT0 output source variable matched as expected")
else:
rdtest.log.print(f"Ignoring undebuggable Vertex shader at {action.eventId} for {shaderModels[sm]}.")
if not pipe.GetShaderReflection(rd.ShaderStage.Pixel).debugInfo.debuggable:
rdtest.log.print(f"Skipping undebuggable Pixel shader at {action.eventId} for {shaderModels[sm]}.")
rdtest.log.end_section(shaderModels[sm] + " tests")
continue
if matched:
rdtest.log.success("VS MAT0 output source variable matched as expected")
# Loop over every test
for test in range(action.numInstances):
@@ -251,10 +238,6 @@ class D3D12_Shader_DebugData_Zoo(rdtest.TestCase):
action = test_marker.nextAction
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]}.")
rdtest.log.end_section(section)
continue
# Loop over every test
for test in range(action.dispatchDimension[0]):
+31 -56
View File
@@ -31,10 +31,6 @@ class D3D12_Shader_Debug_Zoo(rdtest.TestCase):
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
csrefl = pipe.GetShaderReflection(rd.ShaderStage.Compute)
if not csrefl.debugInfo.debuggable:
rdtest.log.print(f"Compute shader is undebuggable at {action.eventId} for {test}.")
failed = True
continue
rw = pipe.GetReadWriteResources(rd.ShaderStage.Compute)
if len(rw) != 1:
@@ -103,10 +99,6 @@ class D3D12_Shader_Debug_Zoo(rdtest.TestCase):
return failed
def check_capture(self):
if not self.controller.GetAPIProperties().shaderDebugging:
rdtest.log.success("Shader debugging not enabled, skipping test")
return
undefined_tests = [int(test) for test in self.find_action("Undefined tests: ").customName.split(" ")[2:]]
failed = False
@@ -138,22 +130,15 @@ class D3D12_Shader_Debug_Zoo(rdtest.TestCase):
pipe = self.controller.GetPipelineState()
if pipe.GetShaderReflection(rd.ShaderStage.Vertex).debugInfo.debuggable:
postvs = self.get_postvs(action, rd.MeshDataStage.VSOut, instance=instId)
postvs = self.get_postvs(action, rd.MeshDataStage.VSOut, instance=instId)
success, err = self.check_vertex_debug(0, 0, instId, postvs, fatal=False)
if not success:
failed = True
rdtest.log.error(f"Basic VS debugging didn't match: {err}")
continue
else:
rdtest.log.success("Basic VS debugging was successful")
else:
rdtest.log.print(f"Ignoring undebuggable Vertex shader at {action.eventId} for {shaderModels[sm]}.")
if not pipe.GetShaderReflection(rd.ShaderStage.Pixel).debugInfo.debuggable:
rdtest.log.print(f"Skipping undebuggable Pixel shader at {action.eventId} for {shaderModels[sm]}.")
success, err = self.check_vertex_debug(0, 0, instId, postvs, fatal=False)
if not success:
failed = True
rdtest.log.error(f"Basic VS debugging didn't match: {err}")
continue
else:
rdtest.log.success("Basic VS debugging was successful")
# Loop over every test
for test in range(action.numInstances):
@@ -243,40 +228,34 @@ class D3D12_Shader_Debug_Zoo(rdtest.TestCase):
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
if pipe.GetShaderReflection(rd.ShaderStage.Vertex).debugInfo.debuggable:
# Debug the vertex shader
success, err = self.check_vertex_debug(0, 0, 0, self.get_postvs(action, rd.MeshDataStage.VSOut), fatal=False)
if not success:
failed = True
rdtest.log.error(
f"{shaderModels[sm]} Vertex shader failed: {err}")
continue
else:
rdtest.log.success(shaderModels[sm] + " VertexSample VS was debugged correctly")
# Debug the vertex shader
success, err = self.check_vertex_debug(0, 0, 0, self.get_postvs(action, rd.MeshDataStage.VSOut), fatal=False)
if not success:
failed = True
rdtest.log.error(
f"{shaderModels[sm]} Vertex shader failed: {err}")
continue
else:
rdtest.log.print(f"Skipping undebuggable Vertex shader at {action.eventId} for {shaderModels[sm]}.")
rdtest.log.success(shaderModels[sm] + " VertexSample VS was debugged correctly")
if pipe.GetShaderReflection(rd.ShaderStage.Pixel).debugInfo.debuggable:
# Debug the pixel shader
inputs = rd.DebugPixelInputs()
inputs.sample = 0
trace = self.controller.DebugPixel(51, 51, inputs)
cycles, variables = self.process_trace(trace)
output = self.find_output_source_var(trace, rd.ShaderBuiltin.ColorOutput, 0)
assert output is not None
debugged = self.evaluate_source_var(output, variables)
self.controller.FreeTrace(trace)
# Debug the pixel shader
inputs = rd.DebugPixelInputs()
inputs.sample = 0
trace = self.controller.DebugPixel(51, 51, inputs)
cycles, variables = self.process_trace(trace)
output = self.find_output_source_var(trace, rd.ShaderBuiltin.ColorOutput, 0)
assert output is not None
debugged = self.evaluate_source_var(output, variables)
self.controller.FreeTrace(trace)
# Validate the debug output result
try:
self.check_pixel_value(pipe.GetOutputTargets()[0].resource, 51, 51, debugged.value.f32v[0:4])
except rdtest.TestFailureException as ex:
failed = True
rdtest.log.error(f"Vertex sample pixel shader output did not match. {ex!s}")
# Validate the debug output result
try:
self.check_pixel_value(pipe.GetOutputTargets()[0].resource, 51, 51, debugged.value.f32v[0:4])
except rdtest.TestFailureException as ex:
failed = True
rdtest.log.error(f"Vertex sample pixel shader output did not match. {ex!s}")
rdtest.log.success("VertexSample PS was debugged correctly")
else:
rdtest.log.print(f"Skipping undebuggable Pixel shader at {action.eventId} for {shaderModels[sm]}.")
rdtest.log.success("VertexSample PS was debugged correctly")
rdtest.log.end_section("VertexSample tests")
@@ -326,10 +305,6 @@ class D3D12_Shader_Debug_Zoo(rdtest.TestCase):
action = test_marker.nextAction
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]}.")
rdtest.log.end_section(section)
continue
# Debug the shader
for groupX in range(action.dispatchDimension[0]):
@@ -6,10 +6,6 @@ class D3D12_Shader_Linkage_Zoo(rdtest.TestCase):
demos_test_name = 'D3D12_Shader_Linkage_Zoo'
def check_capture(self):
if not self.controller.GetAPIProperties().shaderDebugging:
rdtest.log.success("Shader debugging not enabled, skipping test")
return
failed = False
test_marker = self.find_action("draw")
@@ -21,10 +17,6 @@ class D3D12_Shader_Linkage_Zoo(rdtest.TestCase):
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
if not pipe.GetShaderReflection(rd.ShaderStage.Pixel).debugInfo.debuggable:
rdtest.log.print(f"Skipping undebuggable shader at {event_name}.")
continue
# Debug the shader
trace = self.controller.DebugPixel(200, 150, rd.DebugPixelInputs())
@@ -45,10 +45,6 @@ class D3D12_Vertex_UAV(rdtest.TestCase):
rdtest.log.success(f"Quad overdraw is good on {name}")
if not pipe.GetShaderReflection(rd.ShaderStage.Pixel).debugInfo.debuggable:
rdtest.log.print("Skipping undebuggable shader.")
continue
# Debug the shader
trace = self.controller.DebugPixel(50, 50, rd.DebugPixelInputs())
-11
View File
@@ -8,9 +8,6 @@ class GL_Shader_Debug_Zoo(rdtest.TestCase):
def check_capture(self):
assert self.controller is not None
if not self.controller.GetAPIProperties().shaderDebugging:
rdtest.log.success("Shader debugging not enabled, skipping test")
return
failed = False
@@ -29,14 +26,6 @@ class GL_Shader_Debug_Zoo(rdtest.TestCase):
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
if not pipe.GetShaderReflection(rd.ShaderStage.Vertex).debugInfo.debuggable:
rdtest.log.print(f"Skipping undebuggable shader at {test} in {child}.")
return
if not pipe.GetShaderReflection(rd.ShaderStage.Pixel).debugInfo.debuggable:
rdtest.log.print(f"Skipping undebuggable shader at {test} in {child}.")
return
y = 1
inputs = rd.DebugPixelInputs()
+14 -1
View File
@@ -64,6 +64,10 @@ class Iter_Test(rdtest.TestCase):
rdtest.log.print(f"{action.eventId} is not a debuggable action")
return
if not refl.debugInfo.debuggable:
rdtest.log.print(f"Compute shader is not debuggable at {action.eventId}")
return
wgSize = action.dispatchDimension
if any(dim == 0 for dim in wgSize):
rdtest.log.print(f"Empty dispatch ({wgSize[0]}x{wgSize[1]}x{wgSize[2]}), skipping")
@@ -103,6 +107,10 @@ class Iter_Test(rdtest.TestCase):
rdtest.log.print(f"No vertex shader bound at {action.eventId}")
return
if not refl.debugInfo.debuggable:
rdtest.log.print(f"Vertex shader is not debuggable at {action.eventId}")
return
if not (action.flags & rd.ActionFlags.Drawcall) and action.drawIndex == 0:
rdtest.log.print(f"{action.eventId} is not a debuggable action")
return
@@ -255,10 +263,15 @@ class Iter_Test(rdtest.TestCase):
pipe = self.controller.GetPipelineState()
if pipe.GetShader(rd.ShaderStage.Pixel) == rd.ResourceId.Null():
refl = pipe.GetShaderReflection(rd.ShaderStage.Pixel)
if refl is None:
rdtest.log.print(f"Nothing to debug. No pixel shader bound at {action.eventId}")
return
if not refl.debugInfo.debuggable:
rdtest.log.print(f"Pixel shader is not debuggable at {action.eventId}")
return
inputs = rd.DebugPixelInputs()
inputs.sample = 0
inputs.primitive = lastmod.primitiveID;
@@ -5,10 +5,6 @@ class VK_KHR_Buffer_Address(rdtest.TestCase):
demos_test_name = 'VK_KHR_Buffer_Address'
def check_capture(self):
if not self.controller.GetAPIProperties().shaderDebugging:
rdtest.log.success("Shader debugging not enabled, skipping test")
return
x = 100
y = 150
@@ -20,9 +16,6 @@ class VK_KHR_Buffer_Address(rdtest.TestCase):
self.set_event(action.eventId, True)
pipe = self.controller.GetPipelineState()
if not pipe.GetShaderReflection(rd.ShaderStage.Pixel).debugInfo.debuggable:
raise rdtest.TestFailureException(f"Test {test_name} shader can not be debugged")
# Debug the pixel shader
trace = self.controller.DebugPixel(x, y, rd.DebugPixelInputs())
-8
View File
@@ -5,10 +5,6 @@ class VK_Multi_View(rdtest.TestCase):
demos_test_name = 'VK_Multi_View'
def check_capture(self):
if not self.controller.GetAPIProperties().shaderDebugging:
rdtest.log.success("Shader debugging not enabled, skipping test")
return
x = 200
y = 150
@@ -22,8 +18,6 @@ class VK_Multi_View(rdtest.TestCase):
self.set_event(action.eventId, True)
pipe = self.controller.GetPipelineState()
if not pipe.GetShaderReflection(rd.ShaderStage.Pixel).debugInfo.debuggable:
raise rdtest.TestFailureException(f"Test {test_name} shader can not be debugged")
for view in range(2):
# Debug the pixel shader
@@ -57,8 +51,6 @@ class VK_Multi_View(rdtest.TestCase):
self.set_event(action.eventId, True)
pipe = self.controller.GetPipelineState()
if not pipe.GetShaderReflection(rd.ShaderStage.Pixel).debugInfo.debuggable:
raise rdtest.TestFailureException(f"Test {test_name} shader can not be debugged")
for view in range(2):
if view == 0:
@@ -9,10 +9,6 @@ class VK_Shader_Debug_Zoo(rdtest.TestCase):
slow_test = True
def check_capture(self):
if not self.controller.GetAPIProperties().shaderDebugging:
rdtest.log.success("Shader debugging not enabled, skipping test")
return
failed = False
for test_name in ["GLSL1 tests", "GLSL2 tests", "ASM tests"]:
@@ -23,10 +19,6 @@ class VK_Shader_Debug_Zoo(rdtest.TestCase):
self.set_event(section.eventId, False)
pipe = self.controller.GetPipelineState()
if not pipe.GetShaderReflection(rd.ShaderStage.Pixel).debugInfo.debuggable:
rdtest.log.print(f"Skipping undebuggable shader at {child} in {test_name}.")
return
for test in range(section.numInstances):
x = 4 * test + 1
y = 4 * child + 1
@@ -107,10 +99,6 @@ class VK_Shader_Debug_Zoo(rdtest.TestCase):
self.set_event(action.eventId, False)
pipe = self.controller.GetPipelineState()
csrefl = pipe.GetShaderReflection(rd.ShaderStage.Compute)
if not csrefl.debugInfo.debuggable:
rdtest.log.print(f"Compute shader is undebuggable at {action.eventId} for {test}.")
failed = True
continue
rw = pipe.GetReadWriteResources(rd.ShaderStage.Compute)
if len(rw) != 1: