GLSL/SPV: Implement SPV_EXT_descriptor_indexing and GL_EXT_nonuniform_qualifier

This commit is contained in:
John Kessenich
2018-04-05 11:25:02 -06:00
parent 0b5e5da7e7
commit 5611c6d27b
31 changed files with 5887 additions and 4668 deletions

18
Test/310runtimeArray.vert Normal file
View File

@@ -0,0 +1,18 @@
#version 310 es
precision highp float;
layout(location=0) out float o;
struct S { float f; };
buffer b1 { S s[]; };
buffer b2 { S s[]; } b2name;
buffer b3 { S s[]; } b3name[];
buffer b4 { S s[]; } b4name[4];
void main()
{
o = s[5].f;
o += b2name.s[6].f;
o += b3name[3].s[7].f;
o += b4name[2].s[8].f;
}

View File

@@ -0,0 +1,145 @@
310runtimeArray.vert
ERROR: 0:9: '' : array size required
ERROR: 1 compilation errors. No code generated.
Shader version: 310
ERROR: node is still EOpNull!
0:12 Function Definition: main( ( global void)
0:12 Function Parameters:
0:14 Sequence
0:14 move second child to first child ( temp highp float)
0:14 'o' (layout( location=0) smooth out highp float)
0:14 f: direct index for structure ( global highp float)
0:14 direct index (layout( column_major shared) temp structure{ global highp float f})
0:14 s: direct index for structure (layout( column_major shared) buffer unsized 6-element array of structure{ global highp float f})
0:14 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 6-element array of structure{ global highp float f} s})
0:14 Constant:
0:14 0 (const uint)
0:14 Constant:
0:14 5 (const int)
0:14 Constant:
0:14 0 (const int)
0:15 add second child into first child ( temp highp float)
0:15 'o' (layout( location=0) smooth out highp float)
0:15 f: direct index for structure ( global highp float)
0:15 direct index (layout( column_major shared) temp structure{ global highp float f})
0:15 s: direct index for structure (layout( column_major shared) buffer unsized 7-element array of structure{ global highp float f})
0:15 'b2name' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 7-element array of structure{ global highp float f} s})
0:15 Constant:
0:15 0 (const int)
0:15 Constant:
0:15 6 (const int)
0:15 Constant:
0:15 0 (const int)
0:16 add second child into first child ( temp highp float)
0:16 'o' (layout( location=0) smooth out highp float)
0:16 f: direct index for structure ( global highp float)
0:16 direct index (layout( column_major shared) temp structure{ global highp float f})
0:16 s: direct index for structure (layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f})
0:16 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f} s})
0:16 'b3name' (layout( column_major shared) buffer unsized 4-element array of block{layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f} s})
0:16 Constant:
0:16 3 (const int)
0:16 Constant:
0:16 0 (const int)
0:16 Constant:
0:16 7 (const int)
0:16 Constant:
0:16 0 (const int)
0:17 add second child into first child ( temp highp float)
0:17 'o' (layout( location=0) smooth out highp float)
0:17 f: direct index for structure ( global highp float)
0:17 direct index (layout( column_major shared) temp structure{ global highp float f})
0:17 s: direct index for structure (layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f})
0:17 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f} s})
0:17 'b4name' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f} s})
0:17 Constant:
0:17 2 (const int)
0:17 Constant:
0:17 0 (const int)
0:17 Constant:
0:17 8 (const int)
0:17 Constant:
0:17 0 (const int)
0:? Linker Objects
0:? 'o' (layout( location=0) smooth out highp float)
0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 6-element array of structure{ global highp float f} s})
0:? 'b2name' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 7-element array of structure{ global highp float f} s})
0:? 'b3name' (layout( column_major shared) buffer unsized 4-element array of block{layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f} s})
0:? 'b4name' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f} s})
0:? 'gl_VertexID' ( gl_VertexId highp int VertexId)
0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId)
Linked vertex stage:
Shader version: 310
ERROR: node is still EOpNull!
0:12 Function Definition: main( ( global void)
0:12 Function Parameters:
0:14 Sequence
0:14 move second child to first child ( temp highp float)
0:14 'o' (layout( location=0) smooth out highp float)
0:14 f: direct index for structure ( global highp float)
0:14 direct index (layout( column_major shared) temp structure{ global highp float f})
0:14 s: direct index for structure (layout( column_major shared) buffer unsized 6-element array of structure{ global highp float f})
0:14 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 6-element array of structure{ global highp float f} s})
0:14 Constant:
0:14 0 (const uint)
0:14 Constant:
0:14 5 (const int)
0:14 Constant:
0:14 0 (const int)
0:15 add second child into first child ( temp highp float)
0:15 'o' (layout( location=0) smooth out highp float)
0:15 f: direct index for structure ( global highp float)
0:15 direct index (layout( column_major shared) temp structure{ global highp float f})
0:15 s: direct index for structure (layout( column_major shared) buffer unsized 7-element array of structure{ global highp float f})
0:15 'b2name' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 7-element array of structure{ global highp float f} s})
0:15 Constant:
0:15 0 (const int)
0:15 Constant:
0:15 6 (const int)
0:15 Constant:
0:15 0 (const int)
0:16 add second child into first child ( temp highp float)
0:16 'o' (layout( location=0) smooth out highp float)
0:16 f: direct index for structure ( global highp float)
0:16 direct index (layout( column_major shared) temp structure{ global highp float f})
0:16 s: direct index for structure (layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f})
0:16 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f} s})
0:16 'b3name' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f} s})
0:16 Constant:
0:16 3 (const int)
0:16 Constant:
0:16 0 (const int)
0:16 Constant:
0:16 7 (const int)
0:16 Constant:
0:16 0 (const int)
0:17 add second child into first child ( temp highp float)
0:17 'o' (layout( location=0) smooth out highp float)
0:17 f: direct index for structure ( global highp float)
0:17 direct index (layout( column_major shared) temp structure{ global highp float f})
0:17 s: direct index for structure (layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f})
0:17 direct index (layout( column_major shared) temp block{layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f} s})
0:17 'b4name' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f} s})
0:17 Constant:
0:17 2 (const int)
0:17 Constant:
0:17 0 (const int)
0:17 Constant:
0:17 8 (const int)
0:17 Constant:
0:17 0 (const int)
0:? Linker Objects
0:? 'o' (layout( location=0) smooth out highp float)
0:? 'anon@0' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 6-element array of structure{ global highp float f} s})
0:? 'b2name' (layout( column_major shared) buffer block{layout( column_major shared) buffer unsized 7-element array of structure{ global highp float f} s})
0:? 'b3name' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer unsized 8-element array of structure{ global highp float f} s})
0:? 'b4name' (layout( column_major shared) buffer 4-element array of block{layout( column_major shared) buffer unsized 9-element array of structure{ global highp float f} s})
0:? 'gl_VertexID' ( gl_VertexId highp int VertexId)
0:? 'gl_InstanceID' ( gl_InstanceId highp int InstanceId)

