Add debug name for PSO catching on D3D12/Vulkan during profiling incl. Development builds

This commit is contained in:
Wojtek Figat
2025-07-28 23:08:26 +02:00
parent ad6764e6d7
commit 17c0892ff1
8 changed files with 95 additions and 47 deletions

View File

@@ -75,10 +75,39 @@ GPUPipelineState::GPUPipelineState()
{
}
#if !BUILD_RELEASE
void GPUPipelineState::GetDebugName(DebugName& name) const
{
#define GET_NAME(e) \
if (DebugDesc.e) \
{ \
GPUShaderProgram::DebugName n; \
DebugDesc.e->GetDebugName(n); \
name.Add(n.Get(), n.Count() - 1); \
name.Add('+'); \
}
GET_NAME(VS);
#if GPU_ALLOW_TESSELLATION_SHADERS
GET_NAME(HS);
GET_NAME(DS);
#endif
#if GPU_ALLOW_GEOMETRY_SHADERS
GET_NAME(GS);
#endif
GET_NAME(PS);
#undef GET_NAME
if (name.Count() != 0 && name[name.Count() - 1] == '+')
name.RemoveLast();
name.Add('\0');
}
#endif
bool GPUPipelineState::Init(const Description& desc)
{
// Cache description in debug builds
#if BUILD_DEBUG
// Cache description in development builds
#if !BUILD_RELEASE
DebugDesc = desc;
#endif