Merge pull request #3050 from Try/mesh-shader-ibo-fixup

mesh shader: fix implicit index-array size calculation for lines and triangles
This commit is contained in:
Jeremy Hayes 2022-10-31 15:38:24 -06:00 committed by GitHub
commit 1a8869e4d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 215 additions and 213 deletions

View File

@ -1,7 +1,7 @@
spv.460.subgroupEXT.mesh
// Module Version 10400
// Generated by (magic number): 8000b
// Id's are bound by 280
// Id's are bound by 279
Capability ClipDistance
Capability CullDistance
@ -19,7 +19,7 @@ spv.460.subgroupEXT.mesh
Extension "SPV_KHR_fragment_shading_rate"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint MeshEXT 4 "main" 35 41 57 109 148 162 163 168 169 172 173 174 175 176
EntryPoint MeshEXT 4 "main" 35 41 57 109 147 161 162 167 168 171 172 173 174 175
ExecutionMode 4 LocalSize 32 1 1
ExecutionMode 4 OutputVertices 81
ExecutionMode 4 OutputPrimitivesNV 32
@ -67,19 +67,19 @@ spv.460.subgroupEXT.mesh
MemberName 106(gl_MeshPerPrimitiveEXT) 3 "gl_CullPrimitiveEXT"
MemberName 106(gl_MeshPerPrimitiveEXT) 4 "gl_PrimitiveShadingRateEXT"
Name 109 "gl_MeshPrimitivesEXT"
Name 148 "gl_PrimitiveTriangleIndicesEXT"
Name 162 "gl_SubgroupSize"
Name 163 "gl_SubgroupInvocationID"
Name 168 "gl_NumSubgroups"
Name 169 "gl_SubgroupID"
Name 172 "gl_SubgroupEqMask"
Name 173 "gl_SubgroupGeMask"
Name 174 "gl_SubgroupGtMask"
Name 175 "gl_SubgroupLeMask"
Name 176 "gl_SubgroupLtMask"
Name 182 "ballot"
Name 219 "ballot"
Name 254 "ballot"
Name 147 "gl_PrimitiveTriangleIndicesEXT"
Name 161 "gl_SubgroupSize"
Name 162 "gl_SubgroupInvocationID"
Name 167 "gl_NumSubgroups"
Name 168 "gl_SubgroupID"
Name 171 "gl_SubgroupEqMask"
Name 172 "gl_SubgroupGeMask"
Name 173 "gl_SubgroupGtMask"
Name 174 "gl_SubgroupLeMask"
Name 175 "gl_SubgroupLtMask"
Name 181 "ballot"
Name 218 "ballot"
Name 253 "ballot"
Decorate 35(gl_LocalInvocationID) BuiltIn LocalInvocationId
Decorate 41(gl_WorkGroupID) BuiltIn WorkgroupId
MemberDecorate 54(gl_MeshPerVertexEXT) 0 BuiltIn Position
@ -98,19 +98,19 @@ spv.460.subgroupEXT.mesh
MemberDecorate 106(gl_MeshPerPrimitiveEXT) 4 PerPrimitiveNV
MemberDecorate 106(gl_MeshPerPrimitiveEXT) 4 BuiltIn PrimitiveShadingRateKHR
Decorate 106(gl_MeshPerPrimitiveEXT) Block
Decorate 148(gl_PrimitiveTriangleIndicesEXT) BuiltIn PrimitiveTriangleIndicesEXT
Decorate 162(gl_SubgroupSize) RelaxedPrecision
Decorate 162(gl_SubgroupSize) BuiltIn SubgroupSize
Decorate 163(gl_SubgroupInvocationID) RelaxedPrecision
Decorate 163(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId
Decorate 168(gl_NumSubgroups) BuiltIn NumSubgroups
Decorate 169(gl_SubgroupID) BuiltIn SubgroupId
Decorate 172(gl_SubgroupEqMask) BuiltIn SubgroupEqMaskKHR
Decorate 173(gl_SubgroupGeMask) BuiltIn SubgroupGeMaskKHR
Decorate 174(gl_SubgroupGtMask) BuiltIn SubgroupGtMaskKHR
Decorate 175(gl_SubgroupLeMask) BuiltIn SubgroupLeMaskKHR
Decorate 176(gl_SubgroupLtMask) BuiltIn SubgroupLtMaskKHR
Decorate 279 BuiltIn WorkgroupSize
Decorate 147(gl_PrimitiveTriangleIndicesEXT) BuiltIn PrimitiveTriangleIndicesEXT
Decorate 161(gl_SubgroupSize) RelaxedPrecision
Decorate 161(gl_SubgroupSize) BuiltIn SubgroupSize
Decorate 162(gl_SubgroupInvocationID) RelaxedPrecision
Decorate 162(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId
Decorate 167(gl_NumSubgroups) BuiltIn NumSubgroups
Decorate 168(gl_SubgroupID) BuiltIn SubgroupId
Decorate 171(gl_SubgroupEqMask) BuiltIn SubgroupEqMaskKHR
Decorate 172(gl_SubgroupGeMask) BuiltIn SubgroupGeMaskKHR
Decorate 173(gl_SubgroupGtMask) BuiltIn SubgroupGtMaskKHR
Decorate 174(gl_SubgroupLeMask) BuiltIn SubgroupLeMaskKHR
Decorate 175(gl_SubgroupLtMask) BuiltIn SubgroupLtMaskKHR
Decorate 278 BuiltIn WorkgroupSize
2: TypeVoid
3: TypeFunction 2
8: TypeFloat 32
@ -161,33 +161,32 @@ spv.460.subgroupEXT.mesh
118: 59(int) Constant 8
121: 105(bool) ConstantFalse
122: TypePointer Output 105(bool)
145: 30(int) Constant 96
146: TypeArray 33(ivec3) 145
147: TypePointer Output 146
148(gl_PrimitiveTriangleIndicesEXT): 147(ptr) Variable Output
149: 33(ivec3) ConstantComposite 78 78 78
150: TypePointer Output 33(ivec3)
154: 33(ivec3) ConstantComposite 80 80 80
162(gl_SubgroupSize): 37(ptr) Variable Input
163(gl_SubgroupInvocationID): 37(ptr) Variable Input
164: 30(int) Constant 3400
165: 30(int) Constant 72
166: 30(int) Constant 2056
168(gl_NumSubgroups): 37(ptr) Variable Input
169(gl_SubgroupID): 37(ptr) Variable Input
170: TypeVector 30(int) 4
171: TypePointer Input 170(ivec4)
172(gl_SubgroupEqMask): 171(ptr) Variable Input
173(gl_SubgroupGeMask): 171(ptr) Variable Input
174(gl_SubgroupGtMask): 171(ptr) Variable Input
175(gl_SubgroupLeMask): 171(ptr) Variable Input
176(gl_SubgroupLtMask): 171(ptr) Variable Input
181: TypePointer Function 170(ivec4)
184: 170(ivec4) ConstantComposite 78 78 78 78
198: 105(bool) ConstantTrue
255: 30(int) Constant 85
256: 170(ivec4) ConstantComposite 255 36 36 36
279: 33(ivec3) ConstantComposite 47 78 78
145: TypeArray 33(ivec3) 47
146: TypePointer Output 145
147(gl_PrimitiveTriangleIndicesEXT): 146(ptr) Variable Output
148: 33(ivec3) ConstantComposite 78 78 78
149: TypePointer Output 33(ivec3)
153: 33(ivec3) ConstantComposite 80 80 80
161(gl_SubgroupSize): 37(ptr) Variable Input
162(gl_SubgroupInvocationID): 37(ptr) Variable Input
163: 30(int) Constant 3400
164: 30(int) Constant 72
165: 30(int) Constant 2056
167(gl_NumSubgroups): 37(ptr) Variable Input
168(gl_SubgroupID): 37(ptr) Variable Input
169: TypeVector 30(int) 4
170: TypePointer Input 169(ivec4)
171(gl_SubgroupEqMask): 170(ptr) Variable Input
172(gl_SubgroupGeMask): 170(ptr) Variable Input
173(gl_SubgroupGtMask): 170(ptr) Variable Input
174(gl_SubgroupLeMask): 170(ptr) Variable Input
175(gl_SubgroupLtMask): 170(ptr) Variable Input
180: TypePointer Function 169(ivec4)
183: 169(ivec4) ConstantComposite 78 78 78 78
197: 105(bool) ConstantTrue
254: 30(int) Constant 85
255: 169(ivec4) ConstantComposite 254 36 36 36
278: 33(ivec3) ConstantComposite 47 78 78
4(main): 2 Function None 3
5: Label
32(iid): 31(ptr) Variable Function
@ -290,159 +289,159 @@ spv.460.subgroupEXT.mesh
Store 144 121
MemoryBarrier 78 79
ControlBarrier 80 80 79
151: 150(ptr) AccessChain 148(gl_PrimitiveTriangleIndicesEXT) 60
Store 151 149
152: 30(int) Load 46(primitiveCount)
153: 30(int) ISub 152 78
155: 150(ptr) AccessChain 148(gl_PrimitiveTriangleIndicesEXT) 153
Store 155 154
150: 149(ptr) AccessChain 147(gl_PrimitiveTriangleIndicesEXT) 60
Store 150 148
151: 30(int) Load 46(primitiveCount)
152: 30(int) ISub 151 78
154: 149(ptr) AccessChain 147(gl_PrimitiveTriangleIndicesEXT) 152
Store 154 153
155: 30(int) Load 40(gid)
156: 30(int) Load 40(gid)
157: 30(int) Load 40(gid)
158: 30(int) ISub 157 78
159: 150(ptr) AccessChain 148(gl_PrimitiveTriangleIndicesEXT) 158
160: 33(ivec3) Load 159
161: 150(ptr) AccessChain 148(gl_PrimitiveTriangleIndicesEXT) 156
Store 161 160
157: 30(int) ISub 156 78
158: 149(ptr) AccessChain 147(gl_PrimitiveTriangleIndicesEXT) 157
159: 33(ivec3) Load 158
160: 149(ptr) AccessChain 147(gl_PrimitiveTriangleIndicesEXT) 155
Store 160 159
MemoryBarrier 78 79
ControlBarrier 80 80 79
Return
FunctionEnd
6(basic_works(): 2 Function None 3
7: Label
ControlBarrier 52 52 164
ControlBarrier 52 52 163
MemoryBarrier 52 163
MemoryBarrier 52 164
MemoryBarrier 52 165
MemoryBarrier 52 166
167: 105(bool) GroupNonUniformElect 52
166: 105(bool) GroupNonUniformElect 52
MemoryBarrier 52 79
Return
FunctionEnd
13(ballot_works(vf4;): 2 Function None 11
12(f4): 10(ptr) FunctionParameter
14: Label
182(ballot): 181(ptr) Variable Function
177: 9(fvec4) Load 12(f4)
178: 9(fvec4) GroupNonUniformBroadcast 52 177 36
179: 9(fvec4) Load 12(f4)
180: 9(fvec4) GroupNonUniformBroadcastFirst 52 179
183: 170(ivec4) GroupNonUniformBallot 52 121
Store 182(ballot) 183
185: 105(bool) GroupNonUniformInverseBallot 52 184
186: 170(ivec4) Load 182(ballot)
187: 105(bool) GroupNonUniformBallotBitExtract 52 186 36
188: 170(ivec4) Load 182(ballot)
189: 30(int) GroupNonUniformBallotBitCount 52 Reduce 188
190: 170(ivec4) Load 182(ballot)
191: 30(int) GroupNonUniformBallotBitCount 52 InclusiveScan 190
192: 170(ivec4) Load 182(ballot)
193: 30(int) GroupNonUniformBallotBitCount 52 ExclusiveScan 192
194: 170(ivec4) Load 182(ballot)
195: 30(int) GroupNonUniformBallotFindLSB 52 194
196: 170(ivec4) Load 182(ballot)
197: 30(int) GroupNonUniformBallotFindMSB 52 196
181(ballot): 180(ptr) Variable Function
176: 9(fvec4) Load 12(f4)
177: 9(fvec4) GroupNonUniformBroadcast 52 176 36
178: 9(fvec4) Load 12(f4)
179: 9(fvec4) GroupNonUniformBroadcastFirst 52 178
182: 169(ivec4) GroupNonUniformBallot 52 121
Store 181(ballot) 182
184: 105(bool) GroupNonUniformInverseBallot 52 183
185: 169(ivec4) Load 181(ballot)
186: 105(bool) GroupNonUniformBallotBitExtract 52 185 36
187: 169(ivec4) Load 181(ballot)
188: 30(int) GroupNonUniformBallotBitCount 52 Reduce 187
189: 169(ivec4) Load 181(ballot)
190: 30(int) GroupNonUniformBallotBitCount 52 InclusiveScan 189
191: 169(ivec4) Load 181(ballot)
192: 30(int) GroupNonUniformBallotBitCount 52 ExclusiveScan 191
193: 169(ivec4) Load 181(ballot)
194: 30(int) GroupNonUniformBallotFindLSB 52 193
195: 169(ivec4) Load 181(ballot)
196: 30(int) GroupNonUniformBallotFindMSB 52 195
Return
FunctionEnd
16(vote_works(vf4;): 2 Function None 11
15(f4): 10(ptr) FunctionParameter
17: Label
199: 105(bool) GroupNonUniformAll 52 198
200: 105(bool) GroupNonUniformAny 52 121
201: 9(fvec4) Load 15(f4)
202: 105(bool) GroupNonUniformAllEqual 52 201
198: 105(bool) GroupNonUniformAll 52 197
199: 105(bool) GroupNonUniformAny 52 121
200: 9(fvec4) Load 15(f4)
201: 105(bool) GroupNonUniformAllEqual 52 200
Return
FunctionEnd
19(shuffle_works(vf4;): 2 Function None 11
18(f4): 10(ptr) FunctionParameter
20: Label
203: 9(fvec4) Load 18(f4)
204: 9(fvec4) GroupNonUniformShuffle 52 203 36
205: 9(fvec4) Load 18(f4)
206: 9(fvec4) GroupNonUniformShuffleXor 52 205 78
207: 9(fvec4) Load 18(f4)
208: 9(fvec4) GroupNonUniformShuffleUp 52 207 78
209: 9(fvec4) Load 18(f4)
210: 9(fvec4) GroupNonUniformShuffleDown 52 209 78
202: 9(fvec4) Load 18(f4)
203: 9(fvec4) GroupNonUniformShuffle 52 202 36
204: 9(fvec4) Load 18(f4)
205: 9(fvec4) GroupNonUniformShuffleXor 52 204 78
206: 9(fvec4) Load 18(f4)
207: 9(fvec4) GroupNonUniformShuffleUp 52 206 78
208: 9(fvec4) Load 18(f4)
209: 9(fvec4) GroupNonUniformShuffleDown 52 208 78
Return
FunctionEnd
22(arith_works(vf4;): 2 Function None 11
21(f4): 10(ptr) FunctionParameter
23: Label
219(ballot): 181(ptr) Variable Function
211: 9(fvec4) Load 21(f4)
212: 9(fvec4) GroupNonUniformFAdd 52 Reduce 211
213: 9(fvec4) Load 21(f4)
214: 9(fvec4) GroupNonUniformFMul 52 Reduce 213
215: 9(fvec4) Load 21(f4)
216: 9(fvec4) GroupNonUniformFMin 52 Reduce 215
217: 9(fvec4) Load 21(f4)
218: 9(fvec4) GroupNonUniformFMax 52 Reduce 217
220: 170(ivec4) Load 219(ballot)
221: 170(ivec4) GroupNonUniformBitwiseAnd 52 Reduce 220
222: 170(ivec4) Load 219(ballot)
223: 170(ivec4) GroupNonUniformBitwiseOr 52 Reduce 222
224: 170(ivec4) Load 219(ballot)
225: 170(ivec4) GroupNonUniformBitwiseXor 52 Reduce 224
226: 9(fvec4) Load 21(f4)
227: 9(fvec4) GroupNonUniformFAdd 52 InclusiveScan 226
228: 9(fvec4) Load 21(f4)
229: 9(fvec4) GroupNonUniformFMul 52 InclusiveScan 228
230: 9(fvec4) Load 21(f4)
231: 9(fvec4) GroupNonUniformFMin 52 InclusiveScan 230
232: 9(fvec4) Load 21(f4)
233: 9(fvec4) GroupNonUniformFMax 52 InclusiveScan 232
234: 170(ivec4) Load 219(ballot)
235: 170(ivec4) GroupNonUniformBitwiseAnd 52 InclusiveScan 234
236: 170(ivec4) Load 219(ballot)
237: 170(ivec4) GroupNonUniformBitwiseOr 52 InclusiveScan 236
238: 170(ivec4) Load 219(ballot)
239: 170(ivec4) GroupNonUniformBitwiseXor 52 InclusiveScan 238
240: 9(fvec4) Load 21(f4)
241: 9(fvec4) GroupNonUniformFAdd 52 ExclusiveScan 240
242: 9(fvec4) Load 21(f4)
243: 9(fvec4) GroupNonUniformFMul 52 ExclusiveScan 242
244: 9(fvec4) Load 21(f4)
245: 9(fvec4) GroupNonUniformFMin 52 ExclusiveScan 244
246: 9(fvec4) Load 21(f4)
247: 9(fvec4) GroupNonUniformFMax 52 ExclusiveScan 246
248: 170(ivec4) Load 219(ballot)
249: 170(ivec4) GroupNonUniformBitwiseAnd 52 ExclusiveScan 248
250: 170(ivec4) Load 219(ballot)
251: 170(ivec4) GroupNonUniformBitwiseOr 52 ExclusiveScan 250
252: 170(ivec4) Load 219(ballot)
253: 170(ivec4) GroupNonUniformBitwiseXor 52 ExclusiveScan 252
218(ballot): 180(ptr) Variable Function
210: 9(fvec4) Load 21(f4)
211: 9(fvec4) GroupNonUniformFAdd 52 Reduce 210
212: 9(fvec4) Load 21(f4)
213: 9(fvec4) GroupNonUniformFMul 52 Reduce 212
214: 9(fvec4) Load 21(f4)
215: 9(fvec4) GroupNonUniformFMin 52 Reduce 214
216: 9(fvec4) Load 21(f4)
217: 9(fvec4) GroupNonUniformFMax 52 Reduce 216
219: 169(ivec4) Load 218(ballot)
220: 169(ivec4) GroupNonUniformBitwiseAnd 52 Reduce 219
221: 169(ivec4) Load 218(ballot)
222: 169(ivec4) GroupNonUniformBitwiseOr 52 Reduce 221
223: 169(ivec4) Load 218(ballot)
224: 169(ivec4) GroupNonUniformBitwiseXor 52 Reduce 223
225: 9(fvec4) Load 21(f4)
226: 9(fvec4) GroupNonUniformFAdd 52 InclusiveScan 225
227: 9(fvec4) Load 21(f4)
228: 9(fvec4) GroupNonUniformFMul 52 InclusiveScan 227
229: 9(fvec4) Load 21(f4)
230: 9(fvec4) GroupNonUniformFMin 52 InclusiveScan 229
231: 9(fvec4) Load 21(f4)
232: 9(fvec4) GroupNonUniformFMax 52 InclusiveScan 231
233: 169(ivec4) Load 218(ballot)
234: 169(ivec4) GroupNonUniformBitwiseAnd 52 InclusiveScan 233
235: 169(ivec4) Load 218(ballot)
236: 169(ivec4) GroupNonUniformBitwiseOr 52 InclusiveScan 235
237: 169(ivec4) Load 218(ballot)
238: 169(ivec4) GroupNonUniformBitwiseXor 52 InclusiveScan 237
239: 9(fvec4) Load 21(f4)
240: 9(fvec4) GroupNonUniformFAdd 52 ExclusiveScan 239
241: 9(fvec4) Load 21(f4)
242: 9(fvec4) GroupNonUniformFMul 52 ExclusiveScan 241
243: 9(fvec4) Load 21(f4)
244: 9(fvec4) GroupNonUniformFMin 52 ExclusiveScan 243
245: 9(fvec4) Load 21(f4)
246: 9(fvec4) GroupNonUniformFMax 52 ExclusiveScan 245
247: 169(ivec4) Load 218(ballot)
248: 169(ivec4) GroupNonUniformBitwiseAnd 52 ExclusiveScan 247
249: 169(ivec4) Load 218(ballot)
250: 169(ivec4) GroupNonUniformBitwiseOr 52 ExclusiveScan 249
251: 169(ivec4) Load 218(ballot)
252: 169(ivec4) GroupNonUniformBitwiseXor 52 ExclusiveScan 251
Return
FunctionEnd
25(clustered_works(vf4;): 2 Function None 11
24(f4): 10(ptr) FunctionParameter
26: Label
254(ballot): 181(ptr) Variable Function
Store 254(ballot) 256
257: 9(fvec4) Load 24(f4)
258: 9(fvec4) GroupNonUniformFAdd 52 ClusteredReduce 257 80
259: 9(fvec4) Load 24(f4)
260: 9(fvec4) GroupNonUniformFMul 52 ClusteredReduce 259 80
261: 9(fvec4) Load 24(f4)
262: 9(fvec4) GroupNonUniformFMin 52 ClusteredReduce 261 80
263: 9(fvec4) Load 24(f4)
264: 9(fvec4) GroupNonUniformFMax 52 ClusteredReduce 263 80
265: 170(ivec4) Load 254(ballot)
266: 170(ivec4) GroupNonUniformBitwiseAnd 52 ClusteredReduce 265 80
267: 170(ivec4) Load 254(ballot)
268: 170(ivec4) GroupNonUniformBitwiseOr 52 ClusteredReduce 267 80
269: 170(ivec4) Load 254(ballot)
270: 170(ivec4) GroupNonUniformBitwiseXor 52 ClusteredReduce 269 80
253(ballot): 180(ptr) Variable Function
Store 253(ballot) 255
256: 9(fvec4) Load 24(f4)
257: 9(fvec4) GroupNonUniformFAdd 52 ClusteredReduce 256 80
258: 9(fvec4) Load 24(f4)
259: 9(fvec4) GroupNonUniformFMul 52 ClusteredReduce 258 80
260: 9(fvec4) Load 24(f4)
261: 9(fvec4) GroupNonUniformFMin 52 ClusteredReduce 260 80
262: 9(fvec4) Load 24(f4)
263: 9(fvec4) GroupNonUniformFMax 52 ClusteredReduce 262 80
264: 169(ivec4) Load 253(ballot)
265: 169(ivec4) GroupNonUniformBitwiseAnd 52 ClusteredReduce 264 80
266: 169(ivec4) Load 253(ballot)
267: 169(ivec4) GroupNonUniformBitwiseOr 52 ClusteredReduce 266 80
268: 169(ivec4) Load 253(ballot)
269: 169(ivec4) GroupNonUniformBitwiseXor 52 ClusteredReduce 268 80
Return
FunctionEnd
28(quad_works(vf4;): 2 Function None 11
27(f4): 10(ptr) FunctionParameter
29: Label
271: 9(fvec4) Load 27(f4)
272: 9(fvec4) GroupNonUniformQuadBroadcast 52 271 36
273: 9(fvec4) Load 27(f4)
274: 9(fvec4) GroupNonUniformQuadSwap 52 273 36
275: 9(fvec4) Load 27(f4)
276: 9(fvec4) GroupNonUniformQuadSwap 52 275 78
277: 9(fvec4) Load 27(f4)
278: 9(fvec4) GroupNonUniformQuadSwap 52 277 80
270: 9(fvec4) Load 27(f4)
271: 9(fvec4) GroupNonUniformQuadBroadcast 52 270 36
272: 9(fvec4) Load 27(f4)
273: 9(fvec4) GroupNonUniformQuadSwap 52 272 36
274: 9(fvec4) Load 27(f4)
275: 9(fvec4) GroupNonUniformQuadSwap 52 274 78
276: 9(fvec4) Load 27(f4)
277: 9(fvec4) GroupNonUniformQuadSwap 52 276 80
Return
FunctionEnd

View File

@ -1,7 +1,7 @@
spv.ext.meshShaderBuiltins.mesh
// Module Version 10400
// Generated by (magic number): 8000b
// Id's are bound by 159
// Id's are bound by 158
Capability ClipDistance
Capability CullDistance
@ -13,7 +13,7 @@ spv.ext.meshShaderBuiltins.mesh
Extension "SPV_KHR_fragment_shading_rate"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint MeshEXT 4 "main" 13 19 24 41 93 135 153 156
EntryPoint MeshEXT 4 "main" 13 19 24 41 93 134 152 155
ExecutionMode 4 LocalSize 32 1 1
ExecutionMode 4 OutputVertices 81
ExecutionMode 4 OutputPrimitivesNV 32
@ -45,11 +45,11 @@ spv.ext.meshShaderBuiltins.mesh
MemberName 90(gl_MeshPerPrimitiveEXT) 3 "gl_CullPrimitiveEXT"
MemberName 90(gl_MeshPerPrimitiveEXT) 4 "gl_PrimitiveShadingRateEXT"
Name 93 "gl_MeshPrimitivesEXT"
Name 135 "gl_PrimitiveTriangleIndicesEXT"
Name 151 "id"
Name 153 "gl_DrawIDARB"
Name 155 "viewIdx"
Name 156 "gl_ViewIndex"
Name 134 "gl_PrimitiveTriangleIndicesEXT"
Name 150 "id"
Name 152 "gl_DrawIDARB"
Name 154 "viewIdx"
Name 155 "gl_ViewIndex"
Decorate 13(gl_LocalInvocationID) BuiltIn LocalInvocationId
Decorate 19(gl_WorkGroupID) BuiltIn WorkgroupId
Decorate 24(gl_NumWorkGroups) BuiltIn NumWorkgroups
@ -69,10 +69,10 @@ spv.ext.meshShaderBuiltins.mesh
MemberDecorate 90(gl_MeshPerPrimitiveEXT) 4 PerPrimitiveNV
MemberDecorate 90(gl_MeshPerPrimitiveEXT) 4 BuiltIn PrimitiveShadingRateKHR
Decorate 90(gl_MeshPerPrimitiveEXT) Block
Decorate 135(gl_PrimitiveTriangleIndicesEXT) BuiltIn PrimitiveTriangleIndicesEXT
Decorate 153(gl_DrawIDARB) BuiltIn DrawIndex
Decorate 156(gl_ViewIndex) BuiltIn ViewIndex
Decorate 158 BuiltIn WorkgroupSize
Decorate 134(gl_PrimitiveTriangleIndicesEXT) BuiltIn PrimitiveTriangleIndicesEXT
Decorate 152(gl_DrawIDARB) BuiltIn DrawIndex
Decorate 155(gl_ViewIndex) BuiltIn ViewIndex
Decorate 157 BuiltIn WorkgroupSize
2: TypeVoid
3: TypeFunction 2
8: TypeInt 32 0
@ -123,19 +123,18 @@ spv.ext.meshShaderBuiltins.mesh
102: 43(int) Constant 8
105: 89(bool) ConstantFalse
106: TypePointer Output 89(bool)
132: 8(int) Constant 96
133: TypeArray 11(ivec3) 132
134: TypePointer Output 133
135(gl_PrimitiveTriangleIndicesEXT): 134(ptr) Variable Output
136: 8(int) Constant 257
137: 11(ivec3) ConstantComposite 136 136 136
138: TypePointer Output 11(ivec3)
142: 11(ivec3) ConstantComposite 64 64 64
150: TypePointer Function 43(int)
152: TypePointer Input 43(int)
153(gl_DrawIDARB): 152(ptr) Variable Input
156(gl_ViewIndex): 152(ptr) Variable Input
158: 11(ivec3) ConstantComposite 29 62 62
132: TypeArray 11(ivec3) 29
133: TypePointer Output 132
134(gl_PrimitiveTriangleIndicesEXT): 133(ptr) Variable Output
135: 8(int) Constant 257
136: 11(ivec3) ConstantComposite 135 135 135
137: TypePointer Output 11(ivec3)
141: 11(ivec3) ConstantComposite 64 64 64
149: TypePointer Function 43(int)
151: TypePointer Input 43(int)
152(gl_DrawIDARB): 151(ptr) Variable Input
155(gl_ViewIndex): 151(ptr) Variable Input
157: 11(ivec3) ConstantComposite 29 62 62
4(main): 2 Function None 3
5: Label
10(iid): 9(ptr) Variable Function
@ -244,30 +243,30 @@ spv.ext.meshShaderBuiltins.mesh
Store 131 130
MemoryBarrier 62 63
ControlBarrier 64 64 63
139: 138(ptr) AccessChain 135(gl_PrimitiveTriangleIndicesEXT) 44
Store 139 137
140: 8(int) Load 28(primitiveCount)
141: 8(int) ISub 140 62
143: 138(ptr) AccessChain 135(gl_PrimitiveTriangleIndicesEXT) 141
Store 143 142
138: 137(ptr) AccessChain 134(gl_PrimitiveTriangleIndicesEXT) 44
Store 138 136
139: 8(int) Load 28(primitiveCount)
140: 8(int) ISub 139 62
142: 137(ptr) AccessChain 134(gl_PrimitiveTriangleIndicesEXT) 140
Store 142 141
143: 8(int) Load 18(gid)
144: 8(int) Load 18(gid)
145: 8(int) Load 18(gid)
146: 8(int) ISub 145 62
147: 138(ptr) AccessChain 135(gl_PrimitiveTriangleIndicesEXT) 146
148: 11(ivec3) Load 147
149: 138(ptr) AccessChain 135(gl_PrimitiveTriangleIndicesEXT) 144
Store 149 148
145: 8(int) ISub 144 62
146: 137(ptr) AccessChain 134(gl_PrimitiveTriangleIndicesEXT) 145
147: 11(ivec3) Load 146
148: 137(ptr) AccessChain 134(gl_PrimitiveTriangleIndicesEXT) 143
Store 148 147
MemoryBarrier 62 63
ControlBarrier 64 64 63
Return
FunctionEnd
6(testAdditionalBuiltins(): 2 Function None 3
7: Label
151(id): 150(ptr) Variable Function
155(viewIdx): 150(ptr) Variable Function
154: 43(int) Load 153(gl_DrawIDARB)
Store 151(id) 154
157: 43(int) Load 156(gl_ViewIndex)
Store 155(viewIdx) 157
150(id): 149(ptr) Variable Function
154(viewIdx): 149(ptr) Variable Function
153: 43(int) Load 152(gl_DrawIDARB)
Store 150(id) 153
156: 43(int) Load 155(gl_ViewIndex)
Store 154(viewIdx) 156
Return
FunctionEnd

View File

@ -836,12 +836,16 @@ int TParseContext::getIoArrayImplicitSize(const TQualifier &qualifier, TString *
} else if (language == EShLangMesh) {
unsigned int maxPrimitives =
intermediate.getPrimitives() != TQualifier::layoutNotSet ? intermediate.getPrimitives() : 0;
if (qualifier.builtIn == EbvPrimitiveIndicesNV || qualifier.builtIn == EbvPrimitiveTriangleIndicesEXT ||
qualifier.builtIn == EbvPrimitiveLineIndicesEXT || qualifier.builtIn == EbvPrimitivePointIndicesEXT) {
if (qualifier.builtIn == EbvPrimitiveIndicesNV) {
expectedSize = maxPrimitives * TQualifier::mapGeometryToSize(intermediate.getOutputPrimitive());
str = "max_primitives*";
str += TQualifier::getGeometryString(intermediate.getOutputPrimitive());
}
else if (qualifier.builtIn == EbvPrimitiveTriangleIndicesEXT || qualifier.builtIn == EbvPrimitiveLineIndicesEXT ||
qualifier.builtIn == EbvPrimitivePointIndicesEXT) {
expectedSize = maxPrimitives;
str = "max_primitives";
}
else if (qualifier.isPerPrimitive()) {
expectedSize = maxPrimitives;
str = "max_primitives";