View File

@@ -51,7 +51,7 @@ ERROR: 0:157: 'textureQueryLevels' : no matching overloaded function found
ERROR: 0:157: 'assign' : cannot convert from ' const float' to ' temp int'
ERROR: 0:158: 'textureQueryLevels' : no matching overloaded function found
ERROR: 0:158: 'assign' : cannot convert from ' const float' to ' temp int'
WARNING: 0:161: '[]' : assuming array size of one for compile-time checking of binding numbers for unsized array
WARNING: 0:161: '[]' : assuming binding count of one for compile-time checking of binding numbers for unsized array
ERROR: 51 compilation errors. No code generated.

View File

@@ -25,7 +25,7 @@ ERROR: 0:101: '[' : array index out of range '5'
ERROR: 0:104: 'constructor' : array constructor must have at least one argument
ERROR: 0:104: '=' : cannot convert from ' const float' to ' global unsized 1-element array of int'
ERROR: 0:106: 'constructor' : array argument must be sized
ERROR: 0:111: '[' : array must be redeclared with a size before being indexed with a variable
ERROR: 0:111: 'variable index' : required extension not requested: GL_EXT_nonuniform_qualifier
ERROR: 0:111: 'variable indexing sampler array' : not supported with this profile: none
ERROR: 28 compilation errors. No code generated.

View File

