X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fvalidate.cpp;h=54451bcd4714f337ec114a39f016b1930ef16fa0;hb=a3637962f082182d72998a35ea86e48d51e520c3;hp=889eee221b265ca98788fcd8dd73a8db22b76f64;hpb=8f5f54a9e165dae424e5b0bb8e488c3d01849bf6;p=libs%2Fgl.git diff --git a/source/glsl/validate.cpp b/source/glsl/validate.cpp index 889eee22..54451bcd 100644 --- a/source/glsl/validate.cpp +++ b/source/glsl/validate.cpp @@ -70,16 +70,26 @@ void DeclarationValidator::visit(Layout &layout) allowed = (variable && scope==GLOBAL); else if(i->name=="binding" || i->name=="set") { + if(i->name=="set") + { + error(layout, "Layout qualifier 'set' not allowed when targeting OpenGL"); + continue; + } + if(variable) { 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") {