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")
{