@@ -0,0 +1,92 @@
nonuniform.frag
ERROR: 0:10: 'nonuniformEXT' : for non-parameter, can only apply to 'in' or no storage qualifier
ERROR: 0:11: 'nonuniformEXT' : for non-parameter, can only apply to 'in' or no storage qualifier
ERROR: 0:12: 'nonuniformEXT' : for non-parameter, can only apply to 'in' or no storage qualifier
ERROR: 0:22: 'nonuniformEXT' : for non-parameter, can only apply to 'in' or no storage qualifier
ERROR: 0:28: 'constructor' : too many arguments
ERROR: 0:28: 'assign' : cannot convert from ' const float' to ' nonuniform temp int'
ERROR: 0:29: 'constructor' : not enough data provided for construction
ERROR: 0:29: 'assign' : cannot convert from ' const float' to ' nonuniform temp int'
ERROR: 0:32: 'nonuniformEXT' : not allowed on block or structure members
ERROR: 0:33: 'nonuniformEXT' : not allowed on block or structure members
ERROR: 10 compilation errors. No code generated.
Shader version: 450
Requested GL_EXT_nonuniform_qualifier
ERROR: node is still EOpNull!
0:14 Function Definition: foo(i1;i1; ( nonuniform temp int)
0:14 Function Parameters:
0:14 'nupi' ( nonuniform in int)
0:14 'f' ( nonuniform out int)
0:16 Sequence
0:16 Branch: Return with expression
0:16 'nupi' ( nonuniform in int)
0:19 Function Definition: main( ( global void)
0:19 Function Parameters:
0:? Sequence
0:24 Function Call: foo(i1;i1; ( nonuniform temp int)
0:24 'nu_li' ( nonuniform temp int)
0:24 'nu_li' ( nonuniform temp int)
0:27 move second child to first child ( temp int)
0:27 'nu_li' ( nonuniform temp int)
0:27 add ( nonuniform temp int)
0:27 'a' ( nonuniform temp int)
0:27 component-wise multiply ( nonuniform temp int)
0:27 'a' ( temp int)
0:27 Constant:
0:27 2 (const int)
0:28 'nu_li' ( nonuniform temp int)
0:29 'nu_li' ( nonuniform temp int)
0:? Linker Objects
0:? 'nonuniformEXT' ( global int)
0:? 'nu_inv4' ( smooth nonuniform in 4-component vector of float)
0:? 'nu_gf' ( nonuniform temp float)
0:? 'nu_outv4' ( nonuniform out 4-component vector of float)
0:? 'nu_uv4' ( nonuniform uniform 4-component vector of float)
0:? 'nu_constf' ( nonuniform const float)
0:? 1.000000
0:? 'ins' (layout( location=1) smooth in structure{ global float a, temp float b})
0:? 'inb' (layout( location=3) in block{ in float a, in float b})
Linked fragment stage:
Shader version: 450
Requested GL_EXT_nonuniform_qualifier
ERROR: node is still EOpNull!
0:14 Function Definition: foo(i1;i1; ( nonuniform temp int)
0:14 Function Parameters:
0:14 'nupi' ( nonuniform in int)
0:14 'f' ( nonuniform out int)
0:16 Sequence
0:16 Branch: Return with expression
0:16 'nupi' ( nonuniform in int)
0:19 Function Definition: main( ( global void)
0:19 Function Parameters:
0:? Sequence
0:24 Function Call: foo(i1;i1; ( nonuniform temp int)
0:24 'nu_li' ( nonuniform temp int)
0:24 'nu_li' ( nonuniform temp int)
0:27 move second child to first child ( temp int)
0:27 'nu_li' ( nonuniform temp int)
0:27 add ( nonuniform temp int)
0:27 'a' ( nonuniform temp int)
0:27 component-wise multiply ( nonuniform temp int)
0:27 'a' ( temp int)
0:27 Constant:
0:27 2 (const int)
0:28 'nu_li' ( nonuniform temp int)
0:29 'nu_li' ( nonuniform temp int)
0:? Linker Objects
0:? 'nonuniformEXT' ( global int)
0:? 'nu_inv4' ( smooth nonuniform in 4-component vector of float)
0:? 'nu_gf' ( nonuniform temp float)
0:? 'nu_outv4' ( nonuniform out 4-component vector of float)
0:? 'nu_uv4' ( nonuniform uniform 4-component vector of float)
0:? 'nu_constf' ( nonuniform const float)
0:? 1.000000
0:? 'ins' (layout( location=1) smooth in structure{ global float a, temp float b})
0:? 'inb' (layout( location=3) in block{ in float a, in float b})

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,359 @@
spv.nonuniform.frag
// Module Version 10000
// Generated by (magic number): 80006
// Id's are bound by 210
Capability Shader
Capability InputAttachment
Capability SampledBuffer
Capability ImageBuffer
Capability CapabilityShaderNonUniformEXT
Capability CapabilityRuntimeDescriptorArrayEXT
Capability CapabilityInputAttachmentArrayDynamicIndexingEXT
Capability CapabilityUniformTexelBufferArrayDynamicIndexingEXT
Capability CapabilityStorageTexelBufferArrayDynamicIndexingEXT
Capability CapabilityUniformBufferArrayNonUniformIndexingEXT
Capability CapabilitySampledImageArrayNonUniformIndexingEXT
Capability CapabilityStorageBufferArrayNonUniformIndexingEXT
Capability CapabilityStorageImageArrayNonUniformIndexingEXT
Capability CapabilityInputAttachmentArrayNonUniformIndexingEXT
Capability CapabilityUniformTexelBufferArrayNonUniformIndexingEXT
Capability CapabilityStorageTexelBufferArrayNonUniformIndexingEXT
Extension "SPV_EXT_descriptor_indexing"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 33 90
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
SourceExtension "GL_EXT_nonuniform_qualifier"
Name 4 "main"
Name 11 "foo(i1;i1;"
Name 9 "nupi"
Name 10 "f"
Name 16 "a"
Name 17 "nu_li"
Name 18 "param"
Name 20 "param"
Name 30 "b"
Name 33 "nu_inv4"
Name 39 "nu_gf"
Name 45 "inputAttachmentDyn"
Name 46 "dyn_i"
Name 62 "uniformTexelBufferDyn"
Name 76 "storageTexelBufferDyn"
Name 85 "uname"
MemberName 85(uname) 0 "a"
Name 88 "uniformBuffer"
Name 90 "nu_ii"
Name 97 "bname"
MemberName 97(bname) 0 "b"
Name 100 "storageBuffer"
Name 110 "sampledImage"
Name 125 "storageImage"
Name 137 "inputAttachment"
Name 147 "uniformTexelBuffer"
Name 158 "storageTexelBuffer"
Name 168 "v"
Name 183 "uv"
Name 193 "m"
Name 201 "S"
MemberName 201(S) 0 "a"
Name 203 "s"
Decorate 13 DecorationNonUniformEXT
Decorate 17(nu_li) DecorationNonUniformEXT
Decorate 19 DecorationNonUniformEXT
Decorate 23 DecorationNonUniformEXT
Decorate 26 DecorationNonUniformEXT
Decorate 27 DecorationNonUniformEXT
Decorate 33(nu_inv4) Location 0
Decorate 33(nu_inv4) DecorationNonUniformEXT
Decorate 38 DecorationNonUniformEXT
Decorate 39(nu_gf) DecorationNonUniformEXT
Decorate 40 DecorationNonUniformEXT
Decorate 41 DecorationNonUniformEXT
Decorate 45(inputAttachmentDyn) DescriptorSet 0
Decorate 45(inputAttachmentDyn) Binding 0
Decorate 45(inputAttachmentDyn) InputAttachmentIndex 0
Decorate 62(uniformTexelBufferDyn) DescriptorSet 0
Decorate 62(uniformTexelBufferDyn) Binding 1
Decorate 76(storageTexelBufferDyn) DescriptorSet 0
Decorate 76(storageTexelBufferDyn) Binding 2
MemberDecorate 85(uname) 0 Offset 0
Decorate 85(uname) Block
Decorate 88(uniformBuffer) DescriptorSet 0
Decorate 88(uniformBuffer) Binding 3
Decorate 90(nu_ii) Flat
Decorate 90(nu_ii) Location 1
Decorate 90(nu_ii) DecorationNonUniformEXT
Decorate 91 DecorationNonUniformEXT
Decorate 94 DecorationNonUniformEXT
MemberDecorate 97(bname) 0 Offset 0
Decorate 97(bname) BufferBlock
Decorate 100(storageBuffer) DescriptorSet 0
Decorate 100(storageBuffer) Binding 4
Decorate 101 DecorationNonUniformEXT
Decorate 103 DecorationNonUniformEXT
Decorate 110(sampledImage) DescriptorSet 0
Decorate 110(sampledImage) Binding 5
Decorate 111 DecorationNonUniformEXT
Decorate 114 DecorationNonUniformEXT
Decorate 125(storageImage) DescriptorSet 0
Decorate 125(storageImage) Binding 6
Decorate 126 DecorationNonUniformEXT
Decorate 129 DecorationNonUniformEXT
Decorate 137(inputAttachment) DescriptorSet 0
Decorate 137(inputAttachment) Binding 7
Decorate 137(inputAttachment) InputAttachmentIndex 1
Decorate 138 DecorationNonUniformEXT
Decorate 140 DecorationNonUniformEXT
Decorate 147(uniformTexelBuffer) DescriptorSet 0
Decorate 147(uniformTexelBuffer) Binding 8
Decorate 148 DecorationNonUniformEXT
Decorate 150 DecorationNonUniformEXT
Decorate 158(storageTexelBuffer) DescriptorSet 0
Decorate 158(storageTexelBuffer) Binding 9
Decorate 159 DecorationNonUniformEXT
Decorate 161 DecorationNonUniformEXT
Decorate 168(v) DecorationNonUniformEXT
Decorate 171 DecorationNonUniformEXT
Decorate 173 DecorationNonUniformEXT
Decorate 178 DecorationNonUniformEXT
Decorate 180 DecorationNonUniformEXT
Decorate 184 DecorationNonUniformEXT
Decorate 186 DecorationNonUniformEXT
Decorate 188 DecorationNonUniformEXT
Decorate 193(m) DecorationNonUniformEXT
Decorate 195 DecorationNonUniformEXT
Decorate 203(s) DecorationNonUniformEXT
Decorate 205 DecorationNonUniformEXT
Decorate 207 DecorationNonUniformEXT
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
7: TypePointer Function 6(int)
8: TypeFunction 6(int) 7(ptr) 7(ptr)
25: 6(int) Constant 2
28: TypeFloat 32
29: TypePointer Function 28(float)
31: TypeVector 28(float) 4
32: TypePointer Input 31(fvec4)
33(nu_inv4): 32(ptr) Variable Input
34: TypeInt 32 0
35: 34(int) Constant 0
36: TypePointer Input 28(float)
42: TypeImage 28(float) SubpassData nonsampled format:Unknown
43: TypeRuntimeArray 42
44: TypePointer UniformConstant 43
45(inputAttachmentDyn): 44(ptr) Variable UniformConstant
48: TypePointer UniformConstant 42
51: 6(int) Constant 0
52: TypeVector 6(int) 2
53: 52(ivec2) ConstantComposite 51 51
58: TypeImage 28(float) Buffer sampled format:Unknown
59: TypeSampledImage 58
60: TypeRuntimeArray 59
61: TypePointer UniformConstant 60
62(uniformTexelBufferDyn): 61(ptr) Variable UniformConstant
64: TypePointer UniformConstant 59
67: 6(int) Constant 1
73: TypeImage 28(float) Buffer nonsampled format:R32f
74: TypeRuntimeArray 73
75: TypePointer UniformConstant 74
76(storageTexelBufferDyn): 75(ptr) Variable UniformConstant
78: TypePointer UniformConstant 73
85(uname): TypeStruct 28(float)
86: TypeRuntimeArray 85(uname)
87: TypePointer Uniform 86
88(uniformBuffer): 87(ptr) Variable Uniform
89: TypePointer Input 6(int)
90(nu_ii): 89(ptr) Variable Input
92: TypePointer Uniform 28(float)
97(bname): TypeStruct 28(float)
98: TypeRuntimeArray 97(bname)
99: TypePointer Uniform 98
100(storageBuffer): 99(ptr) Variable Uniform
106: TypeImage 28(float) 2D sampled format:Unknown
107: TypeSampledImage 106
108: TypeRuntimeArray 107
109: TypePointer UniformConstant 108
110(sampledImage): 109(ptr) Variable UniformConstant
112: TypePointer UniformConstant 107
115: TypeVector 28(float) 2
116: 28(float) Constant 1056964608
117: 115(fvec2) ConstantComposite 116 116
122: TypeImage 28(float) 2D nonsampled format:R32f
123: TypeRuntimeArray 122
124: TypePointer UniformConstant 123
125(storageImage): 124(ptr) Variable UniformConstant
127: TypePointer UniformConstant 122
130: 52(ivec2) ConstantComposite 67 67
135: TypeRuntimeArray 42
136: TypePointer UniformConstant 135
137(inputAttachment): 136(ptr) Variable UniformConstant
145: TypeRuntimeArray 59
146: TypePointer UniformConstant 145
147(uniformTexelBuffer): 146(ptr) Variable UniformConstant
156: TypeRuntimeArray 73
157: TypePointer UniformConstant 156
158(storageTexelBuffer): 157(ptr) Variable UniformConstant
166: TypeVector 6(int) 4
167: TypePointer Function 166(ivec4)
169: 34(int) Constant 1
176: 34(int) Constant 2
191: TypeMatrix 31(fvec4) 4
192: TypePointer Function 191
201(S): TypeStruct 6(int)
202: TypePointer Function 201(S)
4(main): 2 Function None 3
5: Label
16(a): 7(ptr) Variable Function
17(nu_li): 7(ptr) Variable Function
18(param): 7(ptr) Variable Function
20(param): 7(ptr) Variable Function
30(b): 29(ptr) Variable Function
39(nu_gf): 29(ptr) Variable Function
46(dyn_i): 7(ptr) Variable Function
168(v): 167(ptr) Variable Function
183(uv): 167(ptr) Variable Function
193(m): 192(ptr) Variable Function
203(s): 202(ptr) Variable Function
19: 6(int) Load 17(nu_li)
Store 18(param) 19
21: 6(int) FunctionCall 11(foo(i1;i1;) 18(param) 20(param)
22: 6(int) Load 20(param)
Store 17(nu_li) 22
Store 16(a) 21
23: 6(int) Load 16(a)
24: 6(int) Load 16(a)
26: 6(int) IMul 24 25
27: 6(int) IAdd 23 26
Store 17(nu_li) 27
37: 36(ptr) AccessChain 33(nu_inv4) 35
38: 28(float) Load 37
40: 28(float) Load 39(nu_gf)
41: 28(float) FMul 38 40
Store 30(b) 41
47: 6(int) Load 46(dyn_i)
49: 48(ptr) AccessChain 45(inputAttachmentDyn) 47
50: 42 Load 49
54: 31(fvec4) ImageRead 50 53
55: 28(float) CompositeExtract 54 0
56: 28(float) Load 30(b)
57: 28(float) FAdd 56 55
Store 30(b) 57
63: 6(int) Load 46(dyn_i)
65: 64(ptr) AccessChain 62(uniformTexelBufferDyn) 63
66: 59 Load 65
68: 58 Image 66
69: 31(fvec4) ImageFetch 68 67
70: 28(float) CompositeExtract 69 0
71: 28(float) Load 30(b)
72: 28(float) FAdd 71 70
Store 30(b) 72
77: 6(int) Load 46(dyn_i)
79: 78(ptr) AccessChain 76(storageTexelBufferDyn) 77
80: 73 Load 79
81: 31(fvec4) ImageRead 80 67
82: 28(float) CompositeExtract 81 0
83: 28(float) Load 30(b)
84: 28(float) FAdd 83 82
Store 30(b) 84
91: 6(int) Load 90(nu_ii)
93: 92(ptr) AccessChain 88(uniformBuffer) 91 51
94: 28(float) Load 93
95: 28(float) Load 30(b)
96: 28(float) FAdd 95 94
Store 30(b) 96
101: 6(int) Load 90(nu_ii)
102: 92(ptr) AccessChain 100(storageBuffer) 101 51
103: 28(float) Load 102
104: 28(float) Load 30(b)
105: 28(float) FAdd 104 103
Store 30(b) 105
111: 6(int) Load 90(nu_ii)
113: 112(ptr) AccessChain 110(sampledImage) 111
114: 107 Load 113
118: 31(fvec4) ImageSampleImplicitLod 114 117
119: 28(float) CompositeExtract 118 0
120: 28(float) Load 30(b)
121: 28(float) FAdd 120 119
Store 30(b) 121
126: 6(int) Load 90(nu_ii)
128: 127(ptr) AccessChain 125(storageImage) 126
129: 122 Load 128
131: 31(fvec4) ImageRead 129 130
132: 28(float) CompositeExtract 131 0
133: 28(float) Load 30(b)
134: 28(float) FAdd 133 132
Store 30(b) 134
138: 6(int) Load 90(nu_ii)
139: 48(ptr) AccessChain 137(inputAttachment) 138
140: 42 Load 139
141: 31(fvec4) ImageRead 140 53
142: 28(float) CompositeExtract 141 0
143: 28(float) Load 30(b)
144: 28(float) FAdd 143 142
Store 30(b) 144
148: 6(int) Load 90(nu_ii)
149: 64(ptr) AccessChain 147(uniformTexelBuffer) 148
150: 59 Load 149
151: 58 Image 150
152: 31(fvec4) ImageFetch 151 67
153: 28(float) CompositeExtract 152 0
154: 28(float) Load 30(b)
155: 28(float) FAdd 154 153
Store 30(b) 155
159: 6(int) Load 90(nu_ii)
160: 78(ptr) AccessChain 158(storageTexelBuffer) 159
161: 73 Load 160
162: 31(fvec4) ImageRead 161 67
163: 28(float) CompositeExtract 162 0
164: 28(float) Load 30(b)
165: 28(float) FAdd 164 163
Store 30(b) 165
170: 7(ptr) AccessChain 168(v) 169
171: 6(int) Load 170
172: 92(ptr) AccessChain 88(uniformBuffer) 171 51
173: 28(float) Load 172
174: 28(float) Load 30(b)
175: 28(float) FAdd 174 173
Store 30(b) 175
177: 7(ptr) AccessChain 168(v) 176
178: 6(int) Load 177
179: 92(ptr) AccessChain 88(uniformBuffer) 178 51
180: 28(float) Load 179
181: 28(float) Load 30(b)
182: 28(float) FAdd 181 180
Store 30(b) 182
184: 6(int) Load 90(nu_ii)
185: 7(ptr) AccessChain 183(uv) 184
186: 6(int) Load 185
187: 92(ptr) AccessChain 88(uniformBuffer) 186 51
188: 28(float) Load 187
189: 28(float) Load 30(b)
190: 28(float) FAdd 189 188
Store 30(b) 190
194: 29(ptr) AccessChain 193(m) 25 176
195: 28(float) Load 194
196: 6(int) ConvertFToS 195
197: 92(ptr) AccessChain 88(uniformBuffer) 196 51
198: 28(float) Load 197
199: 28(float) Load 30(b)
200: 28(float) FAdd 199 198
Store 30(b) 200
204: 7(ptr) AccessChain 203(s) 51
205: 6(int) Load 204
206: 92(ptr) AccessChain 88(uniformBuffer) 205 51
207: 28(float) Load 206
208: 28(float) Load 30(b)
209: 28(float) FAdd 208 207
Store 30(b) 209
Return
FunctionEnd
11(foo(i1;i1;): 6(int) Function None 8
9(nupi): 7(ptr) FunctionParameter
10(f): 7(ptr) FunctionParameter
12: Label
13: 6(int) Load 9(nupi)
ReturnValue 13
FunctionEnd

33
Test/nonuniform.frag Normal file
View File

@@ -0,0 +1,33 @@
#version 450
int nonuniformEXT;
#extension GL_EXT_nonuniform_qualifier : enable
nonuniformEXT in vec4 nu_inv4;
nonuniformEXT float nu_gf;
nonuniformEXT out vec4 nu_outv4; // ERROR, out
nonuniformEXT uniform vec4 nu_uv4; // ERROR, uniform
nonuniformEXT const float nu_constf = 1.0; // ERROR, const
nonuniformEXT int foo(nonuniformEXT int nupi, nonuniformEXT out int f)
{
return nupi;
}
void main()
{
nonuniformEXT int nu_li;
nonuniformEXT const int nu_ci = 2; // ERROR, const
foo(nu_li, nu_li);
int a;
nu_li = nonuniformEXT(a) + nonuniformEXT(a * 2);
nu_li = nonuniformEXT(a, a); // ERROR, too many arguments
nu_li = nonuniformEXT(); // ERROR, no arguments
}
layout(location=1) in struct S { float a; nonuniformEXT float b; } ins; // ERROR, not on member
layout(location=3) in inbName { float a; nonuniformEXT float b; } inb; // ERROR, not on member

View File

@@ -30,6 +30,15 @@ uniform aun {
float aub[];
};
layout(binding=1) uniform samplerBuffer uniformTexelBufferDyn[];
layout(binding=2, r32f) uniform imageBuffer storageTexelBufferDyn[];
layout(binding=3) uniform uname { float a; } uniformBuffer[];
layout(binding=4) buffer bname { float b; } storageBuffer[];
layout(binding=5) uniform sampler2D sampledImage[];
layout(binding=6, r32f) uniform image2D storageImage[];
layout(binding=8) uniform samplerBuffer uniformTexelBuffer[];
layout(binding=9, r32f) uniform imageBuffer storageTexelBuffer[];
int i;
void main()
@@ -78,4 +87,22 @@ void main()
aub.length(); // ERROR
aba.length(); // ERROR
abb.length();
uniformTexelBufferDyn[1];
storageTexelBufferDyn[1];
uniformBuffer[1];
storageBuffer[1];
sampledImage[1];
storageImage[1];
uniformTexelBuffer[1];
storageTexelBuffer[1];
uniformTexelBufferDyn[i]; // ERROR, need extension
storageTexelBufferDyn[i]; // ERROR, need extension
uniformBuffer[i]; // ERROR, need extension
storageBuffer[i]; // ERROR, need extension
sampledImage[i]; // ERROR, need extension
storageImage[i]; // ERROR, need extension
uniformTexelBuffer[i]; // ERROR, need extension
storageTexelBuffer[i]; // ERROR, need extension
}

55
Test/spv.nonuniform.frag Normal file
View File

@@ -0,0 +1,55 @@
#version 450
#extension GL_EXT_nonuniform_qualifier : enable
layout(location=0) nonuniformEXT in vec4 nu_inv4;
nonuniformEXT float nu_gf;
layout(location=1) in nonuniformEXT flat int nu_ii;
layout(binding=0, input_attachment_index = 0) uniform subpassInput inputAttachmentDyn[];
layout(binding=1) uniform samplerBuffer uniformTexelBufferDyn[];
layout(binding=2, r32f) uniform imageBuffer storageTexelBufferDyn[];
layout(binding=3) uniform uname { float a; } uniformBuffer[];
layout(binding=4) buffer bname { float b; } storageBuffer[];
layout(binding=5) uniform sampler2D sampledImage[];
layout(binding=6, r32f) uniform image2D storageImage[];
layout(binding=7, input_attachment_index = 1) uniform subpassInput inputAttachment[];
layout(binding=8) uniform samplerBuffer uniformTexelBuffer[];
layout(binding=9, r32f) uniform imageBuffer storageTexelBuffer[];
nonuniformEXT int foo(nonuniformEXT int nupi, nonuniformEXT out int f)
{
return nupi;
}
void main()
{
nonuniformEXT int nu_li;
int dyn_i;
int a = foo(nu_li, nu_li);
nu_li = nonuniformEXT(a) + nonuniformEXT(a * 2);
float b;
b = nu_inv4.x * nu_gf;
b += subpassLoad(inputAttachmentDyn[dyn_i]).x;
b += texelFetch(uniformTexelBufferDyn[dyn_i], 1).x;
b += imageLoad(storageTexelBufferDyn[dyn_i], 1).x;
b += uniformBuffer[nu_ii].a;
b += storageBuffer[nu_ii].b;
b += texture(sampledImage[nu_ii], vec2(0.5)).x;
b += imageLoad(storageImage[nu_ii], ivec2(1)).x;
b += subpassLoad(inputAttachment[nu_ii]).x;
b += texelFetch(uniformTexelBuffer[nu_ii], 1).x;
b += imageLoad(storageTexelBuffer[nu_ii], 1).x;
nonuniformEXT ivec4 v;
nonuniformEXT mat4 m;
nonuniformEXT struct S { int a; } s;
ivec4 uv;
b += uniformBuffer[v.y].a;
b += uniformBuffer[v[2]].a;
b += uniformBuffer[uv[nu_ii]].a;
b += uniformBuffer[int(m[2].z)].a;
b += uniformBuffer[s.a].a;
}