Skip to content

Commit

Permalink
Fix D3D12 descriptor indexing test for named descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
baldurk committed Jan 14, 2025
1 parent e692c30 commit c8223f5
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions util/test/tests/D3D12/D3D12_Descriptor_Indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,13 @@ def check_capture(self):
self.check([d.access.byteOffset for d in rw] == sorted(bind_info[rd.DescriptorCategory.ReadWriteResource]))
self.check([d.access.byteOffset for d in ro] == sorted(bind_info[rd.DescriptorCategory.ReadOnlyResource]))
self.check([d.access.byteOffset for d in samp] == sorted(bind_info[rd.DescriptorCategory.Sampler]))

descriptor_names = {
12: 'smiley',
19: 'another_smiley',
20: 'more_smileys???',
10: 'outUAV',
}

for a in ro + rw:
loc = self.controller.GetDescriptorLocations(a.access.descriptorStore,
Expand All @@ -209,10 +216,14 @@ def check_capture(self):
raise rdtest.TestFailureException("Bind {} not expected for space,reg {} array element {}".format(
loc.fixedBindNumber, a.access.byteOffset))

if loc.logicalBindName != "ResourceDescriptorHeap[{}]".format(a.access.byteOffset):
if a.access.byteOffset in descriptor_names.keys():
name = descriptor_names[a.access.byteOffset]
else:
name = "ResourceDescriptorHeap"

if loc.logicalBindName != f"{name}[{a.access.byteOffset}]":
raise rdtest.TestFailureException(
"Bind {} not expected for descriptor access ResourceDescriptorHeap[{}]".format(
loc.logicalBindName, a.access.byteOffset))
f"Bind '{loc.logicalBindName}' is not the expected '{name}' for descriptor {a.access.byteOffset}")

for a in samp:
loc = self.controller.GetDescriptorLocations(a.access.descriptorStore,
Expand Down

0 comments on commit c8223f5

Please sign in to comment.