diff options
author | Philip Rebohle <philip.rebohle@tu-dortmund.de> | 2022-02-02 18:50:58 +0300 |
---|---|---|
committer | Philip Rebohle <philip.rebohle@tu-dortmund.de> | 2022-09-02 12:42:43 +0300 |
commit | 64c283970bc1c9656c729136ae46553d2eb64b51 (patch) | |
tree | 21b9c7773427db86939a78ce5a7cc9b17542b202 | |
parent | 4a66aebfce6f04880c5ae8b252c3a10fc30af44c (diff) |
Implement SetMeshOutputCounts opcode.
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | meson.build | 1 | ||||
-rw-r--r-- | opcodes/dxil/dxil_mesh.cpp | 44 | ||||
-rw-r--r-- | opcodes/dxil/dxil_mesh.hpp | 32 | ||||
-rw-r--r-- | opcodes/opcodes_dxil_builtins.cpp | 4 |
5 files changed, 82 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ac3258..4493a2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -84,6 +84,7 @@ add_library(dxil-converter STATIC opcodes/dxil/dxil_sampling.hpp opcodes/dxil/dxil_sampling.cpp opcodes/dxil/dxil_buffer.hpp opcodes/dxil/dxil_buffer.cpp opcodes/dxil/dxil_ray_tracing.hpp opcodes/dxil/dxil_ray_tracing.cpp + opcodes/dxil/dxil_mesh.hpp opcodes/dxil/dxil_mesh.cpp opcodes/opcodes_llvm_builtins.hpp opcodes/opcodes_llvm_builtins.cpp opcodes/opcodes_dxil_builtins.hpp opcodes/opcodes_dxil_builtins.cpp) set_target_properties(dxil-converter PROPERTIES POSITION_INDEPENDENT_CODE ON) diff --git a/meson.build b/meson.build index 917a727..55015cc 100644 --- a/meson.build +++ b/meson.build @@ -76,6 +76,7 @@ dxil_spirv_src = [ 'opcodes/dxil/dxil_sampling.cpp', 'opcodes/dxil/dxil_buffer.cpp', 'opcodes/dxil/dxil_ray_tracing.cpp', + 'opcodes/dxil/dxil_mesh.cpp', 'opcodes/opcodes_llvm_builtins.cpp', 'opcodes/opcodes_dxil_builtins.cpp', diff --git a/opcodes/dxil/dxil_mesh.cpp b/opcodes/dxil/dxil_mesh.cpp new file mode 100644 index 0000000..b87ffed --- /dev/null +++ b/opcodes/dxil/dxil_mesh.cpp @@ -0,0 +1,44 @@ +/* + * Copyright 2022 Philip Rebohle for Valve Corporation + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "dxil_mesh.hpp" +#include "dxil_common.hpp" +#include "logging.hpp" +#include "opcodes/converter_impl.hpp" +#include "spirv_module.hpp" + +namespace dxil_spv +{ +bool emit_set_mesh_output_counts_instruction(Converter::Impl &impl, const llvm::CallInst *instruction) +{ + Operation *op = impl.allocate(spv::OpSetMeshOutputsEXT); + op->add_id(impl.get_id_for_value(instruction->getOperand(1))); + op->add_id(impl.get_id_for_value(instruction->getOperand(2))); + + impl.add(op); + return true; +} + +} // namespace dxil_spv diff --git a/opcodes/dxil/dxil_mesh.hpp b/opcodes/dxil/dxil_mesh.hpp new file mode 100644 index 0000000..2d42902 --- /dev/null +++ b/opcodes/dxil/dxil_mesh.hpp @@ -0,0 +1,32 @@ +/* + * Copyright 2022 Philip Rebohle for Valve Corporation + * + * SPDX-License-Identifier: MIT + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#pragma once +#include "opcodes/opcodes.hpp" + +namespace dxil_spv +{ +bool emit_set_mesh_output_counts_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 63a7bae..55bc73b 100644 --- a/opcodes/opcodes_dxil_builtins.cpp +++ b/opcodes/opcodes_dxil_builtins.cpp @@ -36,6 +36,7 @@ #include "opcodes/dxil/dxil_tessellation.hpp" #include "opcodes/dxil/dxil_waveops.hpp" #include "opcodes/dxil/dxil_ray_tracing.hpp" +#include "opcodes/dxil/dxil_mesh.hpp" namespace dxil_spv { @@ -334,6 +335,9 @@ struct DXILDispatcher emit_ray_query_get_matrix_value_instruction<spv::OpRayQueryGetIntersectionObjectToWorldKHR, spv::RayQueryIntersectionRayQueryCommittedIntersectionKHR>; //////////// + + // dxil_mesh.cpp + OP(SetMeshOutputCounts) = emit_set_mesh_output_counts_instruction; } #undef OP |