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:
baldurk
2017-11-13 15:49:08 +00:00
parent d009ed3b30
commit 7c8628b237
32 changed files with 342 additions and 860 deletions
+10
View File
@@ -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);