Add a query to determine logical identifiers for descriptors

* This is a consideration for any cases where binding numbers are relevant -
  primarily D3D11 and GL - where the offset into an arbitrary (and possibly
  fake) descriptor storage is not helpful but knowing the register binding
  definitely is.
* If someone wants to look at the raw descriptor contents without respect to a
  particular shader access they can use this query to determine a more useful
  'name' for any given descriptor. On D3D11 and GL this gives the register
  number, on Vulkan it gives the binding number (and array element). On D3D12 it
  just repeats the offset effectively.
This commit is contained in:
baldurk
2024-04-10 18:58:50 +01:00
parent b9787606ea
commit d88aad8fc2
22 changed files with 620 additions and 1 deletions
+6
View File
@@ -170,6 +170,12 @@ rdcarray<DescriptorAccess> DummyDriver::GetDescriptorAccess(uint32_t eventId)
return {};
}
rdcarray<DescriptorLogicalLocation> DummyDriver::GetDescriptorLocations(
ResourceId descriptorStore, const rdcarray<DescriptorRange> &ranges)
{
return {};
}
FrameRecord DummyDriver::GetFrameRecord()
{
return m_FrameRecord;
+2
View File
@@ -65,6 +65,8 @@ public:
rdcarray<SamplerDescriptor> GetSamplerDescriptors(ResourceId descriptorStore,
const rdcarray<DescriptorRange> &ranges);
rdcarray<DescriptorAccess> GetDescriptorAccess(uint32_t eventId);
rdcarray<DescriptorLogicalLocation> GetDescriptorLocations(ResourceId descriptorStore,
const rdcarray<DescriptorRange> &ranges);
FrameRecord GetFrameRecord();
+12
View File
@@ -1138,6 +1138,17 @@ void DoSerialise(SerialiserType &ser, DescriptorAccess &el)
SIZE_CHECK(32);
}
template <typename SerialiserType>
void DoSerialise(SerialiserType &ser, DescriptorLogicalLocation &el)
{
SERIALISE_MEMBER(stageMask);
SERIALISE_MEMBER(category);
SERIALISE_MEMBER(fixedBindNumber);
SERIALISE_MEMBER(logicalBindName);
SIZE_CHECK(16);
}
template <typename SerialiserType>
void DoSerialise(SerialiserType &ser, StencilFace &el)
{
@@ -2604,6 +2615,7 @@ INSTANTIATE_SERIALISE_TYPE(DescriptorRange)
INSTANTIATE_SERIALISE_TYPE(Descriptor)
INSTANTIATE_SERIALISE_TYPE(SamplerDescriptor)
INSTANTIATE_SERIALISE_TYPE(DescriptorAccess)
INSTANTIATE_SERIALISE_TYPE(DescriptorLogicalLocation)
INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::Layout)
INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::InputAssembly)
INSTANTIATE_SERIALISE_TYPE(D3D11Pipe::View)
+8
View File
@@ -138,6 +138,14 @@ rdcarray<DescriptorAccess> ReplayController::GetDescriptorAccess()
return m_pDevice->GetDescriptorAccess(m_EventID);
}
rdcarray<DescriptorLogicalLocation> ReplayController::GetDescriptorLocations(
ResourceId descriptorStore, const rdcarray<DescriptorRange> &ranges)
{
CHECK_REPLAY_THREAD();
return m_pDevice->GetDescriptorLocations(m_pDevice->GetLiveID(descriptorStore), ranges);
}
rdcarray<SamplerDescriptor> ReplayController::GetSamplerDescriptors(
ResourceId descriptorStore, const rdcarray<DescriptorRange> &ranges)
{
+2
View File
@@ -155,6 +155,8 @@ public:
rdcarray<SamplerDescriptor> GetSamplerDescriptors(ResourceId descriptorStore,
const rdcarray<DescriptorRange> &ranges);
rdcarray<DescriptorAccess> GetDescriptorAccess();
rdcarray<DescriptorLogicalLocation> GetDescriptorLocations(ResourceId descriptorStore,
const rdcarray<DescriptorRange> &ranges);
rdcarray<rdcstr> GetDisassemblyTargets(bool withPipeline);
rdcstr DisassembleShader(ResourceId pipeline, const ShaderReflection *refl, const rdcstr &target);
+2
View File
@@ -167,6 +167,8 @@ public:
virtual rdcarray<SamplerDescriptor> GetSamplerDescriptors(
ResourceId descriptorStore, const rdcarray<DescriptorRange> &ranges) = 0;
virtual rdcarray<DescriptorAccess> GetDescriptorAccess(uint32_t eventId) = 0;
virtual rdcarray<DescriptorLogicalLocation> GetDescriptorLocations(
ResourceId descriptorStore, const rdcarray<DescriptorRange> &ranges) = 0;
virtual FrameRecord GetFrameRecord() = 0;