mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 09:30:44 +00:00
Centralise resource naming with capture context to allow customisation
* We remove the now unneeded name fields in buffer/texture descriptions and some of the pipeline state structs. * A single function will give the human-readable name for a resource id. This will look up a custom set of renames, on top of the names from the resource descriptions.
This commit is contained in:
@@ -82,6 +82,12 @@ struct CaptureContextInvoker : ICaptureContext
|
||||
{
|
||||
return m_Ctx.GetResources();
|
||||
}
|
||||
virtual QString GetResourceName(ResourceId id) override { return m_Ctx.GetResourceName(id); }
|
||||
virtual bool IsAutogeneratedName(ResourceId id) override { return m_Ctx.IsAutogeneratedName(id); }
|
||||
virtual bool HasResourceCustomName(ResourceId id) override
|
||||
{
|
||||
return m_Ctx.HasResourceCustomName(id);
|
||||
}
|
||||
virtual TextureDescription *GetTexture(ResourceId id) override { return m_Ctx.GetTexture(id); }
|
||||
virtual const rdcarray<TextureDescription> &GetTextures() override { return m_Ctx.GetTextures(); }
|
||||
virtual BufferDescription *GetBuffer(ResourceId id) override { return m_Ctx.GetBuffer(id); }
|
||||
@@ -170,6 +176,10 @@ struct CaptureContextInvoker : ICaptureContext
|
||||
{
|
||||
InvokeVoidFunction(&ICaptureContext::AddMessages, msgs);
|
||||
}
|
||||
virtual void SetResourceCustomName(ResourceId id, const QString &name) override
|
||||
{
|
||||
InvokeVoidFunction(&ICaptureContext::SetResourceCustomName, id, name);
|
||||
}
|
||||
virtual IMainWindow *GetMainWindow() override
|
||||
{
|
||||
return InvokeRetFunction<IMainWindow *>(&ICaptureContext::GetMainWindow);
|
||||
|
||||
Reference in New Issue
Block a user