Merge pull request #3023 from pmistryNV/GL_EXT_mesh_shader

Make OpEmitMeshTasksEXT a terminal instruction
This commit is contained in:
Greg Fischer 2022-09-09 11:44:17 -06:00 committed by GitHub
commit df7fec2cfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 158 additions and 158 deletions

View File

@ -8597,6 +8597,8 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
if(taskPayloadID)
operands.push_back(taskPayloadID);
builder.createNoResultOp(spv::OpEmitMeshTasksEXT, operands);
// Make it a terminating instruction in the current block
builder.createAndSetNoPredecessorBlock("post-OpEmitMeshTasksEXT");
return 0;
case glslang::EOpSetMeshOutputsEXT:
builder.createNoResultOp(spv::OpSetMeshOutputsEXT, operands);

View File

@ -844,6 +844,7 @@ public:
void createConditionalBranch(Id condition, Block* thenBlock, Block* elseBlock);
void createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control,
const std::vector<unsigned int>& operands);
void createAndSetNoPredecessorBlock(const char*);
// Sets to generate opcode for specialization constants.
void setToSpecConstCodeGenMode() { generatingOpCodeForSpecConst = true; }
@ -863,7 +864,6 @@ public:
void remapDynamicSwizzle();
void transferAccessChainSwizzle(bool dynamic);
void simplifyAccessChainSwizzle();
void createAndSetNoPredecessorBlock(const char*);
void createSelectionMerge(Block* mergeBlock, unsigned int control);
void dumpSourceInstructions(std::vector<unsigned int>&) const;
void dumpSourceInstructions(const spv::Id fileId, const std::string& text, std::vector<unsigned int>&) const;

View File

@ -1,7 +1,7 @@
spv.460.subgroupEXT.task
// Module Version 10400
// Generated by (magic number): 8000a
// Id's are bound by 242
// Id's are bound by 243
Capability StorageImageWriteWithoutFormat
Capability GroupNonUniform
@ -16,7 +16,7 @@ spv.460.subgroupEXT.task
Extension "SPV_EXT_mesh_shader"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint TaskEXT 4 "main" 35 41 56 61 77 102 122 123 128 129 132 133 134 135 136
EntryPoint TaskEXT 4 "main" 35 41 56 61 77 102 123 124 129 130 133 134 135 136 137
ExecutionMode 4 LocalSize 32 1 1
Source GLSL 460
SourceExtension "GL_EXT_mesh_shader"
@ -56,18 +56,18 @@ spv.460.subgroupEXT.task
MemberName 100(Task) 0 "dummy"
MemberName 100(Task) 1 "submesh"
Name 102 "mytask"
Name 122 "gl_SubgroupSize"
Name 123 "gl_SubgroupInvocationID"
Name 128 "gl_NumSubgroups"
Name 129 "gl_SubgroupID"
Name 132 "gl_SubgroupEqMask"
Name 133 "gl_SubgroupGeMask"
Name 134 "gl_SubgroupGtMask"
Name 135 "gl_SubgroupLeMask"
Name 136 "gl_SubgroupLtMask"
Name 142 "ballot"
Name 180 "ballot"
Name 215 "ballot"
Name 123 "gl_SubgroupSize"
Name 124 "gl_SubgroupInvocationID"
Name 129 "gl_NumSubgroups"
Name 130 "gl_SubgroupID"
Name 133 "gl_SubgroupEqMask"
Name 134 "gl_SubgroupGeMask"
Name 135 "gl_SubgroupGtMask"
Name 136 "gl_SubgroupLeMask"
Name 137 "gl_SubgroupLtMask"
Name 143 "ballot"
Name 181 "ballot"
Name 216 "ballot"
Decorate 35(gl_LocalInvocationID) BuiltIn LocalInvocationId
Decorate 41(gl_WorkGroupID) BuiltIn WorkgroupId
MemberDecorate 59(block0) 0 Offset 0
@ -77,18 +77,18 @@ spv.460.subgroupEXT.task
Decorate 77(uni_image) DescriptorSet 0
Decorate 77(uni_image) Binding 0
Decorate 77(uni_image) NonReadable
Decorate 122(gl_SubgroupSize) RelaxedPrecision
Decorate 122(gl_SubgroupSize) BuiltIn SubgroupSize
Decorate 123(gl_SubgroupInvocationID) RelaxedPrecision
Decorate 123(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId
Decorate 128(gl_NumSubgroups) BuiltIn NumSubgroups
Decorate 129(gl_SubgroupID) BuiltIn SubgroupId
Decorate 132(gl_SubgroupEqMask) BuiltIn SubgroupEqMaskKHR
Decorate 133(gl_SubgroupGeMask) BuiltIn SubgroupGeMaskKHR
Decorate 134(gl_SubgroupGtMask) BuiltIn SubgroupGtMaskKHR
Decorate 135(gl_SubgroupLeMask) BuiltIn SubgroupLeMaskKHR
Decorate 136(gl_SubgroupLtMask) BuiltIn SubgroupLtMaskKHR
Decorate 241 BuiltIn WorkgroupSize
Decorate 123(gl_SubgroupSize) RelaxedPrecision
Decorate 123(gl_SubgroupSize) BuiltIn SubgroupSize
Decorate 124(gl_SubgroupInvocationID) RelaxedPrecision
Decorate 124(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId
Decorate 129(gl_NumSubgroups) BuiltIn NumSubgroups
Decorate 130(gl_SubgroupID) BuiltIn SubgroupId
Decorate 133(gl_SubgroupEqMask) BuiltIn SubgroupEqMaskKHR
Decorate 134(gl_SubgroupGeMask) BuiltIn SubgroupGeMaskKHR
Decorate 135(gl_SubgroupGtMask) BuiltIn SubgroupGtMaskKHR
Decorate 136(gl_SubgroupLeMask) BuiltIn SubgroupLeMaskKHR
Decorate 137(gl_SubgroupLtMask) BuiltIn SubgroupLtMaskKHR
Decorate 242 BuiltIn WorkgroupSize
2: TypeVoid
3: TypeFunction 2
8: TypeFloat 32
@ -140,28 +140,28 @@ spv.460.subgroupEXT.task
113: 8(float) Constant 1108082688
114: 97(fvec2) ConstantComposite 112 113
116: 62(int) Constant 2
122(gl_SubgroupSize): 37(ptr) Variable Input
123(gl_SubgroupInvocationID): 37(ptr) Variable Input
124: 30(int) Constant 3400
125: 30(int) Constant 72
126: 30(int) Constant 2056
128(gl_NumSubgroups): 37(ptr) Variable Input
129(gl_SubgroupID): 37(ptr) Variable Input
130: TypeVector 30(int) 4
131: TypePointer Input 130(ivec4)
132(gl_SubgroupEqMask): 131(ptr) Variable Input
133(gl_SubgroupGeMask): 131(ptr) Variable Input
134(gl_SubgroupGtMask): 131(ptr) Variable Input
135(gl_SubgroupLeMask): 131(ptr) Variable Input
136(gl_SubgroupLtMask): 131(ptr) Variable Input
141: TypePointer Function 130(ivec4)
143: 52(bool) ConstantFalse
145: 130(ivec4) ConstantComposite 91 91 91 91
159: 52(bool) ConstantTrue
216: 30(int) Constant 85
217: 130(ivec4) ConstantComposite 216 36 36 36
240: 30(int) Constant 32
241: 33(ivec3) ConstantComposite 240 91 91
123(gl_SubgroupSize): 37(ptr) Variable Input
124(gl_SubgroupInvocationID): 37(ptr) Variable Input
125: 30(int) Constant 3400
126: 30(int) Constant 72
127: 30(int) Constant 2056
129(gl_NumSubgroups): 37(ptr) Variable Input
130(gl_SubgroupID): 37(ptr) Variable Input
131: TypeVector 30(int) 4
132: TypePointer Input 131(ivec4)
133(gl_SubgroupEqMask): 132(ptr) Variable Input
134(gl_SubgroupGeMask): 132(ptr) Variable Input
135(gl_SubgroupGtMask): 132(ptr) Variable Input
136(gl_SubgroupLeMask): 132(ptr) Variable Input
137(gl_SubgroupLtMask): 132(ptr) Variable Input
142: TypePointer Function 131(ivec4)
144: 52(bool) ConstantFalse
146: 131(ivec4) ConstantComposite 91 91 91 91
160: 52(bool) ConstantTrue
217: 30(int) Constant 85
218: 131(ivec4) ConstantComposite 217 36 36 36
241: 30(int) Constant 32
242: 33(ivec3) ConstantComposite 241 91 91
4(main): 2 Function None 3
5: Label
32(iid): 31(ptr) Variable Function
@ -233,144 +233,143 @@ spv.460.subgroupEXT.task
MemoryBarrier 91 95
ControlBarrier 96 96 95
EmitMeshTasksEXT 98 91 91 102(mytask)
Return
FunctionEnd
6(basic_works(): 2 Function None 3
7: Label
ControlBarrier 98 98 124
MemoryBarrier 98 124
ControlBarrier 98 98 125
MemoryBarrier 98 125
MemoryBarrier 98 126
127: 52(bool) GroupNonUniformElect 98
MemoryBarrier 98 127
128: 52(bool) GroupNonUniformElect 98
MemoryBarrier 98 95
Return
FunctionEnd
13(ballot_works(vf4;): 2 Function None 11
12(f4): 10(ptr) FunctionParameter
14: Label
142(ballot): 141(ptr) Variable Function
137: 9(fvec4) Load 12(f4)
138: 9(fvec4) GroupNonUniformBroadcast 98 137 36
139: 9(fvec4) Load 12(f4)
140: 9(fvec4) GroupNonUniformBroadcastFirst 98 139
144: 130(ivec4) GroupNonUniformBallot 98 143
Store 142(ballot) 144
146: 52(bool) GroupNonUniformInverseBallot 98 145
147: 130(ivec4) Load 142(ballot)
148: 52(bool) GroupNonUniformBallotBitExtract 98 147 36
149: 130(ivec4) Load 142(ballot)
150: 30(int) GroupNonUniformBallotBitCount 98 Reduce 149
151: 130(ivec4) Load 142(ballot)
152: 30(int) GroupNonUniformBallotBitCount 98 InclusiveScan 151
153: 130(ivec4) Load 142(ballot)
154: 30(int) GroupNonUniformBallotBitCount 98 ExclusiveScan 153
155: 130(ivec4) Load 142(ballot)
156: 30(int) GroupNonUniformBallotFindLSB 98 155
157: 130(ivec4) Load 142(ballot)
158: 30(int) GroupNonUniformBallotFindMSB 98 157
143(ballot): 142(ptr) Variable Function
138: 9(fvec4) Load 12(f4)
139: 9(fvec4) GroupNonUniformBroadcast 98 138 36
140: 9(fvec4) Load 12(f4)
141: 9(fvec4) GroupNonUniformBroadcastFirst 98 140
145: 131(ivec4) GroupNonUniformBallot 98 144
Store 143(ballot) 145
147: 52(bool) GroupNonUniformInverseBallot 98 146
148: 131(ivec4) Load 143(ballot)
149: 52(bool) GroupNonUniformBallotBitExtract 98 148 36
150: 131(ivec4) Load 143(ballot)
151: 30(int) GroupNonUniformBallotBitCount 98 Reduce 150
152: 131(ivec4) Load 143(ballot)
153: 30(int) GroupNonUniformBallotBitCount 98 InclusiveScan 152
154: 131(ivec4) Load 143(ballot)
155: 30(int) GroupNonUniformBallotBitCount 98 ExclusiveScan 154
156: 131(ivec4) Load 143(ballot)
157: 30(int) GroupNonUniformBallotFindLSB 98 156
158: 131(ivec4) Load 143(ballot)
159: 30(int) GroupNonUniformBallotFindMSB 98 158
Return
FunctionEnd
16(vote_works(vf4;): 2 Function None 11
15(f4): 10(ptr) FunctionParameter
17: Label
160: 52(bool) GroupNonUniformAll 98 159
161: 52(bool) GroupNonUniformAny 98 143
162: 9(fvec4) Load 15(f4)
163: 52(bool) GroupNonUniformAllEqual 98 162
161: 52(bool) GroupNonUniformAll 98 160
162: 52(bool) GroupNonUniformAny 98 144
163: 9(fvec4) Load 15(f4)
164: 52(bool) GroupNonUniformAllEqual 98 163
Return
FunctionEnd
19(shuffle_works(vf4;): 2 Function None 11
18(f4): 10(ptr) FunctionParameter
20: Label
164: 9(fvec4) Load 18(f4)
165: 9(fvec4) GroupNonUniformShuffle 98 164 36
166: 9(fvec4) Load 18(f4)
167: 9(fvec4) GroupNonUniformShuffleXor 98 166 91
168: 9(fvec4) Load 18(f4)
169: 9(fvec4) GroupNonUniformShuffleUp 98 168 91
170: 9(fvec4) Load 18(f4)
171: 9(fvec4) GroupNonUniformShuffleDown 98 170 91
165: 9(fvec4) Load 18(f4)
166: 9(fvec4) GroupNonUniformShuffle 98 165 36
167: 9(fvec4) Load 18(f4)
168: 9(fvec4) GroupNonUniformShuffleXor 98 167 91
169: 9(fvec4) Load 18(f4)
170: 9(fvec4) GroupNonUniformShuffleUp 98 169 91
171: 9(fvec4) Load 18(f4)
172: 9(fvec4) GroupNonUniformShuffleDown 98 171 91
Return
FunctionEnd
22(arith_works(vf4;): 2 Function None 11
21(f4): 10(ptr) FunctionParameter
23: Label
180(ballot): 141(ptr) Variable Function
172: 9(fvec4) Load 21(f4)
173: 9(fvec4) GroupNonUniformFAdd 98 Reduce 172
174: 9(fvec4) Load 21(f4)
175: 9(fvec4) GroupNonUniformFMul 98 Reduce 174
176: 9(fvec4) Load 21(f4)
177: 9(fvec4) GroupNonUniformFMin 98 Reduce 176
178: 9(fvec4) Load 21(f4)
179: 9(fvec4) GroupNonUniformFMax 98 Reduce 178
181: 130(ivec4) Load 180(ballot)
182: 130(ivec4) GroupNonUniformBitwiseAnd 98 Reduce 181
183: 130(ivec4) Load 180(ballot)
184: 130(ivec4) GroupNonUniformBitwiseOr 98 Reduce 183
185: 130(ivec4) Load 180(ballot)
186: 130(ivec4) GroupNonUniformBitwiseXor 98 Reduce 185
187: 9(fvec4) Load 21(f4)
188: 9(fvec4) GroupNonUniformFAdd 98 InclusiveScan 187
189: 9(fvec4) Load 21(f4)
190: 9(fvec4) GroupNonUniformFMul 98 InclusiveScan 189
191: 9(fvec4) Load 21(f4)
192: 9(fvec4) GroupNonUniformFMin 98 InclusiveScan 191
193: 9(fvec4) Load 21(f4)
194: 9(fvec4) GroupNonUniformFMax 98 InclusiveScan 193
195: 130(ivec4) Load 180(ballot)
196: 130(ivec4) GroupNonUniformBitwiseAnd 98 InclusiveScan 195
197: 130(ivec4) Load 180(ballot)
198: 130(ivec4) GroupNonUniformBitwiseOr 98 InclusiveScan 197
199: 130(ivec4) Load 180(ballot)
200: 130(ivec4) GroupNonUniformBitwiseXor 98 InclusiveScan 199
201: 9(fvec4) Load 21(f4)
202: 9(fvec4) GroupNonUniformFAdd 98 ExclusiveScan 201
203: 9(fvec4) Load 21(f4)
204: 9(fvec4) GroupNonUniformFMul 98 ExclusiveScan 203
205: 9(fvec4) Load 21(f4)
206: 9(fvec4) GroupNonUniformFMin 98 ExclusiveScan 205
207: 9(fvec4) Load 21(f4)
208: 9(fvec4) GroupNonUniformFMax 98 ExclusiveScan 207
209: 130(ivec4) Load 180(ballot)
210: 130(ivec4) GroupNonUniformBitwiseAnd 98 ExclusiveScan 209
211: 130(ivec4) Load 180(ballot)
212: 130(ivec4) GroupNonUniformBitwiseOr 98 ExclusiveScan 211
213: 130(ivec4) Load 180(ballot)
214: 130(ivec4) GroupNonUniformBitwiseXor 98 ExclusiveScan 213
181(ballot): 142(ptr) Variable Function
173: 9(fvec4) Load 21(f4)
174: 9(fvec4) GroupNonUniformFAdd 98 Reduce 173
175: 9(fvec4) Load 21(f4)
176: 9(fvec4) GroupNonUniformFMul 98 Reduce 175
177: 9(fvec4) Load 21(f4)
178: 9(fvec4) GroupNonUniformFMin 98 Reduce 177
179: 9(fvec4) Load 21(f4)
180: 9(fvec4) GroupNonUniformFMax 98 Reduce 179
182: 131(ivec4) Load 181(ballot)
183: 131(ivec4) GroupNonUniformBitwiseAnd 98 Reduce 182
184: 131(ivec4) Load 181(ballot)
185: 131(ivec4) GroupNonUniformBitwiseOr 98 Reduce 184
186: 131(ivec4) Load 181(ballot)
187: 131(ivec4) GroupNonUniformBitwiseXor 98 Reduce 186
188: 9(fvec4) Load 21(f4)
189: 9(fvec4) GroupNonUniformFAdd 98 InclusiveScan 188
190: 9(fvec4) Load 21(f4)
191: 9(fvec4) GroupNonUniformFMul 98 InclusiveScan 190
192: 9(fvec4) Load 21(f4)
193: 9(fvec4) GroupNonUniformFMin 98 InclusiveScan 192
194: 9(fvec4) Load 21(f4)
195: 9(fvec4) GroupNonUniformFMax 98 InclusiveScan 194
196: 131(ivec4) Load 181(ballot)
197: 131(ivec4) GroupNonUniformBitwiseAnd 98 InclusiveScan 196
198: 131(ivec4) Load 181(ballot)
199: 131(ivec4) GroupNonUniformBitwiseOr 98 InclusiveScan 198
200: 131(ivec4) Load 181(ballot)
201: 131(ivec4) GroupNonUniformBitwiseXor 98 InclusiveScan 200
202: 9(fvec4) Load 21(f4)
203: 9(fvec4) GroupNonUniformFAdd 98 ExclusiveScan 202
204: 9(fvec4) Load 21(f4)
205: 9(fvec4) GroupNonUniformFMul 98 ExclusiveScan 204
206: 9(fvec4) Load 21(f4)
207: 9(fvec4) GroupNonUniformFMin 98 ExclusiveScan 206
208: 9(fvec4) Load 21(f4)
209: 9(fvec4) GroupNonUniformFMax 98 ExclusiveScan 208
210: 131(ivec4) Load 181(ballot)
211: 131(ivec4) GroupNonUniformBitwiseAnd 98 ExclusiveScan 210
212: 131(ivec4) Load 181(ballot)
213: 131(ivec4) GroupNonUniformBitwiseOr 98 ExclusiveScan 212
214: 131(ivec4) Load 181(ballot)
215: 131(ivec4) GroupNonUniformBitwiseXor 98 ExclusiveScan 214
Return
FunctionEnd
25(clustered_works(vf4;): 2 Function None 11
24(f4): 10(ptr) FunctionParameter
26: Label
215(ballot): 141(ptr) Variable Function
Store 215(ballot) 217
218: 9(fvec4) Load 24(f4)
219: 9(fvec4) GroupNonUniformFAdd 98 ClusteredReduce 218 96
220: 9(fvec4) Load 24(f4)
221: 9(fvec4) GroupNonUniformFMul 98 ClusteredReduce 220 96
222: 9(fvec4) Load 24(f4)
223: 9(fvec4) GroupNonUniformFMin 98 ClusteredReduce 222 96
224: 9(fvec4) Load 24(f4)
225: 9(fvec4) GroupNonUniformFMax 98 ClusteredReduce 224 96
226: 130(ivec4) Load 215(ballot)
227: 130(ivec4) GroupNonUniformBitwiseAnd 98 ClusteredReduce 226 96
228: 130(ivec4) Load 215(ballot)
229: 130(ivec4) GroupNonUniformBitwiseOr 98 ClusteredReduce 228 96
230: 130(ivec4) Load 215(ballot)
231: 130(ivec4) GroupNonUniformBitwiseXor 98 ClusteredReduce 230 96
216(ballot): 142(ptr) Variable Function
Store 216(ballot) 218
219: 9(fvec4) Load 24(f4)
220: 9(fvec4) GroupNonUniformFAdd 98 ClusteredReduce 219 96
221: 9(fvec4) Load 24(f4)
222: 9(fvec4) GroupNonUniformFMul 98 ClusteredReduce 221 96
223: 9(fvec4) Load 24(f4)
224: 9(fvec4) GroupNonUniformFMin 98 ClusteredReduce 223 96
225: 9(fvec4) Load 24(f4)
226: 9(fvec4) GroupNonUniformFMax 98 ClusteredReduce 225 96
227: 131(ivec4) Load 216(ballot)
228: 131(ivec4) GroupNonUniformBitwiseAnd 98 ClusteredReduce 227 96
229: 131(ivec4) Load 216(ballot)
230: 131(ivec4) GroupNonUniformBitwiseOr 98 ClusteredReduce 229 96
231: 131(ivec4) Load 216(ballot)
232: 131(ivec4) GroupNonUniformBitwiseXor 98 ClusteredReduce 231 96
Return
FunctionEnd
28(quad_works(vf4;): 2 Function None 11
27(f4): 10(ptr) FunctionParameter
29: Label
232: 9(fvec4) Load 27(f4)
233: 9(fvec4) GroupNonUniformQuadBroadcast 98 232 36
234: 9(fvec4) Load 27(f4)
235: 9(fvec4) GroupNonUniformQuadSwap 98 234 36
236: 9(fvec4) Load 27(f4)
237: 9(fvec4) GroupNonUniformQuadSwap 98 236 91
238: 9(fvec4) Load 27(f4)
239: 9(fvec4) GroupNonUniformQuadSwap 98 238 96
233: 9(fvec4) Load 27(f4)
234: 9(fvec4) GroupNonUniformQuadBroadcast 98 233 36
235: 9(fvec4) Load 27(f4)
236: 9(fvec4) GroupNonUniformQuadSwap 98 235 36
237: 9(fvec4) Load 27(f4)
238: 9(fvec4) GroupNonUniformQuadSwap 98 237 91
239: 9(fvec4) Load 27(f4)
240: 9(fvec4) GroupNonUniformQuadSwap 98 239 96
Return
FunctionEnd

View File

@ -1,7 +1,7 @@
spv.ext.meshTaskShader.task
// Module Version 10400
// Generated by (magic number): 8000a
// Id's are bound by 102
// Id's are bound by 103
Capability StorageImageWriteWithoutFormat
Capability MeshShadingEXT
@ -36,7 +36,7 @@ spv.ext.meshTaskShader.task
Decorate 55(uni_image) DescriptorSet 0
Decorate 55(uni_image) Binding 0
Decorate 55(uni_image) NonReadable
Decorate 101 BuiltIn WorkgroupSize
Decorate 102 BuiltIn WorkgroupSize
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 0
@ -86,8 +86,8 @@ spv.ext.meshTaskShader.task
91: 30(float) Constant 1108082688
92: 75(fvec2) ConstantComposite 90 91
94: 40(int) Constant 2
100: 6(int) Constant 32
101: 9(ivec3) ConstantComposite 100 69 69
101: 6(int) Constant 32
102: 9(ivec3) ConstantComposite 101 69 69
4(main): 2 Function None 3
5: Label
8(iid): 7(ptr) Variable Function
@ -159,5 +159,4 @@ spv.ext.meshTaskShader.task
MemoryBarrier 69 73
ControlBarrier 74 74 73
EmitMeshTasksEXT 76 69 69 80(mytask)
Return
FunctionEnd

View File

@ -5,7 +5,7 @@
"site" : "github",
"subrepo" : "KhronosGroup/SPIRV-Tools",
"subdir" : "External/spirv-tools",
"commit" : "4c456f7da67c5437a6fb7d4d20d78e2a5ae2acf2"
"commit" : "59cf5b1346d8b029add67a919f801c29ea13cc49"
},
{
"name" : "spirv-tools/external/spirv-headers",