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
+2 -12
View File
@@ -327,23 +327,13 @@ void ConstantBufferPreviewer::setVariables(const rdcarray<ShaderVariable> &vars)
void ConstantBufferPreviewer::updateLabels()
{
QString bufName;
bool needName = true;
BufferDescription *buf = m_Ctx.GetBuffer(m_cbuffer);
if(buf)
{
bufName = buf->name;
if(buf->customName)
needName = false;
}
QString bufName = m_Ctx.GetResourceName(m_cbuffer);
const ShaderReflection *reflection = m_Ctx.CurPipelineState().GetShaderReflection(m_stage);
if(reflection != NULL)
{
if(needName && m_slot < reflection->ConstantBlocks.size() &&
if(m_Ctx.IsAutogeneratedName(m_cbuffer) && m_slot < reflection->ConstantBlocks.size() &&
!reflection->ConstantBlocks[m_slot].name.isEmpty())
bufName = QFormatStr("<%1>").arg(reflection->ConstantBlocks[m_slot].name);
}