From d3a41542c4982d6df08b5e6f969267f9c8889f9f Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 5 Apr 2021 12:25:12 +0300 Subject: [PATCH] Offset layout qualifiers are only allowed on uniform block members Same goes for the alignment qualifier. --- source/glsl/validate.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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")); -- 2.45.2