From 09709c152176e025102277f9def760eba5841a57 Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Mon, 11 Nov 2013 23:51:57 +0000 Subject: [PATCH] Don't allow invariant in a function. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24009 e7fa87d3-cd2b-0410-9028-fcbf551c1848 --- Test/baseResults/100.frag.out | 5 ++++- glslang/MachineIndependent/glslang.y | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Test/baseResults/100.frag.out b/Test/baseResults/100.frag.out index 07dc9871..49a0847d 100644 --- a/Test/baseResults/100.frag.out +++ b/Test/baseResults/100.frag.out @@ -24,10 +24,13 @@ ERROR: 0:47: 'invariant' : can only apply to an output or an input in a non-vert ERROR: 0:50: 'invariant' : can only apply to an output or an input in a non-vertex stage +ERROR: 0:56: 'invariant' : not allowed in nested scope ERROR: 0:56: 'invariant' : can only apply to an output or an input in a non-vertex stage +ERROR: 0:57: 'invariant' : not allowed in nested scope ERROR: 0:57: 'invariant' : can only apply to an output or an input in a non-vertex stage +ERROR: 0:59: 'invariant' : not allowed in nested scope ERROR: 0:59: 'invariant' : can only apply to an output or an input in a non-vertex stage ERROR: 0:63: 'invariant' : can only apply to an output or an input in a non-vertex stage @@ -51,7 +54,7 @@ ERROR: 0:111: 'gl_FragDepth' : undeclared identifier ERROR: 0:134: 'texture3D' : no matching overloaded function found ERROR: 0:135: 'texture2DProjLod' : no matching overloaded function found ERROR: 0:140: '' : syntax error -ERROR: 46 compilation errors. No code generated. +ERROR: 49 compilation errors. No code generated. ERROR: node is still EOpNull! 0:3 Sequence diff --git a/glslang/MachineIndependent/glslang.y b/glslang/MachineIndependent/glslang.y index de5438b2..1e9cef2d 100644 --- a/glslang/MachineIndependent/glslang.y +++ b/glslang/MachineIndependent/glslang.y @@ -1059,6 +1059,7 @@ fully_specified_type invariant_qualifier : INVARIANT { + parseContext.globalCheck($1.loc, "invariant"); parseContext.profileRequires($$.loc, ENoProfile, 120, 0, "invariant"); $$.init($1.loc); $$.qualifier.invariant = true;