diff --git a/Test/baseResults/glspv.frag.out b/Test/baseResults/glspv.frag.out index 5622d0182652881a86310da5d079aa7e7007ad04..49398073bf29e7d3fe8785c9c075f69e5c41df24 100755 --- a/Test/baseResults/glspv.frag.out +++ b/Test/baseResults/glspv.frag.out @@ -1,9 +1,13 @@ glspv.frag ERROR: 0:4: '#error' : GL_SPIRV is set ( correct , not an error ) ERROR: 0:6: '#error' : GL_SPIR is 100 -ERROR: 0:19: 'input_attachment_index' : only allowed when using GLSL for Vulkan -ERROR: 0:19: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON -ERROR: 4 compilation errors. No code generated. +ERROR: 0:21: 'noise1' : no matching overloaded function found +ERROR: 0:22: 'noise2' : no matching overloaded function found +ERROR: 0:23: 'noise3' : no matching overloaded function found +ERROR: 0:24: 'noise4' : no matching overloaded function found +ERROR: 0:27: 'input_attachment_index' : only allowed when using GLSL for Vulkan +ERROR: 0:27: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON +ERROR: 8 compilation errors. No code generated. SPIR-V is not generated for failed compile or link diff --git a/Test/baseResults/spv.specConstant.vert.out b/Test/baseResults/spv.specConstant.vert.out index 156497b6f82f122cbbaab1c2f7172053ecd62f9c..8dda41d4951e73837b34ddf536bd53524c2ed786 100644 --- a/Test/baseResults/spv.specConstant.vert.out +++ b/Test/baseResults/spv.specConstant.vert.out @@ -11,7 +11,7 @@ spv.specConstant.vert Source GLSL 400 Name 4 "main" Name 9 "arraySize" - Name 14 "foo(vf4[s1522];" + Name 14 "foo(vf4[s1506];" Name 13 "p" Name 17 "builtin_spec_constant(" Name 20 "color" @@ -102,10 +102,10 @@ spv.specConstant.vert Store 20(color) 46 48: 10 Load 22(ucol) Store 47(param) 48 - 49: 2 FunctionCall 14(foo(vf4[s1522];) 47(param) + 49: 2 FunctionCall 14(foo(vf4[s1506];) 47(param) Return FunctionEnd -14(foo(vf4[s1522];): 2 Function None 12 +14(foo(vf4[s1506];): 2 Function None 12 13(p): 11(ptr) FunctionParameter 15: Label 54: 24(ptr) AccessChain 53(dupUcol) 23 diff --git a/Test/baseResults/vulkan.frag.out b/Test/baseResults/vulkan.frag.out index c8e1ed618a60011706d50e02b4a1402b9e3cf969..0440cf494d3734c94808a499783804e95117512b 100644 --- a/Test/baseResults/vulkan.frag.out +++ b/Test/baseResults/vulkan.frag.out @@ -39,7 +39,11 @@ 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: 0:96: 'gl_NumSamples' : undeclared identifier -ERROR: 38 compilation errors. No code generated. +ERROR: 0:101: 'noise1' : no matching overloaded function found +ERROR: 0:102: 'noise2' : no matching overloaded function found +ERROR: 0:103: 'noise3' : no matching overloaded function found +ERROR: 0:104: 'noise4' : no matching overloaded function found +ERROR: 42 compilation errors. No code generated. ERROR: Linking fragment stage: Only one push_constant block is allowed per stage diff --git a/Test/glspv.frag b/Test/glspv.frag index 008d191a35cb5828a77fa472ce8002557eba90b5..86c9f6aba64d39b316e5b98fd42e8079867da165 100644 --- a/Test/glspv.frag +++ b/Test/glspv.frag @@ -16,4 +16,12 @@ layout(location = 2) uniform float g; uniform sampler2D s1; layout(location = 3) uniform sampler2D s2; +void noise() +{ + noise1(vec4(1)); + noise2(4.0); + noise3(vec2(3)); + noise4(1); +} + layout(input_attachment_index = 1) uniform subpassInput sub; // ERROR, no inputs diff --git a/Test/vulkan.frag b/Test/vulkan.frag index 1447ec167e601f30d9502b8dd53df8b95ac1a08b..14c0c30168d42cff143e930ce8e682ba42f09c3c 100644 --- a/Test/vulkan.frag +++ b/Test/vulkan.frag @@ -95,3 +95,11 @@ void callUserTexture() gl_NumSamples; // ERROR, not for Vulkan } + +void noise() +{ + noise1(dv4); + noise2(4.0); + noise3(vec2(3)); + noise4(dv4); +} diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index c822965078824b913bcbcbcecb99f5ce4a4da973..40f46b3532bb2f3cd46fdc0f08169e34d453206b 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -1384,7 +1384,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV // // Noise functions. // - if (profile != EEsProfile) { + if (spvVersion.spv == 0 && profile != EEsProfile) { commonBuiltins.append( "float noise1(float x);" "float noise1(vec2 x);"