mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-08 08:40:55 +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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user