mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-10-05 03:48:01 +00:00
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:
@@ -280,6 +280,11 @@ public:
|
||||
return ret;
|
||||
}
|
||||
rdcarray<DescriptorAccess> GetDescriptorAccess(uint32_t eventId) { return {}; }
|
||||
rdcarray<DescriptorLogicalLocation> GetDescriptorLocations(ResourceId descriptorStore,
|
||||
const rdcarray<DescriptorRange> &ranges)
|
||||
{
|
||||
return {};
|
||||
}
|
||||
DriverInformation GetDriverInfo()
|
||||
{
|
||||
DriverInformation ret = {};
|
||||
|
||||
@@ -101,6 +101,7 @@ rdcstr DoStringise(const ReplayProxyPacket &el)
|
||||
STRINGISE_ENUM_NAMED(eReplayProxy_GetDescriptors, "GetDescriptors");
|
||||
STRINGISE_ENUM_NAMED(eReplayProxy_GetSamplerDescriptors, "GetSamplerDescriptors");
|
||||
STRINGISE_ENUM_NAMED(eReplayProxy_GetDescriptorAccess, "GetDescriptorAccess");
|
||||
STRINGISE_ENUM_NAMED(eReplayProxy_GetDescriptorLocations, "GetDescriptorLocations");
|
||||
}
|
||||
END_ENUM_STRINGISE();
|
||||
}
|
||||
@@ -1938,6 +1939,39 @@ rdcarray<DescriptorAccess> ReplayProxy::GetDescriptorAccess(uint32_t eventId)
|
||||
PROXY_FUNCTION(GetDescriptorAccess, eventId);
|
||||
}
|
||||
|
||||
template <typename ParamSerialiser, typename ReturnSerialiser>
|
||||
rdcarray<DescriptorLogicalLocation> ReplayProxy::Proxied_GetDescriptorLocations(
|
||||
ParamSerialiser ¶mser, ReturnSerialiser &retser, ResourceId descriptorStore,
|
||||
const rdcarray<DescriptorRange> &ranges)
|
||||
{
|
||||
const ReplayProxyPacket expectedPacket = eReplayProxy_GetDescriptorLocations;
|
||||
ReplayProxyPacket packet = eReplayProxy_GetDescriptorLocations;
|
||||
rdcarray<DescriptorLogicalLocation> ret;
|
||||
|
||||
{
|
||||
BEGIN_PARAMS();
|
||||
SERIALISE_ELEMENT(descriptorStore);
|
||||
SERIALISE_ELEMENT(ranges);
|
||||
END_PARAMS();
|
||||
}
|
||||
|
||||
{
|
||||
REMOTE_EXECUTION();
|
||||
if(paramser.IsReading() && !paramser.IsErrored() && !m_IsErrored)
|
||||
ret = m_Remote->GetDescriptorLocations(descriptorStore, ranges);
|
||||
}
|
||||
|
||||
SERIALISE_RETURN(ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
rdcarray<DescriptorLogicalLocation> ReplayProxy::GetDescriptorLocations(
|
||||
ResourceId descriptorStore, const rdcarray<DescriptorRange> &ranges)
|
||||
{
|
||||
PROXY_FUNCTION(GetDescriptorLocations, descriptorStore, ranges);
|
||||
}
|
||||
|
||||
template <typename ParamSerialiser, typename ReturnSerialiser>
|
||||
void ReplayProxy::Proxied_ReplayLog(ParamSerialiser ¶mser, ReturnSerialiser &retser,
|
||||
uint32_t endEventID, ReplayLogType replayType)
|
||||
@@ -3011,6 +3045,7 @@ bool ReplayProxy::Tick(int type)
|
||||
case eReplayProxy_GetDescriptors: GetDescriptors(ResourceId(), {}); break;
|
||||
case eReplayProxy_GetSamplerDescriptors: GetSamplerDescriptors(ResourceId(), {}); break;
|
||||
case eReplayProxy_GetDescriptorAccess: GetDescriptorAccess(0); break;
|
||||
case eReplayProxy_GetDescriptorLocations: GetDescriptorLocations(ResourceId(), {}); break;
|
||||
case eReplayProxy_GetUsage: GetUsage(ResourceId()); break;
|
||||
case eReplayProxy_GetLiveID: GetLiveID(ResourceId()); break;
|
||||
case eReplayProxy_GetFrameRecord: GetFrameRecord(); break;
|
||||
|
||||
@@ -109,6 +109,7 @@ enum ReplayProxyPacket
|
||||
eReplayProxy_GetDescriptors,
|
||||
eReplayProxy_GetSamplerDescriptors,
|
||||
eReplayProxy_GetDescriptorAccess,
|
||||
eReplayProxy_GetDescriptorLocations,
|
||||
};
|
||||
|
||||
DECLARE_REFLECTION_ENUM(ReplayProxyPacket);
|
||||
@@ -487,6 +488,8 @@ public:
|
||||
IMPLEMENT_FUNCTION_PROXIED(rdcarray<SamplerDescriptor>, GetSamplerDescriptors,
|
||||
ResourceId descriptorStore, const rdcarray<DescriptorRange> &ranges);
|
||||
IMPLEMENT_FUNCTION_PROXIED(rdcarray<DescriptorAccess>, GetDescriptorAccess, uint32_t eventId);
|
||||
IMPLEMENT_FUNCTION_PROXIED(rdcarray<DescriptorLogicalLocation>, GetDescriptorLocations,
|
||||
ResourceId descriptorStore, const rdcarray<DescriptorRange> &ranges);
|
||||
|
||||
IMPLEMENT_FUNCTION_PROXIED(rdcarray<uint32_t>, GetPassEvents, uint32_t eventId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user