diff --git a/Test/baseResults/vulkan.frag.out b/Test/baseResults/vulkan.frag.out index 1df2c3eb..0e3057eb 100644 --- a/Test/baseResults/vulkan.frag.out +++ b/Test/baseResults/vulkan.frag.out @@ -40,7 +40,8 @@ ERROR: 0:92: 'call argument' : sampler constructor must appear at point of use ERROR: 0:93: ',' : sampler constructor must appear at point of use ERROR: 0:94: ':' : wrong operand types: no operation ':' exists that takes a left-hand operand of type 'temp sampler2D' and a right operand of type 'temp sampler2D' (or there is no acceptable conversion) ERROR: 0:94: 'call argument' : sampler constructor must appear at point of use -ERROR: 38 compilation errors. No code generated. +ERROR: 0:96: 'gl_NumSamples' : undeclared identifier +ERROR: 39 compilation errors. No code generated. ERROR: Linking fragment stage: Only one push_constant block is allowed per stage diff --git a/Test/vulkan.frag b/Test/vulkan.frag index fd9106cd..16baf862 100644 --- a/Test/vulkan.frag +++ b/Test/vulkan.frag @@ -92,4 +92,6 @@ void callUserTexture() userTexture((sampler2D(t2d,s)), vTexCoord); // ERROR, not point of use userTexture((sampler2D(t2d,s), sampler2D(t2d,s)), vTexCoord); // ERROR, not point of use userTexture(cond ? sampler2D(t2d,s) : sampler2D(t2d,s), vTexCoord); // ERROR, no ?:, not point of use + + gl_NumSamples; // ERROR, not for Vulkan } diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h index f99e69a3..4d968252 100644 --- a/glslang/Include/revision.h +++ b/glslang/Include/revision.h @@ -2,5 +2,5 @@ // For the version, it uses the latest git tag followed by the number of commits. // For the date, it uses the current date (when then script is run). -#define GLSLANG_REVISION "Overload400-PrecQual.1726" +#define GLSLANG_REVISION "Overload400-PrecQual.1727" #define GLSLANG_DATE "02-Jan-2017" diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index c8739535..443cd7a3 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -3010,14 +3010,18 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "flat in int gl_PrimitiveID;" ); - if (version >= 400) + if (version >= 400) { stageBuiltins[EShLangFragment].append( "flat in int gl_SampleID;" " in vec2 gl_SamplePosition;" "flat in int gl_SampleMaskIn[];" " out int gl_SampleMask[];" - "uniform int gl_NumSamples;" ); + if (spvVersion.spv == 0) + stageBuiltins[EShLangFragment].append( + "uniform int gl_NumSamples;" + ); + } if (version >= 430) stageBuiltins[EShLangFragment].append( @@ -3074,8 +3078,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV " in mediump vec2 gl_SamplePosition;" "flat in highp int gl_SampleMaskIn[];" " out highp int gl_SampleMask[];" - "uniform lowp int gl_NumSamples;" ); + if (spvVersion.spv == 0) + stageBuiltins[EShLangFragment].append( // GL_OES_sample_variables + "uniform lowp int gl_NumSamples;" + ); } stageBuiltins[EShLangFragment].append( "highp float gl_FragDepthEXT;" // GL_EXT_frag_depth diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index bf59b81b..a5f4d8dc 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -2502,7 +2502,6 @@ void TParseContext::atomicUintCheck(const TSourceLoc& loc, const TType& type, co void TParseContext::transparentCheck(const TSourceLoc& loc, const TType& type, const TString& /*identifier*/) { - // double standard due to gl_NumSamples if (parsingBuiltins) return;