X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fvalidate.cpp;h=1d0192fea1a44faa0bde09e4888601e5d874c608;hb=fea5f2abec9b8e971d8467804f379cfcd81e9ff7;hp=7d3d20d1c78eb104c85ac8ef511a099b5115ae5e;hpb=c7d1d96540688b7a853fa69d4ca45d968755a89c;p=libs%2Fgl.git diff --git a/source/glsl/validate.cpp b/source/glsl/validate.cpp index 7d3d20d1..1d0192fe 100644 --- a/source/glsl/validate.cpp +++ b/source/glsl/validate.cpp @@ -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(get_ultimate_base_type(variable->type_declaration))) + if(!dynamic_cast(get_ultimate_base_type(var.type_declaration))) error(var, "Interface qualifier 'uniform' not allowed on non-opaque variable in global scope"); } } @@ -356,7 +356,8 @@ void IdentifierValidator::record_definition(const string &name, Statement &state void IdentifierValidator::visit(TypeDeclaration &type) { - check_definition(type.name, type); + if(type.source!=INTERNAL_SOURCE) + check_definition(type.name, type); } void IdentifierValidator::visit(StructDeclaration &strct)