Check for truncated flag presence or absence in cbuffer checks

This commit is contained in:
baldurk committed 2026-10-12 10:37:10 +01:00
1 parent 36b1c78ec7
commit d0ea00bba1
3 files changed
+14 -2

No files matched your search

+12
View File
@@ -35,8 +35,20 @@ class ShaderVariableCheck:
return self
def truncated(self):
if not (self.var.flags & rd.ShaderVariableFlags.Truncated):
raise TestFailureException(f"Variable {self.var.name} is not truncated")
count = self.var.columns
if list(self.var.value.u32v[0:count]) != [0] * count:
raise TestFailureException(f"Truncated variable {self.var.name} doesn't have 0 values")
def value(self, value_: List[float] | List[int]):
count = len(value_)
if self.var.flags & rd.ShaderVariableFlags.Truncated:
raise TestFailureException(f"Variable {self.var.name} is truncated but we're checking its value")
if isinstance(value_[0], float):
vals = []
if self.var.type == rd.VarType.Float:
+1 -1
View File
@@ -31,7 +31,7 @@ class D3D11_Parameter_Zoo(rdtest.TestCase):
pipe.GetShaderEntryPoint(stage), 0,
cbuf.resource, cbuf.byteOffset, cbuf.byteSize))
var_check.check('cbuf_zero').rows(1).cols(4).value([0.0, 0.0, 0.0, 0.0])
var_check.check('cbuf_zero').rows(1).cols(4).truncated()
tex = rd.TextureDisplay()
tex.overlay = rd.DebugOverlay.Drawcall
+1 -1
View File
@@ -89,7 +89,7 @@ class VK_Robustness2(rdtest.TestCase):
cbuf.resource, cbuf.byteOffset, cbuf.byteSize))
if cb.bufferBacked:
var_check.check('data').type(rd.VarType.Float).rows(1).cols(4).value([0.0, 0.0, 0.0, 0.0])
var_check.check('data').type(rd.VarType.Float).rows(1).cols(4).truncated()
else:
val = [0, 0, 0, 0]
if self.find_action('robustBufferAccess2') is not None: