From 4751ce3fc1e2db8373ca82ef5b9c6d1fb6230cc7 Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Thu, 11 Jun 2015 16:39:01 +0000 Subject: [PATCH] glslang front-end: Support relaxed error checking for bug 13724 "...initializer must be a constant expression..." because that change breaks existing shipping applications. (Normal validation for portability testing still gives an error.) git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31475 e7fa87d3-cd2b-0410-9028-fcbf551c1848 --- glslang/MachineIndependent/ParseHelper.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 69a13633..6a311de3 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -4160,7 +4160,10 @@ TIntermNode* TParseContext::executeInitializer(TSourceLoc loc, TIntermTyped* ini // qualifier any initializer must be a constant expression." if (symbolTable.atGlobalLevel() && initializer->getType().getQualifier().storage != EvqConst) { const char* initFeature = "non-constant global initializer"; - requireProfile(loc, ~EEsProfile, initFeature); + if (messages & EShMsgRelaxedErrors) + warn(loc, "not allowed in this version", initFeature, ""); + else + requireProfile(loc, ~EEsProfile, initFeature); } }