SPV: Don't support noise*() when generating SPV.

This commit is contained in:
John Kessenich 2017-11-03 03:39:48 -06:00
parent af52799c2d
commit 2edde6665d
6 changed files with 32 additions and 8 deletions

View File

@ -1,9 +1,13 @@
glspv.frag glspv.frag
ERROR: 0:4: '#error' : GL_SPIRV is set ( correct , not an error ) ERROR: 0:4: '#error' : GL_SPIRV is set ( correct , not an error )
ERROR: 0:6: '#error' : GL_SPIR is 100 ERROR: 0:6: '#error' : GL_SPIR is 100
ERROR: 0:19: 'input_attachment_index' : only allowed when using GLSL for Vulkan ERROR: 0:21: 'noise1' : no matching overloaded function found
ERROR: 0:19: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON ERROR: 0:22: 'noise2' : no matching overloaded function found
ERROR: 4 compilation errors. No code generated. 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 SPIR-V is not generated for failed compile or link

View File

@ -11,7 +11,7 @@ spv.specConstant.vert
Source GLSL 400 Source GLSL 400
Name 4 "main" Name 4 "main"
Name 9 "arraySize" Name 9 "arraySize"
Name 14 "foo(vf4[s1522];" Name 14 "foo(vf4[s1506];"
Name 13 "p" Name 13 "p"
Name 17 "builtin_spec_constant(" Name 17 "builtin_spec_constant("
Name 20 "color" Name 20 "color"
@ -102,10 +102,10 @@ spv.specConstant.vert
Store 20(color) 46 Store 20(color) 46
48: 10 Load 22(ucol) 48: 10 Load 22(ucol)
Store 47(param) 48 Store 47(param) 48
49: 2 FunctionCall 14(foo(vf4[s1522];) 47(param) 49: 2 FunctionCall 14(foo(vf4[s1506];) 47(param)
Return Return
FunctionEnd FunctionEnd
14(foo(vf4[s1522];): 2 Function None 12 14(foo(vf4[s1506];): 2 Function None 12
13(p): 11(ptr) FunctionParameter 13(p): 11(ptr) FunctionParameter
15: Label 15: Label
54: 24(ptr) AccessChain 53(dupUcol) 23 54: 24(ptr) AccessChain 53(dupUcol) 23

View File

@ -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: ':' : 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:94: 'call argument' : sampler constructor must appear at point of use
ERROR: 0:96: 'gl_NumSamples' : undeclared identifier 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 ERROR: Linking fragment stage: Only one push_constant block is allowed per stage

View File

@ -16,4 +16,12 @@ layout(location = 2) uniform float g;
uniform sampler2D s1; uniform sampler2D s1;
layout(location = 3) uniform sampler2D s2; 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 layout(input_attachment_index = 1) uniform subpassInput sub; // ERROR, no inputs

View File

@ -95,3 +95,11 @@ void callUserTexture()
gl_NumSamples; // ERROR, not for Vulkan gl_NumSamples; // ERROR, not for Vulkan
} }
void noise()
{
noise1(dv4);
noise2(4.0);
noise3(vec2(3));
noise4(dv4);
}

View File

@ -1384,7 +1384,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
// //
// Noise functions. // Noise functions.
// //
if (profile != EEsProfile) { if (spvVersion.spv == 0 && profile != EEsProfile) {
commonBuiltins.append( commonBuiltins.append(
"float noise1(float x);" "float noise1(float x);"
"float noise1(vec2 x);" "float noise1(vec2 x);"