]> git.tdb.fi Git - libs/gl.git/commitdiff
Don't require builtin inputs to be linked
authorMikko Rasa <tdb@tdb.fi>
Sat, 13 Mar 2021 13:56:19 +0000 (15:56 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 13 Mar 2021 14:14:32 +0000 (16:14 +0200)
Many of them provide access to external values from the API.

source/glsl/validate.cpp

index 6e90698c97b500c5dd2edcaebd7e3f8c70e90026..13cb5ccb23ad15e4d6e56798552ffcd35fefd381 100644 (file)
@@ -216,7 +216,7 @@ void ReferenceValidator::visit(VariableReference &var)
 {
        if(!var.declaration)
                error(var, format("Use of undeclared variable '%s'", var.name));
-       else if(stage->type!=Stage::VERTEX && var.declaration->interface=="in" && !var.declaration->linked_declaration)
+       else if(stage->type!=Stage::VERTEX && var.declaration->interface=="in" && var.name.compare(0, 3, "gl_") && !var.declaration->linked_declaration)
                error(var, format("Use of unlinked input variable '%s'", var.name));
 }