diff --git a/Install/Windows/glslangValidator.exe b/Install/Windows/glslangValidator.exe index cf9fc6a1339e382fc1a9d6c49f224bdaab42c26e..8138d0e8f0e852cf102b9c9723403e9d4a735325 100644 Binary files a/Install/Windows/glslangValidator.exe and b/Install/Windows/glslangValidator.exe differ diff --git a/Test/100.frag b/Test/100.frag index abe3ed12a793deccf3221650f1a7c4f35608540f..51e2c5f006bc1b54673d82d1be3dbe247f1874c5 100644 --- a/Test/100.frag +++ b/Test/100.frag @@ -163,4 +163,7 @@ void foo323433() textureCubeGradEXT(sCube, vec3(f13), vec3(f13), vec3(f13)); } +int fgfg(float f, mediump int i); +int fgfg(float f, highp int i); // ERROR, precision qualifier difference + uniform samplerExternalOES badExt; // syntax ERROR diff --git a/Test/300.vert b/Test/300.vert index 800ffbeed2b403ffca1560aed1f719d555bbc0bf..982becf5824198ee6cd626436d5f3ec0e4d120b0 100644 --- a/Test/300.vert +++ b/Test/300.vert @@ -127,3 +127,9 @@ void foo23() textureProjOffset(s3D, vec4(0.2), ivec3(1), .03); // ERROR, bias float x6 = textureProjGradOffset(s2DS, invIn, vec2(4.2), vec2(5.3), ivec2(1)); } + +int fgfg(float f, mediump int i); +int fgfg(float f, highp int i); // ERROR, precision qualifier difference + +int fgfgh(float f, const in mediump int i); +int fgfgh(float f, in mediump int i); // ERROR, precision qualifier difference diff --git a/Test/420.vert b/Test/420.vert index 3a2685240e58694df490f2aca3a36e6cd7738d18..28465525921f6dab886e2cb5611fae8213bf85a6 100644 --- a/Test/420.vert +++ b/Test/420.vert @@ -74,3 +74,6 @@ layout(binding = 5) uniform sampler2D sampb2[10]; layout(binding = 32) uniform sampler2D sampb3; // ERROR, binding too big layout(binding = 31) uniform sampler2D sampb4; layout(binding = 31) uniform sampler2D sampb5[2]; // ERROR, binding too big + +int fgfg(float f, mediump int i); +int fgfg(float f, highp int i); diff --git a/Test/baseResults/100.frag.out b/Test/baseResults/100.frag.out index d36e51d12bfc34b981bfec5b9e0ac9d3b1cdaf9e..7311dc5207d3269adbb683b38b461776ddb2fc4e 100644 --- a/Test/baseResults/100.frag.out +++ b/Test/baseResults/100.frag.out @@ -62,8 +62,9 @@ ERROR: 0:145: 'a' : redefinition ERROR: 0:147: 'texture2DProjGradEXT' : required extension not requested: GL_EXT_shader_texture_lod ERROR: 0:151: 'floating-point suffix' : not supported for this version or the enabled extensions ERROR: 0:152: 'floating-point suffix' : not supported for this version or the enabled extensions -ERROR: 0:166: '' : syntax error -ERROR: 57 compilation errors. No code generated. +ERROR: 0:167: 'highp' : overloaded functions must have the same parameter precision qualifiers +ERROR: 0:169: '' : syntax error +ERROR: 58 compilation errors. No code generated. ERROR: node is still EOpNull! diff --git a/Test/baseResults/120.frag.out b/Test/baseResults/120.frag.out index 6d55029a3bb801efbf9b407758b17d11215bd99f..10a7723eebf90eed843201230c078c7b3fc8ff89 100644 --- a/Test/baseResults/120.frag.out +++ b/Test/baseResults/120.frag.out @@ -26,7 +26,7 @@ ERROR: 0:91: 'main' : function already has a body ERROR: 0:91: 'int' : main function cannot return a value ERROR: 0:92: 'main' : function cannot take any parameter(s) ERROR: 0:94: 'a' : variables with qualifier 'const' must be initialized -ERROR: 0:97: 'out' : overloaded functions must have the same parameter qualifiers +ERROR: 0:97: 'out' : overloaded functions must have the same parameter storage qualifiers ERROR: 0:99: 'return' : function return is not matching type: ERROR: 0:115: 'return' : void function cannot return a value ERROR: 0:125: 'gl_TexCoord' : redeclaration of array with size diff --git a/Test/baseResults/120.vert.out b/Test/baseResults/120.vert.out index 790bb6d24f25fca078447f8726474bf3d6e472d2..7e50aa7f2c3c7daed1031f2eb906284710a28ea4 100644 --- a/Test/baseResults/120.vert.out +++ b/Test/baseResults/120.vert.out @@ -33,7 +33,7 @@ ERROR: 0:50: 'arrays of arrays' : not supported with this profile: none ERROR: 0:51: 'arrays of arrays' : not supported with this profile: none ERROR: 0:52: 'arrays of arrays' : not supported with this profile: none ERROR: 0:53: 'arrays of arrays' : not supported with this profile: none -ERROR: 0:56: 'out' : overloaded functions must have the same parameter qualifiers +ERROR: 0:56: 'out' : overloaded functions must have the same parameter storage qualifiers ERROR: 0:57: 'float' : overloaded functions must have the same return type ERROR: 0:87: 'overloadC' : no matching overloaded function found ERROR: 0:90: 'overloadC' : no matching overloaded function found diff --git a/Test/baseResults/300.vert.out b/Test/baseResults/300.vert.out index 9cb9ee75c4bfaf96be6b3bed02f710e3053f976d..60c120e9891736be1302f7f4a9677c2f0769e299 100644 --- a/Test/baseResults/300.vert.out +++ b/Test/baseResults/300.vert.out @@ -29,7 +29,9 @@ ERROR: 0:121: 'textureSize' : no matching overloaded function found ERROR: 0:123: 'textureSize' : no matching overloaded function found ERROR: 0:125: 'texture' : no matching overloaded function found ERROR: 0:127: 'textureProjOffset' : no matching overloaded function found -ERROR: 30 compilation errors. No code generated. +ERROR: 0:132: 'highp' : overloaded functions must have the same parameter precision qualifiers +ERROR: 0:135: 'in' : overloaded functions must have the same parameter storage qualifiers +ERROR: 32 compilation errors. No code generated. ERROR: node is still EOpNull! diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 34c1b44b286f26ac701827f8d907e2932eca0825..d9992915eceb75aeb1ffb559afc4363e74b133d7 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -699,7 +699,10 @@ TFunction* TParseContext::handleFunctionDeclarator(TSourceLoc loc, TFunction& fu } for (int i = 0; i < prevDec->getParamCount(); ++i) { if ((*prevDec)[i].type->getQualifier().storage != function[i].type->getQualifier().storage) - error(loc, "overloaded functions must have the same parameter qualifiers", function[i].type->getStorageQualifierString(), ""); + error(loc, "overloaded functions must have the same parameter storage qualifiers for argument", function[i].type->getStorageQualifierString(), "%d", i+1); + + if ((*prevDec)[i].type->getQualifier().precision != function[i].type->getQualifier().precision) + error(loc, "overloaded functions must have the same parameter precision qualifiers for argument", function[i].type->getPrecisionQualifierString(), "%d", i+1); } }