From: Mikko Rasa Date: Sun, 7 Nov 2021 09:21:35 +0000 (+0200) Subject: Disallow bool variables in shader interface blocks X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=f4460c27a4d19ffb34017b92389420adad44d051 Disallow bool variables in shader interface blocks Although OpenGL allows them in uniform blocks, SPIR-V says they can't be used with externally visible storage classes. --- diff --git a/source/glsl/validate.cpp b/source/glsl/validate.cpp index 0c4b98cb..ec322f42 100644 --- a/source/glsl/validate.cpp +++ b/source/glsl/validate.cpp @@ -254,8 +254,13 @@ void DeclarationValidator::visit(VariableDeclaration &var) } else if(kind==BasicTypeDeclaration::VOID) error(var, "Type 'void' not allowed on variable"); - else if(kind==BasicTypeDeclaration::BOOL && !var.interface.empty() && var.source!=BUILTIN_SOURCE) - error(var, "Type 'bool' not allowed on interface variable"); + else if(kind==BasicTypeDeclaration::BOOL && var.source!=BUILTIN_SOURCE) + { + if(scope==INTERFACE_BLOCK) + error(var, "Type 'bool' not allowed in an interface block"); + else if(!var.interface.empty()) + error(var, "Type 'bool' not allowed on interface variable"); + } if(var.init_expression) {