From 7ac76492f4add4420fd3728788531a3432099713 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 26 Feb 2025 16:11:58 +0000 Subject: [PATCH] Clamp pixel shader comparisons to output components in Iter_Test --- util/test/tests/Iter_Test.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/util/test/tests/Iter_Test.py b/util/test/tests/Iter_Test.py index 43fe94f37..628b87f30 100644 --- a/util/test/tests/Iter_Test.py +++ b/util/test/tests/Iter_Test.py @@ -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: