Make a utility function for termination instructions that take input operands.

Use the new utility function for generating OpEmitMeshTasksEXT.
This commit is contained in:
Pankaj Mistry
2022-09-09 12:48:52 -07:00
parent df7fec2cfa
commit cd9b971a5e
3 changed files with 21 additions and 8 deletions

View File

@@ -8594,11 +8594,10 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
builder.createNoResultOp(spv::OpWritePackedPrimitiveIndices4x8NV, operands);
return 0;
case glslang::EOpEmitMeshTasksEXT:
if(taskPayloadID)
if (taskPayloadID)
operands.push_back(taskPayloadID);
builder.createNoResultOp(spv::OpEmitMeshTasksEXT, operands);
// Make it a terminating instruction in the current block
builder.createAndSetNoPredecessorBlock("post-OpEmitMeshTasksEXT");
// As per SPV_EXT_mesh_shader make it a terminating instruction in the current block
builder.makeStatementTerminator(spv::OpEmitMeshTasksEXT, operands, "post-OpEmitMeshTasksEXT");
return 0;
case glslang::EOpSetMeshOutputsEXT:
builder.createNoResultOp(spv::OpSetMeshOutputsEXT, operands);