Clamp pixel shader comparisons to output components in Iter_Test

This commit is contained in:
baldurk
2025-02-26 16:11:58 +00:00
parent fd85828351
commit 7ac76492f4
+9 -2
View File
@@ -350,14 +350,21 @@ class Iter_Test(rdtest.TestCase):
if debugged.value.u32v[idx] == 0xcccccccc:
debuggedValue[idx] = lastmod.shaderOut.col.floatValue[idx]
historyValue = list(lastmod.shaderOut.col.floatValue)
tex = self.get_texture(target)
historyValue = historyValue[0:tex.format.compCount]
debuggedValue = debuggedValue[0:tex.format.compCount]
# Unfortunately we can't ever trust that we should get back a matching results, because some shaders
# rely on undefined/inaccurate maths that we don't emulate.
# So the best we can do is log an error for manual verification
is_eq, diff_amt = rdtest.value_compare_diff(lastmod.shaderOut.col.floatValue, debuggedValue, eps=5.0E-06)
is_eq, diff_amt = rdtest.value_compare_diff(historyValue, debuggedValue, eps=5.0E-06)
if not is_eq:
rdtest.log.error(
"Debugged value {} at EID {} {},{}: {} difference. {} doesn't exactly match history shader output {}".format(
debugged.name, lastmod.eventId, x, y, diff_amt, debuggedValue, lastmod.shaderOut.col.floatValue))
debugged.name, lastmod.eventId, x, y, diff_amt, debuggedValue, historyValue))
rdtest.log.success('Successfully debugged pixel in {} cycles, result matches'.format(cycles))
else: