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<BasicTypeDeclaration *>(type))
type = basic->base_type;
- allowed = (scope==GLOBAL && dynamic_cast<ImageTypeDeclaration *>(type));
- err_descr = "variable of non-opaque type";
+ bool uniform = (variable->interface=="uniform");
+ allowed = (scope==GLOBAL && uniform && dynamic_cast<ImageTypeDeclaration *>(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")
{