From: Mikko Rasa Date: Sat, 3 Apr 2021 14:12:50 +0000 (+0300) Subject: Better checking of where the binding qualifier is allowed X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=a3637962f082182d72998a35ea86e48d51e520c3;p=libs%2Fgl.git Better checking of where the binding qualifier is allowed --- diff --git a/source/glsl/validate.cpp b/source/glsl/validate.cpp index 7235e223..54451bcd 100644 --- a/source/glsl/validate.cpp +++ b/source/glsl/validate.cpp @@ -81,11 +81,15 @@ void DeclarationValidator::visit(Layout &layout) TypeDeclaration *type = variable->type_declaration; while(BasicTypeDeclaration *basic = dynamic_cast(type)) type = basic->base_type; - allowed = (scope==GLOBAL && dynamic_cast(type)); - err_descr = "variable of non-opaque type"; + bool uniform = (variable->interface=="uniform"); + allowed = (scope==GLOBAL && uniform && dynamic_cast(type)); + err_descr = (uniform ? "variable of non-opaque type" : "non-uniform variable"); } else if(iface_block) - allowed = true; + { + allowed = (iface_block->interface=="uniform"); + err_descr = "non-uniform interface block"; + } } else if(i->name=="constant_id") {