]> git.tdb.fi Git - libs/gl.git/commitdiff
Use correct variable to access values
authorMikko Rasa <tdb@tdb.fi>
Sat, 27 Nov 2021 10:58:18 +0000 (12:58 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 27 Nov 2021 18:02:48 +0000 (20:02 +0200)
source/glsl/validate.cpp

index e9a8bb3b1978279c4dc3a5ec2512326f8ec752bd..1d0192fea1a44faa0bde09e4888601e5d874c608 100644 (file)
@@ -254,9 +254,9 @@ void DeclarationValidator::visit(VariableDeclaration &var)
                        error(var, format("Mismatched interface qualifier '%s' inside '%s' block", var.interface, iface_block->interface));
                else if(scope==STRUCT || scope==FUNCTION)
                        error(var, format("Interface qualifier not allowed on %s", descr));
-               else if(scope==GLOBAL && variable->interface=="uniform" && features.target_api==VULKAN)
+               else if(scope==GLOBAL && var.interface=="uniform" && !var.block_declaration && features.target_api==VULKAN)
                {
-                       if(!dynamic_cast<const ImageTypeDeclaration *>(get_ultimate_base_type(variable->type_declaration)))
+                       if(!dynamic_cast<const ImageTypeDeclaration *>(get_ultimate_base_type(var.type_declaration)))
                                error(var, "Interface qualifier 'uniform' not allowed on non-opaque variable in global scope");
                }
        }