From 674014bfc4a4ee12de25b26eb2b0206be65bd8c2 Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Thu, 24 Jan 2013 22:37:46 +0000 Subject: [PATCH] Fix: version 100 does not accept the 'es' profile git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20316 e7fa87d3-cd2b-0410-9028-fcbf551c1848 --- glslang/MachineIndependent/glslang.l | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/glslang/MachineIndependent/glslang.l b/glslang/MachineIndependent/glslang.l index 7b05463e..dd98d4e4 100644 --- a/glslang/MachineIndependent/glslang.l +++ b/glslang/MachineIndependent/glslang.l @@ -743,22 +743,28 @@ void SetProfile(EProfile profile) TParseContext& parseContext = *((TParseContext *)cpp->pC); if (profile == ENoProfile) { - if (parseContext.version == 100 || parseContext.version == 300) { - CPPErrorToInfoLog("versions 100 and 300 require specifying the es profile"); + if (parseContext.version == 300) { + CPPErrorToInfoLog("version 300 requires specifying the 'es' profile"); parseContext.profile = ENoProfile; } else if (parseContext.version >= FirstProfileVersion) parseContext.profile = ECoreProfile; else parseContext.profile = ENoProfile; - } else { + } else { // a profile was provided... - if (parseContext.version == 100 || parseContext.version == 300) { + if (parseContext.version < 150) { + CPPErrorToInfoLog("versions before 150 do not allow a profile token"); + if (parseContext.version == 100) + parseContext.profile = EEsProfile; + else + parseContext.profile = ENoProfile; + } else if (parseContext.version == 300) { if (profile != EEsProfile) - CPPErrorToInfoLog("versions 100 and 300 only support the es profile"); + CPPErrorToInfoLog("only version 300 supports the es profile"); parseContext.profile = EEsProfile; } else { if (profile == EEsProfile) { - CPPErrorToInfoLog("only versions 100 and 300 support the es profile"); + CPPErrorToInfoLog("only version 300 supports the es profile"); if (parseContext.version >= FirstProfileVersion) parseContext.profile = ECoreProfile; else