From: Mikko Rasa Date: Mon, 5 Apr 2021 09:25:12 +0000 (+0300) Subject: Offset layout qualifiers are only allowed on uniform block members X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=d3a41542c4982d6df08b5e6f969267f9c8889f9f Offset layout qualifiers are only allowed on uniform block members Same goes for the alignment qualifier. --- diff --git a/source/glsl/validate.cpp b/source/glsl/validate.cpp index 54451bcd..7e5f295f 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"));