X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fvalidate.cpp;h=7e5f295f165ac3eda0993a7767b2b29fa9b6bbc5;hb=d3a41542c4982d6df08b5e6f969267f9c8889f9f;hp=7235e2237a81493fec5f31352874bc5ebc2e7f41;hpb=a8472c4fc8bce5db0d50d920f9c4159bda631e30;p=libs%2Fgl.git diff --git a/source/glsl/validate.cpp b/source/glsl/validate.cpp index 7235e223..7e5f295f 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") { @@ -110,7 +114,9 @@ void DeclarationValidator::visit(Layout &layout) } } else if(i->name=="offset") - allowed = (variable && scope==INTERFACE_BLOCK); + allowed = (variable && scope==INTERFACE_BLOCK && iface_block->interface=="uniform"); + else if(i->name=="align") + allowed = (scope==INTERFACE_BLOCK && iface_block->interface=="uniform"); else if(i->name=="points") { allowed = (stage->type==Stage::GEOMETRY && iface_layout && (iface_layout->interface=="in" || iface_layout->interface=="out"));