Expose queries for descriptor stores and D3D12 root signature range

* This will allow a UI viewer or consumer of the replay API to more easily query
  'all' descriptors for a given store.
This commit is contained in:
baldurk
2024-04-09 12:00:54 +01:00
parent 9a18e871e5
commit 153cd2aa16
26 changed files with 689 additions and 75 deletions
+4
View File
@@ -1066,6 +1066,10 @@ void CaptureContext::LoadCaptureThreaded(const QString &captureFile, const Repla
for(BufferDescription &b : m_BufferList)
m_Buffers[b.resourceId] = &b;
m_DescriptorStoreList = r->GetDescriptorStores();
for(DescriptorStoreDescription &d : m_DescriptorStoreList)
m_DescriptorStores[d.resourceId] = &d;
m_PostloadProgress = 0.8f;
m_TextureList = r->GetTextures();
+6
View File
@@ -177,6 +177,10 @@ public:
TextureDescription *GetTexture(ResourceId id) override { return m_Textures[id]; }
const rdcarray<TextureDescription> &GetTextures() override { return m_TextureList; }
BufferDescription *GetBuffer(ResourceId id) override { return m_Buffers[id]; }
DescriptorStoreDescription *GetDescriptorStore(ResourceId id) override
{
return m_DescriptorStores[id];
}
const rdcarray<BufferDescription> &GetBuffers() const override { return m_BufferList; }
const ActionDescription *GetAction(uint32_t eventId) override
{
@@ -374,6 +378,8 @@ private:
rdcarray<TextureDescription> m_TextureList;
QMap<ResourceId, BufferDescription *> m_Buffers;
rdcarray<BufferDescription> m_BufferList;
QMap<ResourceId, DescriptorStoreDescription *> m_DescriptorStores;
rdcarray<DescriptorStoreDescription> m_DescriptorStoreList;
QMap<ResourceId, ResourceDescription *> m_Resources;
rdcarray<ResourceDescription> m_ResourceList;
+28
View File
@@ -1271,6 +1271,25 @@ protected:
DECLARE_REFLECTION_STRUCT(IShaderMessageViewer);
DOCUMENT("A descriptor viewer window.");
struct IDescriptorViewer
{
DOCUMENT(R"(Retrieves the PySide2 QWidget for this :class:`DescriptorViewer` if PySide2 is available, or otherwise
returns a unique opaque pointer that can be passed back to any RenderDoc functions expecting a
QWidget.
:return: Return the widget handle, either a PySide2 handle or an opaque handle.
:rtype: QWidget
)");
virtual QWidget *Widget() = 0;
protected:
IDescriptorViewer() = default;
~IDescriptorViewer() = default;
};
DECLARE_REFLECTION_STRUCT(IDescriptorViewer);
DOCUMENT("A pixel history window.");
struct IPixelHistoryView
{
@@ -2141,6 +2160,15 @@ considered out of date
)");
virtual const rdcarray<BufferDescription> &GetBuffers() const = 0;
DOCUMENT(R"(Retrieve the information about a particular descriptor store.
:param renderdoc.ResourceId id: The ID of the buffer to query about.
:return: The information about a descriptor store, or ``None`` if the ID does not correspond to a
descriptor store.
:rtype: renderdoc.DescriptorStoreDescription
)");
virtual DescriptorStoreDescription *GetDescriptorStore(ResourceId id) = 0;
DOCUMENT(R"(Retrieve the information about an action at a given
:data:`eventId <renderdoc.APIEvent.eventId>`.
+4
View File
@@ -365,6 +365,7 @@ TEMPLATE_ARRAY_INSTANTIATE(rdcarray, ActionDescription)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, GPUCounter)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, CounterResult)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, APIEvent)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, DescriptorStoreDescription)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, BufferDescription)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, CaptureFileFormat)
TEMPLATE_ARRAY_INSTANTIATE(rdcarray, ConstantBlock)
@@ -433,6 +434,9 @@ TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, ResourceData)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, ResourceState)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, StreamOutBind)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, VertexBuffer)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, RootTableRange)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, RootParam)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, D3D12Pipe, StaticSampler)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, VertexBuffer)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, VertexAttribute)
TEMPLATE_NAMESPACE_ARRAY_INSTANTIATE(rdcarray, GLPipe, TextureCompleteness)
@@ -1136,7 +1136,7 @@ void D3D12PipelineStateViewer::setShaderState(const D3D12Pipe::Shader &stage, RD
ShaderReflection *shaderDetails = stage.reflection;
const D3D12Pipe::State &state = *m_Ctx.CurD3D12PipelineState();
rootSig->setText(ToQStr(state.rootSignatureResourceId));
rootSig->setText(ToQStr(state.rootSignature.resourceId));
QString shText = ToQStr(stage.resourceId);
+4
View File
@@ -519,6 +519,10 @@ struct CaptureContextInvoker : ObjectForwarder<ICaptureContext>
virtual TextureDescription *GetTexture(ResourceId id) override { return m_Obj.GetTexture(id); }
virtual const rdcarray<TextureDescription> &GetTextures() override { return m_Obj.GetTextures(); }
virtual BufferDescription *GetBuffer(ResourceId id) override { return m_Obj.GetBuffer(id); }
virtual DescriptorStoreDescription *GetDescriptorStore(ResourceId id) override
{
return m_Obj.GetDescriptorStore(id);
}
virtual const rdcarray<BufferDescription> &GetBuffers() const override
{
return m_Obj.GetBuffers();