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
c4f5ec87
Commit
c4f5ec87
authored
Mar 30, 2018
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nonuniform: expand test for all types that can be arrayed.
parent
d89e5afa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
221 additions
and
35 deletions
+221
-35
spv.nonuniform.frag.out
Test/baseResults/spv.nonuniform.frag.out
+190
-27
spv.nonuniform.frag
Test/spv.nonuniform.frag
+23
-4
ParseHelper.cpp
glslang/MachineIndependent/ParseHelper.cpp
+8
-4
No files found.
Test/baseResults/spv.nonuniform.frag.out
View file @
c4f5ec87
spv.nonuniform.frag
WARNING: 0:8: '[]' : assuming array size of one for compile-time checking of binding numbers for unsized array
// Module Version 10000
// Generated by (magic number): 80006
// Id's are bound by
57
// Id's are bound by
166
Capability Shader
Capability InputAttachment
Capability SampledBuffer
Capability ImageBuffer
Capability CapabilityShaderNonUniformEXT
Capability CapabilityRuntimeDescriptorArrayEXT
Extension "SPV_EXT_descriptor_indexing"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 33
48
EntryPoint Fragment 4 "main" 33
90
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
SourceExtension "GL_EXT_nonuniform_qualifier"
...
...
@@ -26,8 +27,22 @@ WARNING: 0:8: '[]' : assuming array size of one for compile-time checking of bin
Name 30 "b"
Name 33 "nu_inv4"
Name 39 "nu_gf"
Name 46 "s2d"
Name 48 "nu_ii"
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 111 "sampledImage"
Name 125 "storageImage"
Name 137 "inputAttachment"
Name 147 "uniformTexelBuffer"
Name 158 "storageTexelBuffer"
Decorate 13 DecorationNonUniformEXT
Decorate 17(nu_li) DecorationNonUniformEXT
Decorate 19 DecorationNonUniformEXT
...
...
@@ -37,12 +52,42 @@ WARNING: 0:8: '[]' : assuming array size of one for compile-time checking of bin
Decorate 33(nu_inv4) DecorationNonUniformEXT
Decorate 39(nu_gf) DecorationNonUniformEXT
Decorate 40 DecorationNonUniformEXT
Decorate 46(s2d) DescriptorSet 0
Decorate 46(s2d) Binding 0
Decorate 48(nu_ii) Flat
Decorate 48(nu_ii) Location 1
Decorate 48(nu_ii) DecorationNonUniformEXT
Decorate 49 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
MemberDecorate 97(bname) 0 Offset 0
Decorate 97(bname) BufferBlock
Decorate 100(storageBuffer) DescriptorSet 0
Decorate 100(storageBuffer) Binding 4
Decorate 101 DecorationNonUniformEXT
Decorate 111(sampledImage) DescriptorSet 0
Decorate 111(sampledImage) Binding 5
Decorate 112 DecorationNonUniformEXT
Decorate 125(storageImage) DescriptorSet 0
Decorate 125(storageImage) Binding 6
Decorate 126 DecorationNonUniformEXT
Decorate 137(inputAttachment) DescriptorSet 0
Decorate 137(inputAttachment) Binding 7
Decorate 137(inputAttachment) InputAttachmentIndex 1
Decorate 138 DecorationNonUniformEXT
Decorate 147(uniformTexelBuffer) DescriptorSet 0
Decorate 147(uniformTexelBuffer) Binding 8
Decorate 148 DecorationNonUniformEXT
Decorate 158(storageTexelBuffer) DescriptorSet 0
Decorate 158(storageTexelBuffer) Binding 9
Decorate 159 DecorationNonUniformEXT
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
...
...
@@ -57,17 +102,61 @@ WARNING: 0:8: '[]' : assuming array size of one for compile-time checking of bin
34: TypeInt 32 0
35: 34(int) Constant 0
36: TypePointer Input 28(float)
42: TypeImage 28(float) 2D sampled format:Unknown
43: TypeSampledImage 42
44: TypeRuntimeArray 43
45: TypePointer UniformConstant 44
46(s2d): 45(ptr) Variable UniformConstant
47: TypePointer Input 6(int)
48(nu_ii): 47(ptr) Variable Input
50: TypePointer UniformConstant 43
53: TypeVector 28(float) 2
54: 28(float) Constant 1056964608
55: 53(fvec2) ConstantComposite 54 54
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
107: TypeImage 28(float) 2D sampled format:Unknown
108: TypeSampledImage 107
109: TypeRuntimeArray 108
110: TypePointer UniformConstant 109
111(sampledImage): 110(ptr) Variable UniformConstant
113: TypePointer UniformConstant 108
116: TypeVector 28(float) 2
117: 28(float) Constant 1056964608
118: 116(fvec2) ConstantComposite 117 117
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
4(main): 2 Function None 3
5: Label
16(a): 7(ptr) Variable Function
...
...
@@ -76,6 +165,7 @@ WARNING: 0:8: '[]' : assuming array size of one for compile-time checking of bin
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
19: 6(int) Load 17(nu_li)
Store 18(param) 19
21: 6(int) FunctionCall 11(foo(i1;i1;) 18(param) 20(param)
...
...
@@ -92,10 +182,83 @@ WARNING: 0:8: '[]' : assuming array size of one for compile-time checking of bin
40: 28(float) Load 39(nu_gf)
41: 28(float) FMul 38 40
Store 30(b) 41
49: 6(int) Load 48(nu_ii)
51: 50(ptr) AccessChain 46(s2d) 49
52: 43 Load 51
56: 31(fvec4) ImageSampleImplicitLod 52 55
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
106: 28(float) Load 30(b)
112: 6(int) Load 90(nu_ii)
114: 113(ptr) AccessChain 111(sampledImage) 112
115: 108 Load 114
119: 31(fvec4) ImageSampleImplicitLod 115 118
120: 28(float) CompositeExtract 119 0
121: 28(float) FAdd 106 120
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
Return
FunctionEnd
11(foo(i1;i1;): 6(int) Function None 8
...
...
Test/spv.nonuniform.frag
View file @
c4f5ec87
...
...
@@ -5,7 +5,17 @@
layout
(
location
=
0
)
nonuniformEXT
in
vec4
nu_inv4
;
nonuniformEXT
float
nu_gf
;
layout
(
location
=
1
)
in
nonuniformEXT
flat
int
nu_ii
;
layout
(
binding
=
0
)
uniform
sampler2D
s2d
[];
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
)
{
...
...
@@ -15,11 +25,21 @@ nonuniformEXT int foo(nonuniformEXT int nupi, nonuniformEXT out int f)
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
;
texture
(
s2d
[
nu_ii
],
vec2
(
0
.
5
));
}
\ No newline at end of file
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
;
}
glslang/MachineIndependent/ParseHelper.cpp
View file @
c4f5ec87
...
...
@@ -4679,11 +4679,15 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
if
(
type
.
getBasicType
()
==
EbtSampler
)
{
int
lastBinding
=
qualifier
.
layoutBinding
;
if
(
type
.
isArray
())
{
if
(
type
.
isSizedArray
())
lastBinding
+=
type
.
getCumulativeArraySize
();
else
{
if
(
spvVersion
.
vulkan
>
0
)
lastBinding
+=
1
;
warn
(
loc
,
"assuming array size of one for compile-time checking of binding numbers for unsized array"
,
"[]"
,
""
);
else
{
if
(
type
.
isSizedArray
())
lastBinding
+=
type
.
getCumulativeArraySize
();
else
{
lastBinding
+=
1
;
warn
(
loc
,
"assuming array size of one for compile-time checking of binding numbers for unsized array"
,
"[]"
,
""
);
}
}
}
if
(
spvVersion
.
vulkan
==
0
&&
lastBinding
>=
resources
.
maxCombinedTextureImageUnits
)
...
...
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