Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
88220d50
Commit
88220d50
authored
May 08, 2019
by
Jeff Bolz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
For nonuniformEXT constructor, make a copy of the node to decorate
parent
e291f7a0
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
374 additions
and
296 deletions
+374
-296
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+5
-0
nonuniform.frag.out
Test/baseResults/nonuniform.frag.out
+12
-8
spv.nonuniform.frag.out
Test/baseResults/spv.nonuniform.frag.out
+287
-285
spv.nonuniform2.frag.out
Test/baseResults/spv.nonuniform2.frag.out
+53
-0
spv.nonuniform2.frag
Test/spv.nonuniform2.frag
+9
-0
intermediate.h
glslang/Include/intermediate.h
+2
-0
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+4
-3
intermOut.cpp
glslang/MachineIndependent/intermOut.cpp
+1
-0
Spv.FromFile.cpp
gtests/Spv.FromFile.cpp
+1
-0
No files found.
SPIRV/GlslangToSpv.cpp
View file @
88220d50
...
...
@@ -5543,6 +5543,11 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe
case
glslang
:
:
EOpConstructReference
:
unaryOp
=
spv
::
OpBitcast
;
break
;
case
glslang
:
:
EOpCopyObject
:
unaryOp
=
spv
::
OpCopyObject
;
break
;
default
:
return
0
;
}
...
...
Test/baseResults/nonuniform.frag.out
View file @
88220d50
...
...
@@ -31,11 +31,13 @@ ERROR: node is still EOpNull!
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 copy object ( nonuniform temp int)
0:27 'a' ( temp int)
0:27 Constant:
0:27 2 (const int)
0:27 copy object ( nonuniform temp int)
0:27 component-wise multiply ( 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
...
...
@@ -72,11 +74,13 @@ ERROR: node is still EOpNull!
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 copy object ( nonuniform temp int)
0:27 'a' ( temp int)
0:27 Constant:
0:27 2 (const int)
0:27 copy object ( nonuniform temp int)
0:27 component-wise multiply ( 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
...
...
Test/baseResults/spv.nonuniform.frag.out
View file @
88220d50
spv.nonuniform.frag
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 21
0
// Id's are bound by 21
2
Capability Shader
Capability InputAttachment
...
...
@@ -22,7 +22,7 @@ spv.nonuniform.frag
Extension "SPV_EXT_descriptor_indexing"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 3
3 90
EntryPoint Fragment 4 "main" 3
5 92
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
SourceExtension "GL_EXT_nonuniform_qualifier"
...
...
@@ -34,189 +34,189 @@ spv.nonuniform.frag
Name 17 "nu_li"
Name 18 "param"
Name 20 "param"
Name 3
0
"b"
Name 3
3
"nu_inv4"
Name
39
"nu_gf"
Name 4
5
"inputAttachmentDyn"
Name 4
6
"dyn_i"
Name 6
2
"uniformTexelBufferDyn"
Name 7
6
"storageTexelBufferDyn"
Name 8
5
"uname"
MemberName 8
5
(uname) 0 "a"
Name
88
"uniformBuffer"
Name 9
0
"nu_ii"
Name 9
7
"bname"
MemberName 9
7
(bname) 0 "b"
Name 10
0
"storageBuffer"
Name 11
0
"sampledImage"
Name 12
5
"storageImage"
Name 13
7
"inputAttachment"
Name 14
7
"uniformTexelBuffer"
Name 1
58
"storageTexelBuffer"
Name 1
68
"v"
Name 18
3
"uv"
Name 19
3
"m"
Name 20
1
"S"
MemberName 20
1
(S) 0 "a"
Name 20
3
"s"
Name 3
2
"b"
Name 3
5
"nu_inv4"
Name
41
"nu_gf"
Name 4
7
"inputAttachmentDyn"
Name 4
8
"dyn_i"
Name 6
4
"uniformTexelBufferDyn"
Name 7
8
"storageTexelBufferDyn"
Name 8
7
"uname"
MemberName 8
7
(uname) 0 "a"
Name
90
"uniformBuffer"
Name 9
2
"nu_ii"
Name 9
9
"bname"
MemberName 9
9
(bname) 0 "b"
Name 10
2
"storageBuffer"
Name 11
2
"sampledImage"
Name 12
7
"storageImage"
Name 13
9
"inputAttachment"
Name 14
9
"uniformTexelBuffer"
Name 1
60
"storageTexelBuffer"
Name 1
70
"v"
Name 18
5
"uv"
Name 19
5
"m"
Name 20
3
"S"
MemberName 20
3
(S) 0 "a"
Name 20
5
"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 24 DecorationNonUniformEXT
Decorate 28 DecorationNonUniformEXT
Decorate 29 DecorationNonUniformEXT
Decorate 35(nu_inv4) Location 0
Decorate 35(nu_inv4) 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 41(nu_gf) DecorationNonUniformEXT
Decorate 42 DecorationNonUniformEXT
Decorate 43 DecorationNonUniformEXT
Decorate 47(inputAttachmentDyn) DescriptorSet 0
Decorate 47(inputAttachmentDyn) Binding 0
Decorate 47(inputAttachmentDyn) InputAttachmentIndex 0
Decorate 64(uniformTexelBufferDyn) DescriptorSet 0
Decorate 64(uniformTexelBufferDyn) Binding 1
Decorate 78(storageTexelBufferDyn) DescriptorSet 0
Decorate 78(storageTexelBufferDyn) Binding 2
MemberDecorate 87(uname) 0 Offset 0
Decorate 87(uname) Block
Decorate 90(uniformBuffer) DescriptorSet 0
Decorate 90(uniformBuffer) Binding 3
Decorate 92(nu_ii) Flat
Decorate 92(nu_ii) Location 1
Decorate 92(nu_ii) DecorationNonUniformEXT
Decorate 93 DecorationNonUniformEXT
Decorate 96 DecorationNonUniformEXT
MemberDecorate 99(bname) 0 Offset 0
Decorate 99(bname) BufferBlock
Decorate 102(storageBuffer) DescriptorSet 0
Decorate 102(storageBuffer) Binding 4
Decorate 103 DecorationNonUniformEXT
Decorate 1
10(sampledImage) DescriptorSet 0
Decorate 11
0(sampledImage) Binding 5
Decorate 11
1 DecorationNonUniformEXT
Decorate 11
4
DecorationNonUniformEXT
Decorate 1
25(storageImage) DescriptorSet 0
Decorate 12
5(storageImage) Binding 6
Decorate 12
6 DecorationNonUniformEXT
Decorate 12
9
DecorationNonUniformEXT
Decorate 13
7(inputAttachment) DescriptorSet 0
Decorate 13
7(inputAttachment) Binding 7
Decorate 13
7(inputAttachment) InputAttachmentIndex 1
Decorate 13
8 DecorationNonUniformEXT
Decorate 1
05 DecorationNonUniformEXT
Decorate 11
2(sampledImage) DescriptorSet 0
Decorate 11
2(sampledImage) Binding 5
Decorate 11
3
DecorationNonUniformEXT
Decorate 1
16 DecorationNonUniformEXT
Decorate 12
7(storageImage) DescriptorSet 0
Decorate 12
7(storageImage) Binding 6
Decorate 12
8
DecorationNonUniformEXT
Decorate 13
1 DecorationNonUniformEXT
Decorate 13
9(inputAttachment) DescriptorSet 0
Decorate 13
9(inputAttachment) Binding 7
Decorate 13
9(inputAttachment) InputAttachmentIndex 1
Decorate 140 DecorationNonUniformEXT
Decorate 14
7(uniformTexelBuffer) DescriptorSet 0
Decorate 14
7(uniformTexelBuffer) Binding 8
Decorate 14
8 DecorationNonUniformEXT
Decorate 14
2 DecorationNonUniformEXT
Decorate 14
9(uniformTexelBuffer) DescriptorSet 0
Decorate 14
9(uniformTexelBuffer) Binding 8
Decorate 150 DecorationNonUniformEXT
Decorate 15
8(storageTexelBuffer) DescriptorSet 0
Decorate 1
58(storageTexelBuffer) Binding 9
Decorate 1
59 DecorationNonUniformEXT
Decorate 15
2 DecorationNonUniformEXT
Decorate 1
60(storageTexelBuffer) DescriptorSet 0
Decorate 1
60(storageTexelBuffer) Binding 9
Decorate 161 DecorationNonUniformEXT
Decorate 16
8(v)
DecorationNonUniformEXT
Decorate 17
1
DecorationNonUniformEXT
Decorate 16
3
DecorationNonUniformEXT
Decorate 17
0(v)
DecorationNonUniformEXT
Decorate 173 DecorationNonUniformEXT
Decorate 17
8
DecorationNonUniformEXT
Decorate 17
5
DecorationNonUniformEXT
Decorate 180 DecorationNonUniformEXT
Decorate 18
4
DecorationNonUniformEXT
Decorate 18
2
DecorationNonUniformEXT
Decorate 186 DecorationNonUniformEXT
Decorate 188 DecorationNonUniformEXT
Decorate 19
3(m)
DecorationNonUniformEXT
Decorate 195 DecorationNonUniformEXT
Decorate
203(s)
DecorationNonUniformEXT
Decorate 205 DecorationNonUniformEXT
Decorate 19
0
DecorationNonUniformEXT
Decorate 195
(m)
DecorationNonUniformEXT
Decorate
197
DecorationNonUniformEXT
Decorate 205
(s)
DecorationNonUniformEXT
Decorate 207 DecorationNonUniformEXT
Decorate 209 DecorationNonUniformEXT
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
7: TypePointer Function 6(int)
8: TypeFunction 6(int) 7(ptr) 7(ptr)
2
5
: 6(int) Constant 2
28
: TypeFloat 32
29: TypePointer Function 28
(float)
3
1: TypeVector 28
(float) 4
3
2: TypePointer Input 31
(fvec4)
3
3(nu_inv4): 32
(ptr) Variable Input
3
4
: TypeInt 32 0
3
5: 34
(int) Constant 0
3
6: TypePointer Input 28
(float)
4
2: TypeImage 28
(float) SubpassData nonsampled format:Unknown
4
3: TypeRuntimeArray 42
4
4: TypePointer UniformConstant 43
4
5(inputAttachmentDyn): 44
(ptr) Variable UniformConstant
48: TypePointer UniformConstant 42
5
1
: 6(int) Constant 0
5
2
: TypeVector 6(int) 2
5
3: 52(ivec2) ConstantComposite 51 51
58: TypeImage 28
(float) Buffer sampled format:Unknown
59: TypeSampledImage 58
6
0: TypeRuntimeArray 59
6
1: TypePointer UniformConstant 60
6
2(uniformTexelBufferDyn): 61
(ptr) Variable UniformConstant
6
4: TypePointer UniformConstant 59
6
7
: 6(int) Constant 1
7
3: TypeImage 28
(float) Buffer nonsampled format:R32f
7
4: TypeRuntimeArray 73
7
5: TypePointer UniformConstant 74
7
6(storageTexelBufferDyn): 75
(ptr) Variable UniformConstant
78: TypePointer UniformConstant 73
8
5(uname): TypeStruct 28
(float)
8
6: TypeRuntimeArray 85
(uname)
8
7: TypePointer Uniform 86
88(uniformBuffer): 87
(ptr) Variable Uniform
89
: TypePointer Input 6(int)
9
0(nu_ii): 89
(ptr) Variable Input
9
2: TypePointer Uniform 28
(float)
9
7(bname): TypeStruct 28
(float)
98: TypeRuntimeArray 97
(bname)
99: TypePointer Uniform 98
10
0(storageBuffer): 99
(ptr) Variable Uniform
10
6: TypeImage 28
(float) 2D sampled format:Unknown
10
7: TypeSampledImage 106
1
08: TypeRuntimeArray 107
1
09: TypePointer UniformConstant 108
11
0(sampledImage): 109
(ptr) Variable UniformConstant
11
2: TypePointer UniformConstant 107
11
5: TypeVector 28
(float) 2
11
6: 28
(float) Constant 1056964608
11
7: 115(fvec2) ConstantComposite 116 116
12
2: TypeImage 28
(float) 2D nonsampled format:R32f
12
3: TypeRuntimeArray 122
12
4: TypePointer UniformConstant 123
12
5(storageImage): 124
(ptr) Variable UniformConstant
12
7: TypePointer UniformConstant 122
13
0: 52(ivec2) ConstantComposite 67 67
13
5: TypeRuntimeArray 42
13
6: TypePointer UniformConstant 135
13
7(inputAttachment): 136
(ptr) Variable UniformConstant
14
5: TypeRuntimeArray 59
14
6: TypePointer UniformConstant 145
14
7(uniformTexelBuffer): 146
(ptr) Variable UniformConstant
15
6: TypeRuntimeArray 73
15
7: TypePointer UniformConstant 156
1
58(storageTexelBuffer): 157
(ptr) Variable UniformConstant
16
6
: TypeVector 6(int) 4
16
7: TypePointer Function 166
(ivec4)
1
69: 34
(int) Constant 1
17
6: 34
(int) Constant 2
19
1: TypeMatrix 31
(fvec4) 4
19
2: TypePointer Function 191
20
1
(S): TypeStruct 6(int)
20
2: TypePointer Function 201
(S)
2
6
: 6(int) Constant 2
30
: TypeFloat 32
31: TypePointer Function 30
(float)
3
3: TypeVector 30
(float) 4
3
4: TypePointer Input 33
(fvec4)
3
5(nu_inv4): 34
(ptr) Variable Input
3
6
: TypeInt 32 0
3
7: 36
(int) Constant 0
3
8: TypePointer Input 30
(float)
4
4: TypeImage 30
(float) SubpassData nonsampled format:Unknown
4
5: TypeRuntimeArray 44
4
6: TypePointer UniformConstant 45
4
7(inputAttachmentDyn): 46
(ptr) Variable UniformConstant
50: TypePointer UniformConstant 44
5
3
: 6(int) Constant 0
5
4
: TypeVector 6(int) 2
5
5: 54(ivec2) ConstantComposite 53 53
60: TypeImage 30
(float) Buffer sampled format:Unknown
61: TypeSampledImage 60
6
2: TypeRuntimeArray 61
6
3: TypePointer UniformConstant 62
6
4(uniformTexelBufferDyn): 63
(ptr) Variable UniformConstant
6
6: TypePointer UniformConstant 61
6
9
: 6(int) Constant 1
7
5: TypeImage 30
(float) Buffer nonsampled format:R32f
7
6: TypeRuntimeArray 75
7
7: TypePointer UniformConstant 76
7
8(storageTexelBufferDyn): 77
(ptr) Variable UniformConstant
80: TypePointer UniformConstant 75
8
7(uname): TypeStruct 30
(float)
8
8: TypeRuntimeArray 87
(uname)
8
9: TypePointer Uniform 88
90(uniformBuffer): 89
(ptr) Variable Uniform
91
: TypePointer Input 6(int)
9
2(nu_ii): 91
(ptr) Variable Input
9
4: TypePointer Uniform 30
(float)
9
9(bname): TypeStruct 30
(float)
100: TypeRuntimeArray 99
(bname)
101: TypePointer Uniform 100
10
2(storageBuffer): 101
(ptr) Variable Uniform
10
8: TypeImage 30
(float) 2D sampled format:Unknown
10
9: TypeSampledImage 108
1
10: TypeRuntimeArray 109
1
11: TypePointer UniformConstant 110
11
2(sampledImage): 111
(ptr) Variable UniformConstant
11
4: TypePointer UniformConstant 109
11
7: TypeVector 30
(float) 2
11
8: 30
(float) Constant 1056964608
11
9: 117(fvec2) ConstantComposite 118 118
12
4: TypeImage 30
(float) 2D nonsampled format:R32f
12
5: TypeRuntimeArray 124
12
6: TypePointer UniformConstant 125
12
7(storageImage): 126
(ptr) Variable UniformConstant
12
9: TypePointer UniformConstant 124
13
2: 54(ivec2) ConstantComposite 69 69
13
7: TypeRuntimeArray 44
13
8: TypePointer UniformConstant 137
13
9(inputAttachment): 138
(ptr) Variable UniformConstant
14
7: TypeRuntimeArray 61
14
8: TypePointer UniformConstant 147
14
9(uniformTexelBuffer): 148
(ptr) Variable UniformConstant
15
8: TypeRuntimeArray 75
15
9: TypePointer UniformConstant 158
1
60(storageTexelBuffer): 159
(ptr) Variable UniformConstant
16
8
: TypeVector 6(int) 4
16
9: TypePointer Function 168
(ivec4)
1
71: 36
(int) Constant 1
17
8: 36
(int) Constant 2
19
3: TypeMatrix 33
(fvec4) 4
19
4: TypePointer Function 193
20
3
(S): TypeStruct 6(int)
20
4: TypePointer Function 203
(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
3
0(b): 29
(ptr) Variable Function
39(nu_gf): 29
(ptr) Variable Function
4
6
(dyn_i): 7(ptr) Variable Function
1
68(v): 167
(ptr) Variable Function
18
3(uv): 167
(ptr) Variable Function
19
3(m): 192
(ptr) Variable Function
20
3(s): 202
(ptr) Variable Function
3
2(b): 31
(ptr) Variable Function
41(nu_gf): 31
(ptr) Variable Function
4
8
(dyn_i): 7(ptr) Variable Function
1
70(v): 169
(ptr) Variable Function
18
5(uv): 169
(ptr) Variable Function
19
5(m): 194
(ptr) Variable Function
20
5(s): 204
(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)
...
...
@@ -224,130 +224,132 @@ spv.nonuniform.frag
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
24: 6(int) CopyObject 23
25: 6(int) Load 16(a)
27: 6(int) IMul 25 26
28: 6(int) CopyObject 27
29: 6(int) IAdd 24 28
Store 17(nu_li) 29
39: 38(ptr) AccessChain 35(nu_inv4) 37
40: 30(float) Load 39
42: 30(float) Load 41(nu_gf)
43: 30(float) FMul 40 42
Store 32(b) 43
49: 6(int) Load 48(dyn_i)
51: 50(ptr) AccessChain 47(inputAttachmentDyn) 49
52: 44 Load 51
56: 33(fvec4) ImageRead 52 55
57: 30(float) CompositeExtract 56 0
58: 30(float) Load 32(b)
59: 30(float) FAdd 58 57
Store 32(b) 59
65: 6(int) Load 48(dyn_i)
67: 66(ptr) AccessChain 64(uniformTexelBufferDyn) 65
68: 61 Load 67
70: 60 Image 68
71: 33(fvec4) ImageFetch 70 69
72: 30(float) CompositeExtract 71 0
73: 30(float) Load 32(b)
74: 30(float) FAdd 73 72
Store 32(b) 74
79: 6(int) Load 48(dyn_i)
81: 80(ptr) AccessChain 78(storageTexelBufferDyn) 79
82: 75 Load 81
83: 33(fvec4) ImageRead 82 69
84: 30(float) CompositeExtract 83 0
85: 30(float) Load 32(b)
86: 30(float) FAdd 85 84
Store 32(b) 86
93: 6(int) Load 92(nu_ii)
95: 94(ptr) AccessChain 90(uniformBuffer) 93 53
96: 30(float) Load 95
97: 30(float) Load 32(b)
98: 30(float) FAdd 97 96
Store 32(b) 98
103: 6(int) Load 92(nu_ii)
104: 94(ptr) AccessChain 102(storageBuffer) 103 53
105: 30(float) Load 104
106: 30(float) Load 32(b)
107: 30(float) FAdd 106 105
Store 32(b) 107
113: 6(int) Load 92(nu_ii)
115: 114(ptr) AccessChain 112(sampledImage) 113
116: 109 Load 115
120: 33(fvec4) ImageSampleImplicitLod 116 119
121: 30(float) CompositeExtract 120 0
122: 30(float) Load 32(b)
123: 30(float) FAdd 122 121
Store 32(b) 123
128: 6(int) Load 92(nu_ii)
130: 129(ptr) AccessChain 127(storageImage) 128
131: 124 Load 130
133: 33(fvec4) ImageRead 131 132
134: 30(float) CompositeExtract 133 0
135: 30(float) Load 32(b)
136: 30(float) FAdd 135 134
Store 32(b) 136
140: 6(int) Load 92(nu_ii)
141: 50(ptr) AccessChain 139(inputAttachment) 140
142: 44 Load 141
143: 33(fvec4) ImageRead 142 55
144: 30(float) CompositeExtract 143 0
145: 30(float) Load 32(b)
146: 30(float) FAdd 145 144
Store 32(b) 146
150: 6(int) Load 92(nu_ii)
151: 66(ptr) AccessChain 149(uniformTexelBuffer) 150
152: 61 Load 151
153: 60 Image 152
154: 33(fvec4) ImageFetch 153 69
155: 30(float) CompositeExtract 154 0
156: 30(float) Load 32(b)
157: 30(float) FAdd 156 155
Store 32(b) 157
161: 6(int) Load 92(nu_ii)
162: 80(ptr) AccessChain 160(storageTexelBuffer) 161
163: 75 Load 162
164: 33(fvec4) ImageRead 163 69
165: 30(float) CompositeExtract 164 0
166: 30(float) Load 32(b)
167: 30(float) FAdd 166 165
Store 32(b) 167
172: 7(ptr) AccessChain 170(v) 171
173: 6(int) Load 172
174: 94(ptr) AccessChain 90(uniformBuffer) 173 53
175: 30(float) Load 174
176: 30(float) Load 32(b)
177: 30(float) FAdd 176 175
Store 32(b) 177
179: 7(ptr) AccessChain 170(v) 178
180: 6(int) Load 179
181: 94(ptr) AccessChain 90(uniformBuffer) 180 53
182: 30(float) Load 181
183: 30(float) Load 32(b)
184: 30(float) FAdd 183 182
Store 32(b) 184
186: 6(int) Load 92(nu_ii)
187: 7(ptr) AccessChain 185(uv) 186
188: 6(int) Load 187
189: 94(ptr) AccessChain 90(uniformBuffer) 188 53
190: 30(float) Load 189
191: 30(float) Load 32(b)
192: 30(float) FAdd 191 190
Store 32(b) 192
196: 31(ptr) AccessChain 195(m) 26 178
197: 30(float) Load 196
198: 6(int) ConvertFToS 197
199: 94(ptr) AccessChain 90(uniformBuffer) 198 53
200: 30(float) Load 199
201: 30(float) Load 32(b)
202: 30(float) FAdd 201 200
Store 32(b) 202
206: 7(ptr) AccessChain 205(s) 53
207: 6(int) Load 206
208: 94(ptr) AccessChain 90(uniformBuffer) 207 53
209: 30(float) Load 208
210: 30(float) Load 32(b)
211: 30(float) FAdd 210 209
Store 32(b) 211
Return
FunctionEnd
11(foo(i1;i1;): 6(int) Function None 8
...
...
Test/baseResults/spv.nonuniform2.frag.out
0 → 100644
View file @
88220d50
spv.nonuniform2.frag
// Module Version 10000
// Generated by (magic number): 80007
// Id's are bound by 24
Capability Shader
Capability ImageBuffer
Capability CapabilityShaderNonUniformEXT
Capability CapabilityRuntimeDescriptorArrayEXT
Capability CapabilityStorageTexelBufferArrayNonUniformIndexingEXT
Extension "SPV_EXT_descriptor_indexing"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 9 16
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
SourceExtension "GL_EXT_nonuniform_qualifier"
Name 4 "main"
Name 9 "FragColor"
Name 13 "data"
Name 16 "rIndex"
Decorate 9(FragColor) Location 0
Decorate 13(data) DescriptorSet 0
Decorate 13(data) Binding 4
Decorate 16(rIndex) Flat
Decorate 16(rIndex) Location 3
Decorate 18 DecorationNonUniformEXT
Decorate 21 DecorationNonUniformEXT
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypePointer Output 7(fvec4)
9(FragColor): 8(ptr) Variable Output
10: TypeImage 6(float) Buffer nonsampled format:Rgba32f
11: TypeRuntimeArray 10
12: TypePointer UniformConstant 11
13(data): 12(ptr) Variable UniformConstant
14: TypeInt 32 1
15: TypePointer Input 14(int)
16(rIndex): 15(ptr) Variable Input
19: TypePointer UniformConstant 10
22: 14(int) Constant 0
4(main): 2 Function None 3
5: Label
17: 14(int) Load 16(rIndex)
18: 14(int) CopyObject 17
20: 19(ptr) AccessChain 13(data) 18
21: 10 Load 20
23: 7(fvec4) ImageRead 21 22
Store 9(FragColor) 23
Return
FunctionEnd
Test/spv.nonuniform2.frag
0 → 100644
View file @
88220d50
#version 450
#extension GL_EXT_nonuniform_qualifier : require
layout
(
set
=
0
,
binding
=
4
,
rgba32f
)
uniform
imageBuffer
data
[];
layout
(
location
=
0
)
out
vec4
FragColor
;
layout
(
location
=
3
)
in
flat
int
rIndex
;
void
main
()
{
FragColor
=
imageLoad
(
data
[
nonuniformEXT
(
rIndex
)],
0
);
}
glslang/Include/intermediate.h
View file @
88220d50
...
...
@@ -85,6 +85,8 @@ enum TOperator {
EOpPreIncrement
,
EOpPreDecrement
,
EOpCopyObject
,
// (u)int* -> bool
EOpConvInt8ToBool
,
EOpConvUint8ToBool
,
...
...
glslang/MachineIndependent/ParseHelper.cpp
View file @
88220d50
...
...
@@ -6951,9 +6951,10 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
break
;
case
EOpConstructNonuniform
:
node
->
getWritableType
().
getQualifier
().
nonUniform
=
true
;
return
node
;
break
;
// Make a nonuniform copy of node
newNode
=
intermediate
.
addBuiltInFunctionCall
(
node
->
getLoc
(),
EOpCopyObject
,
true
,
node
,
node
->
getType
());
newNode
->
getWritableType
().
getQualifier
().
nonUniform
=
true
;
return
newNode
;
case
EOpConstructReference
:
// construct reference from reference
...
...
glslang/MachineIndependent/intermOut.cpp
View file @
88220d50
...
...
@@ -237,6 +237,7 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
case
EOpPostDecrement
:
out
.
debug
<<
"Post-Decrement"
;
break
;
case
EOpPreIncrement
:
out
.
debug
<<
"Pre-Increment"
;
break
;
case
EOpPreDecrement
:
out
.
debug
<<
"Pre-Decrement"
;
break
;
case
EOpCopyObject
:
out
.
debug
<<
"copy object"
;
break
;
// * -> bool
case
EOpConvInt8ToBool
:
out
.
debug
<<
"Convert int8_t to bool"
;
break
;
...
...
gtests/Spv.FromFile.cpp
View file @
88220d50
...
...
@@ -335,6 +335,7 @@ INSTANTIATE_TEST_CASE_P(
"spv.noDeadDecorations.vert"
,
"spv.nonSquare.vert"
,
"spv.nonuniform.frag"
,
"spv.nonuniform2.frag"
,
"spv.noWorkgroup.comp"
,
"spv.offsets.frag"
,
"spv.Operations.frag"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment