mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-25 07:56:33 +00:00
Display custom glObjectLabel for shaders, programs and pipeline
This commit is contained in:
@@ -97,6 +97,20 @@ namespace renderdoc
|
||||
}
|
||||
|
||||
public ResourceId Shader;
|
||||
|
||||
[CustomMarshalAs(CustomUnmanagedType.UTF8TemplatedString)]
|
||||
public string ShaderName;
|
||||
public bool customShaderName;
|
||||
|
||||
[CustomMarshalAs(CustomUnmanagedType.UTF8TemplatedString)]
|
||||
public string ProgramName;
|
||||
public bool customProgramName;
|
||||
|
||||
public bool PipelineActive;
|
||||
[CustomMarshalAs(CustomUnmanagedType.UTF8TemplatedString)]
|
||||
public string PipelineName;
|
||||
public bool customPipelineName;
|
||||
|
||||
private IntPtr _ptr_ShaderDetails;
|
||||
[CustomMarshalAs(CustomUnmanagedType.Skip)]
|
||||
public ShaderReflection ShaderDetails;
|
||||
|
||||
@@ -282,9 +282,31 @@ namespace renderdocui.Windows.PipelineState
|
||||
var mapping = stage.BindpointMapping;
|
||||
|
||||
if (stage.Shader == ResourceId.Null)
|
||||
{
|
||||
shader.Text = "Unbound";
|
||||
}
|
||||
else
|
||||
shader.Text = stage.stage.Str(APIPipelineStateType.OpenGL) + " Shader " + stage.Shader.ToString();
|
||||
{
|
||||
string shaderName = stage.stage.Str(APIPipelineStateType.OpenGL) + " Shader";
|
||||
|
||||
if (!stage.customShaderName && !stage.customProgramName && !stage.customPipelineName)
|
||||
{
|
||||
shader.Text = shaderName + stage.Shader.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (stage.customShaderName)
|
||||
shaderName = stage.ShaderName;
|
||||
|
||||
if (stage.customProgramName)
|
||||
shaderName = stage.ProgramName + " - " + shaderName;
|
||||
|
||||
if (stage.customPipelineName && stage.PipelineActive)
|
||||
shaderName = stage.PipelineName + " - " + shaderName;
|
||||
|
||||
shader.Text = shaderName;
|
||||
}
|
||||
}
|
||||
|
||||
// disabled since entry function is always main, and filenames have no names, so this is useless.
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user