diff options
author | Philip Rebohle <philip.rebohle@tu-dortmund.de> | 2022-02-23 19:13:03 +0300 |
---|---|---|
committer | Philip Rebohle <philip.rebohle@tu-dortmund.de> | 2022-09-02 12:42:43 +0300 |
commit | 6656794e5345c7d78bbbb644a461300d94a3c34f (patch) | |
tree | 2da7bf460efa86a6998fd499f41270c5a6e9de13 | |
parent | 9110ba9d95829d214651121bb80ecbdf97848390 (diff) |
Implement DispatchMesh opcode.
-rw-r--r-- | opcodes/dxil/dxil_mesh.cpp | 11 | ||||
-rw-r--r-- | opcodes/dxil/dxil_mesh.hpp | 1 | ||||
-rw-r--r-- | opcodes/opcodes_dxil_builtins.cpp | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/opcodes/dxil/dxil_mesh.cpp b/opcodes/dxil/dxil_mesh.cpp index 6c4bda9..b73ae68 100644 --- a/opcodes/dxil/dxil_mesh.cpp +++ b/opcodes/dxil/dxil_mesh.cpp @@ -165,4 +165,15 @@ bool emit_store_primitive_output_instruction(Converter::Impl &impl, const llvm:: return true; } +bool emit_dispatch_mesh_instruction(Converter::Impl &impl, const llvm::CallInst *instruction) +{ + Operation *op = impl.allocate(spv::OpEmitMeshTasksEXT); + + for (unsigned i = 1; i <= 4; i++) + op->add_id(impl.get_id_for_value(instruction->getOperand(i))); + + impl.add(op); + return true; +} + } // namespace dxil_spv diff --git a/opcodes/dxil/dxil_mesh.hpp b/opcodes/dxil/dxil_mesh.hpp index 92a4636..7708e4a 100644 --- a/opcodes/dxil/dxil_mesh.hpp +++ b/opcodes/dxil/dxil_mesh.hpp @@ -32,4 +32,5 @@ bool emit_set_mesh_output_counts_instruction(Converter::Impl &impl, const llvm:: bool emit_emit_indices_instruction(Converter::Impl &impl, const llvm::CallInst *instruction); bool emit_store_vertex_output_instruction(Converter::Impl &impl, const llvm::CallInst *instruction); bool emit_store_primitive_output_instruction(Converter::Impl &impl, const llvm::CallInst *instruction); +bool emit_dispatch_mesh_instruction(Converter::Impl &impl, const llvm::CallInst *instruction); } // namespace dxil_spv diff --git a/opcodes/opcodes_dxil_builtins.cpp b/opcodes/opcodes_dxil_builtins.cpp index 24685ac..f8a8fe0 100644 --- a/opcodes/opcodes_dxil_builtins.cpp +++ b/opcodes/opcodes_dxil_builtins.cpp @@ -341,6 +341,7 @@ struct DXILDispatcher OP(EmitIndices) = emit_emit_indices_instruction; OP(StoreVertexOutput) = emit_store_vertex_output_instruction; OP(StorePrimitiveOutput) = emit_store_primitive_output_instruction; + OP(DispatchMesh) = emit_dispatch_mesh_instruction; } #undef OP |