diff options
| author | Vonsek <45567075+Vonsek@users.noreply.github.com> | 2026-11-22 11:31:14 +0100 |
|---|---|---|
| committer | Vonsek <45567075+Vonsek@users.noreply.github.com> | 2026-11-22 11:58:00 +0100 |
| commit | 2dfd8d47528d899036e0cbe79cd03f2db94662b2 (patch) | |
| tree | a3b18821eba07d20d99611a3b5e47297f511ef98 /tests/semantic/test_buffer_load_format.py | |
| parent | c2967a5e60060e4068fb992196d8f4b494a5046c (diff) | |
fix(shader): suppress MTBUF loads from unbound descriptors
The instruction format overrides a bound descriptor. Native gfx1036 returns zeros for FORMAT=INVALID even when its address and extent are otherwise usable. Gate the existing guarded load before reading memory.
Diffstat (limited to 'tests/semantic/test_buffer_load_format.py')
| -rw-r--r-- | tests/semantic/test_buffer_load_format.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/semantic/test_buffer_load_format.py b/tests/semantic/test_buffer_load_format.py index a370d1f33..f91690a41 100644 --- a/tests/semantic/test_buffer_load_format.py +++ b/tests/semantic/test_buffer_load_format.py | |||
| @@ -271,6 +271,17 @@ class TbufferDefaultFormat(unittest.TestCase): | |||
| 271 | self.assertEqual(got, want) | 271 | self.assertEqual(got, want) |
| 272 | self.assertEqual(load_format(FMT_UINT8X4, 0, 4, dst_sel=1 << 9), (0, 0, 0, 1)) | 272 | self.assertEqual(load_format(FMT_UINT8X4, 0, 4, dst_sel=1 << 9), (0, 0, 0, 1)) |
| 273 | 273 | ||
| 274 | def test_invalid_descriptor_suppresses_fixed_format_load(self): | ||
| 275 | # Same address, 256-byte bound and instruction format. Only the V# FORMAT changes. | ||
| 276 | cases = ((False, 4, (0x44, 0x33, 0x22, 0x11), (0, 0, 0, 0)), | ||
| 277 | (True, 3, (0x00330044, 0xa9bc0022), (0, 0xa9bc0000))) | ||
| 278 | for d16, n, bound, unbound in cases: | ||
| 279 | for fmt, want in ((FMT_U32, bound), (0, unbound)): | ||
| 280 | with self.subTest(d16=d16, fmt=fmt): | ||
| 281 | got = load_format(fmt, 0, n, memory={BASE: 0x11223344}, d16=d16, | ||
| 282 | op="tbuffer_load_format", mods=" format:[BUF_FMT_8_8_8_8_UINT]") | ||
| 283 | self.assertEqual(got[:len(want)], want) | ||
| 284 | |||
| 274 | def test_packed_default_8_unorm(self): | 285 | def test_packed_default_8_unorm(self): |
| 275 | # The first byte is 0xff: 1.0 in f16 is 0x3c00. Preserve the upper destination half. | 286 | # The first byte is 0xff: 1.0 in f16 is 0x3c00. Preserve the upper destination half. |
| 276 | got = load_format(FMT_U32, 0, 1, memory=self.MEM, d16=True, op="tbuffer_load_format") | 287 | got = load_format(FMT_U32, 0, 1, memory=self.MEM, d16=True, op="tbuffer_load_format") |