Identify gl_BaseVertex/Instance and gl_DrawID as builtin parameters

This commit is contained in:
baldurk
2020-02-20 19:06:32 +00:00
parent dfbe7fb6bf
commit 2a348c3309
2 changed files with 9 additions and 0 deletions
+3
View File
@@ -620,6 +620,9 @@ rdcstr DoStringise(const ShaderBuiltin &el)
STRINGISE_ENUM_CLASS_NAMED(DepthOutput, "Depth Output");
STRINGISE_ENUM_CLASS_NAMED(DepthOutputGreaterEqual, "Depth Output (GEqual)");
STRINGISE_ENUM_CLASS_NAMED(DepthOutputLessEqual, "Depth Output (LEqual)");
STRINGISE_ENUM_CLASS_NAMED(BaseVertex, "Base Vertex");
STRINGISE_ENUM_CLASS_NAMED(BaseInstance, "Base Instance");
STRINGISE_ENUM_CLASS_NAMED(DrawIndex, "Draw Index");
STRINGISE_ENUM_CLASS_NAMED(StencilReference, "Stencil Ref Value");
STRINGISE_ENUM_CLASS_NAMED(PointCoord, "Point Co-ord");
STRINGISE_ENUM_CLASS_NAMED(IsHelper, "Is Helper");
+6
View File
@@ -2117,6 +2117,12 @@ void MakeShaderReflection(GLenum shadType, GLuint sepProg, ShaderReflection &ref
sig.systemValue = ShaderBuiltin::VertexIndex;
if(IS_BUILTIN("gl_InstanceID"))
sig.systemValue = ShaderBuiltin::InstanceIndex;
if(IS_BUILTIN("gl_BaseVertex"))
sig.systemValue = ShaderBuiltin::BaseVertex;
if(IS_BUILTIN("gl_BaseInstance"))
sig.systemValue = ShaderBuiltin::BaseInstance;
if(IS_BUILTIN("gl_DrawID"))
sig.systemValue = ShaderBuiltin::DrawIndex;
// VS built-in outputs
if(IS_BUILTIN("gl_Position"))