diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index fe22ff80b02cc4c46b09c800a5c3c3561995c015..b01d773f8b67ee275919d0921c8dd44dd807610b 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -1930,7 +1930,13 @@ void TParseContext::variableCheck(TIntermTyped*& nodePtr) return; if (symbol->getType().getBasicType() == EbtVoid) { - error(symbol->getLoc(), "undeclared identifier", symbol->getName().c_str(), ""); + const char *extraInfoFormat = ""; + if (spvVersion.vulkan != 0 && symbol->getName() == "gl_VertexID") { + extraInfoFormat = "(Did you mean gl_VertexIndex?)"; + } else if (spvVersion.vulkan != 0 && symbol->getName() == "gl_InstanceID") { + extraInfoFormat = "(Did you mean gl_InstanceIndex?)"; + } + error(symbol->getLoc(), "undeclared identifier", symbol->getName().c_str(), extraInfoFormat); // Add to symbol table to prevent future error messages on the same name if (symbol->getName().size() > 0) {