Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/startup_compute_translate_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
14 changes: 10 additions & 4 deletions tests/startup_gfx2hlsl_compute_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('<I', len(rts0)) + rts0
return b'DXBC' + bytes(16) + struct.pack('<III', 1, 32 + 4 + len(part), 1) + struct.pack('<I', 36) + part

Expand Down
Loading