Skip to content

Commit 60e99b7

Browse files
krystian-andrzejewskiigcbot
authored andcommitted
Exposing shader type acronyms
This change extracts shader type acronyms into a separate function.
1 parent 0b0f029 commit 60e99b7

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

IGC/common/debug/Dump.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,33 @@ namespace Debug
4747
char ModuleFlushDumpPass::ID = 0;
4848
char FunctionFlushDumpPass::ID = 0;
4949

50+
std::string GetShaderTypeAcronym(ShaderType shaderType)
51+
{
52+
switch (shaderType)
53+
{
54+
case ShaderType::OPENCL_SHADER:
55+
return "OCL";
56+
case ShaderType::PIXEL_SHADER:
57+
return "PS";
58+
case ShaderType::DOMAIN_SHADER:
59+
return "DS";
60+
case ShaderType::HULL_SHADER:
61+
return "HS";
62+
case ShaderType::VERTEX_SHADER:
63+
return "VS";
64+
case ShaderType::GEOMETRY_SHADER:
65+
return "GS";
66+
case ShaderType::COMPUTE_SHADER:
67+
return "CS"; break;
68+
case ShaderType::RAYTRACING_SHADER:
69+
return "RT"; break;
70+
case ShaderType::UNKNOWN:
71+
default:
72+
IGC_ASSERT_MESSAGE(0, "Unknown Shader Type");
73+
return "UNKNOWN";
74+
}
75+
}
76+
5077
/*************************************************************************************************\
5178
* Generic
5279
*/

IGC/common/debug/Dump.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ namespace IGC
4646
class CShader;
4747
namespace Debug
4848
{
49+
std::string GetShaderTypeAcronym(ShaderType shaderType);
4950

5051
/*************************************************************************************************\
5152
* Generic

0 commit comments

Comments
 (0)