Merge pull request #363 from cdwfs/vertex_instance_id
Suggest gl_[Vertex,Instance]Index when gl_[Vertex,Instance]ID is encountered in Vulkan GLSL
This commit is contained in:
commit
266b1d3e84
1 changed files with 7 additions and 1 deletions
|
|
@ -1930,7 +1930,13 @@ void TParseContext::variableCheck(TIntermTyped*& nodePtr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (symbol->getType().getBasicType() == EbtVoid) {
|
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
|
// Add to symbol table to prevent future error messages on the same name
|
||||||
if (symbol->getName().size() > 0) {
|
if (symbol->getName().size() > 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue