From a3637962f082182d72998a35ea86e48d51e520c3 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 3 Apr 2021 17:12:50 +0300 Subject: [PATCH] Better checking of where the binding qualifier is allowed --- source/glsl/validate.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/glsl/validate.cpp b/source/glsl/validate.cpp index 7235e223..54451bcd 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") { -- 2.45.2