X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fvalidate.cpp;h=d154388f98cd9eed44aa8d16c00e1e70d09f801c;hb=3c8ce91bc0434b3a25eb919fc490c6ff8a8ed67e;hp=54451bcd4714f337ec114a39f016b1930ef16fa0;hpb=a3637962f082182d72998a35ea86e48d51e520c3;p=libs%2Fgl.git diff --git a/source/glsl/validate.cpp b/source/glsl/validate.cpp index 54451bcd..d154388f 100644 --- a/source/glsl/validate.cpp +++ b/source/glsl/validate.cpp @@ -114,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")); @@ -214,6 +216,8 @@ void DeclarationValidator::visit(VariableDeclaration &var) { if(scope==STRUCT || scope==INTERFACE_BLOCK) error(var, format("Constant qualifier not allowed on %s", descr)); + if(!var.init_expression) + error(var, "Constant variable must have an initializer"); } if(!var.interpolation.empty() || !var.sampling.empty())