diff --git a/tests/startup_compute_translate_check.py b/tests/startup_compute_translate_check.py index 1389b32c31..dbf5d63248 100644 --- a/tests/startup_compute_translate_check.py +++ b/tests/startup_compute_translate_check.py @@ -120,7 +120,7 @@ def check_requests(directory): def check_e2e(directory, consumer, dxc, runner, adapter, wrong_group): cache, env = prepare(directory) - (directory / 'compute_root').write_bytes(C.root_blob()) + (directory / 'compute_root').write_bytes(C.root_blob(table_range=True)) # the consumer creates it on a device env['X2W_TEST_COMPUTE_ROOT'] = str(directory / 'compute_root') _, words, rsrc2, group, groups = C.CASES['A'] if wrong_group: diff --git a/tests/startup_gfx2hlsl_compute_check.py b/tests/startup_gfx2hlsl_compute_check.py index f95d196434..cb70b4c2a7 100644 --- a/tests/startup_gfx2hlsl_compute_check.py +++ b/tests/startup_gfx2hlsl_compute_check.py @@ -310,13 +310,19 @@ def splice(*lines, at=STORE_A): *CASES['A'][2:]) -def root_blob(constants=2): - """RTS0: param 0 = root constants (b0), param 1 = a descriptor table with no ranges.""" +def root_blob(constants=2, table_range=False): + """RTS0: param 0 = root constants (b0), param 1 = a descriptor table with no ranges. + + table_range gives the table one SRV range (t0, one descriptor) for a blob that a device creates: the Windows 10 + in-box D3D12 runtime (10.0.19041) corrupts its heap in CreateRootSignature for a table with no ranges. The + default bytes are unchanged because they are part of pinned request keys. + """ params_at, constants_at = 24, 24 + 2 * 12 table_at = constants_at + 12 - rts0 = (struct.pack('<6I', 2, 2, params_at, 0, table_at + 8, 0) + ranges = struct.pack('<6I', 0, 1, 0, 0, 0, 0xffffffff) if table_range else b'' # SRV, 1, t0, space 0, append + rts0 = (struct.pack('<6I', 2, 2, params_at, 0, table_at + 8 + len(ranges), 0) + struct.pack('<3I', 1, 0, constants_at) + struct.pack('<3I', 0, 0, table_at) - + struct.pack('<3I', 0, 0, constants) + struct.pack('<2I', 0, table_at + 8)) + + struct.pack('<3I', 0, 0, constants) + struct.pack('<2I', len(ranges) // 24, table_at + 8) + ranges) part = b'RTS0' + struct.pack('