]> git.tdb.fi Git - libs/gl.git/commitdiff
Offset layout qualifiers are only allowed on uniform block members
authorMikko Rasa <tdb@tdb.fi>
Mon, 5 Apr 2021 09:25:12 +0000 (12:25 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 5 Apr 2021 09:25:12 +0000 (12:25 +0300)
Same goes for the alignment qualifier.

source/glsl/validate.cpp

index 54451bcd4714f337ec114a39f016b1930ef16fa0..7e5f295f165ac3eda0993a7767b2b29fa9b6bbc5 100644 (file)
@@ -114,7 +114,9 @@ void DeclarationValidator::visit(Layout &layout)
                        }
                }
                else if(i->name=="offset")
                        }
                }
                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"));
                else if(i->name=="points")
                {
                        allowed = (stage->type==Stage::GEOMETRY && iface_layout && (iface_layout->interface=="in" || iface_layout->interface=="out"));