diff --git a/Test/100.frag b/Test/100.frag index d6e62a0c..1b7f0d0e 100644 --- a/Test/100.frag +++ b/Test/100.frag @@ -1,7 +1,7 @@ // okay #version 100 int a[3] = { 2, 3, 4, }; // ERROR - +#version 100 int uint; attribute vec4 v[3]; // ERROR diff --git a/Test/420.vert b/Test/420.vert index 28465525..b9ead7f1 100644 --- a/Test/420.vert +++ b/Test/420.vert @@ -1,5 +1,5 @@ #version 420 core - +#version 420 core varying vec2 v2; // ERROR, varying reserved in vec4 bad[10]; highp in vec4 badorder; diff --git a/Test/baseResults/100.frag.out b/Test/baseResults/100.frag.out index 83a7ce14..bd7716fe 100644 --- a/Test/baseResults/100.frag.out +++ b/Test/baseResults/100.frag.out @@ -2,6 +2,7 @@ ERROR: 0:3: '{ } style initializers' : not supported with this profile: es ERROR: 0:3: 'initializer' : not supported for this version or the enabled extensions ERROR: 0:3: 'array initializer' : not supported for this version or the enabled extensions +ERROR: 0:4: '#version' : must occur first in shader ERROR: 0:7: 'attribute' : not supported in this stage: fragment ERROR: 0:7: 'float' : type requires declaration of default precision qualifier ERROR: 0:9: '=' : cannot convert from 'const int' to 'mediump float' @@ -66,7 +67,7 @@ ERROR: 0:167: 'highp' : overloaded functions must have the same parameter precis ERROR: 0:170: 'multiple prototypes for same function' : not supported for this version or the enabled extensions ERROR: 0:177: 'multiple prototypes for same function' : not supported for this version or the enabled extensions ERROR: 0:179: '' : syntax error -ERROR: 60 compilation errors. No code generated. +ERROR: 61 compilation errors. No code generated. ERROR: node is still EOpNull! diff --git a/Test/baseResults/420.vert.out b/Test/baseResults/420.vert.out index 51049074..494a9bda 100644 --- a/Test/baseResults/420.vert.out +++ b/Test/baseResults/420.vert.out @@ -1,5 +1,6 @@ 420.vert Warning, version 420 is not yet complete; some version-specific features are present, but many are missing. +ERROR: 0:2: '#version' : must occur first in shader WARNING: 0:3: varying deprecated in version 130; may be removed in future release ERROR: 0:3: 'varying' : no longer supported in core profile; removed in version 420 ERROR: 0:7: '' : vertex input cannot be further qualified @@ -27,7 +28,7 @@ ERROR: 0:70: 'binding' : requires uniform or buffer storage qualifier ERROR: 0:71: 'binding' : binding is too large ERROR: 0:74: 'binding' : sampler binding not less than gl_MaxCombinedTextureImageUnits ERROR: 0:76: 'binding' : sampler binding not less than gl_MaxCombinedTextureImageUnits (using array) -ERROR: 26 compilation errors. No code generated. +ERROR: 27 compilation errors. No code generated. ERROR: node is still EOpNull! diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h index e748cfe2..77e51ba2 100644 --- a/glslang/Include/revision.h +++ b/glslang/Include/revision.h @@ -9,5 +9,5 @@ // source have to figure out how to create revision.h just to get a build // going. However, if it is not updated, it can be a version behind. -#define GLSLANG_REVISION "24342" -#define GLSLANG_DATE "2013/12/04 12:43:05" +#define GLSLANG_REVISION "24343" +#define GLSLANG_DATE "2013/12/04 12:46:19" diff --git a/glslang/MachineIndependent/preprocessor/Pp.cpp b/glslang/MachineIndependent/preprocessor/Pp.cpp index 5974aeb8..785cbfc1 100644 --- a/glslang/MachineIndependent/preprocessor/Pp.cpp +++ b/glslang/MachineIndependent/preprocessor/Pp.cpp @@ -694,8 +694,9 @@ int TPpContext::CPPversion(TPpToken* ppToken) { int token = currentInput->scan(this, currentInput, ppToken); - if (errorOnVersion) + if (errorOnVersion || versionSeen) parseContext.error(ppToken->loc, "must occur first in shader", "#version", ""); + versionSeen = true; if (token == '\n') { parseContext.error(ppToken->loc, "must be followed by version number", "#version", ""); diff --git a/glslang/MachineIndependent/preprocessor/PpContext.cpp b/glslang/MachineIndependent/preprocessor/PpContext.cpp index 58a0e01c..f7b7a751 100644 --- a/glslang/MachineIndependent/preprocessor/PpContext.cpp +++ b/glslang/MachineIndependent/preprocessor/PpContext.cpp @@ -155,6 +155,7 @@ void TPpContext::setInput(TInputScanner& input, bool versionWillBeError) in->prev = currentInput; currentInput = in; errorOnVersion = versionWillBeError; + versionSeen = false; } } // end namespace glslang diff --git a/glslang/MachineIndependent/preprocessor/PpContext.h b/glslang/MachineIndependent/preprocessor/PpContext.h index cf9ac8a6..8ea44992 100644 --- a/glslang/MachineIndependent/preprocessor/PpContext.h +++ b/glslang/MachineIndependent/preprocessor/PpContext.h @@ -208,6 +208,7 @@ protected: InputSrc *currentInput; bool errorOnVersion; + bool versionSeen; // // from Pp.cpp