From c8223f586990d5166314026025d3124a717873e8 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 14 Jan 2025 12:15:35 +0000 Subject: [PATCH] Fix D3D12 descriptor indexing test for named descriptors --- .../tests/D3D12/D3D12_Descriptor_Indexing.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/util/test/tests/D3D12/D3D12_Descriptor_Indexing.py b/util/test/tests/D3D12/D3D12_Descriptor_Indexing.py index 783208c485..8935a967fd 100644 --- a/util/test/tests/D3D12/D3D12_Descriptor_Indexing.py +++ b/util/test/tests/D3D12/D3D12_Descriptor_Indexing.py @@ -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, @@ -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,