Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/HansKristian-Work/dxil-spirv.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Rebohle <philip.rebohle@tu-dortmund.de>2022-02-23 19:13:03 +0300
committerPhilip Rebohle <philip.rebohle@tu-dortmund.de>2022-09-02 12:42:43 +0300
commit6656794e5345c7d78bbbb644a461300d94a3c34f (patch)
tree2da7bf460efa86a6998fd499f41270c5a6e9de13
parent9110ba9d95829d214651121bb80ecbdf97848390 (diff)
Implement DispatchMesh opcode.
-rw-r--r--opcodes/dxil/dxil_mesh.cpp11
-rw-r--r--opcodes/dxil/dxil_mesh.hpp1
-rw-r--r--opcodes/opcodes_dxil_builtins.cpp1
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