diff options
| author | 2021-02-17 00:59:28 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:22 -0400 | |
| commit | 85cce78583bc2232428a8fb39e43182877c8d5ad (patch) | |
| tree | 308f4ef2d145652e08dff1da31c72c2f00dad2e1 /src/shader_recompiler | |
| parent | shader: Remove old shader management (diff) | |
| download | yuzu-85cce78583bc2232428a8fb39e43182877c8d5ad.tar.gz yuzu-85cce78583bc2232428a8fb39e43182877c8d5ad.tar.xz yuzu-85cce78583bc2232428a8fb39e43182877c8d5ad.zip | |
shader: Primitive Vulkan integration
Diffstat (limited to '')
28 files changed, 573 insertions, 498 deletions
diff --git a/src/shader_recompiler/CMakeLists.txt b/src/shader_recompiler/CMakeLists.txt index 84be94a8d..b56bdd3d9 100644 --- a/src/shader_recompiler/CMakeLists.txt +++ b/src/shader_recompiler/CMakeLists.txt | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | add_executable(shader_recompiler | 1 | add_library(shader_recompiler STATIC |
| 2 | backend/spirv/emit_context.cpp | 2 | backend/spirv/emit_context.cpp |
| 3 | backend/spirv/emit_context.h | 3 | backend/spirv/emit_context.h |
| 4 | backend/spirv/emit_spirv.cpp | 4 | backend/spirv/emit_spirv.cpp |
| @@ -85,13 +85,19 @@ add_executable(shader_recompiler | |||
| 85 | ir_opt/passes.h | 85 | ir_opt/passes.h |
| 86 | ir_opt/ssa_rewrite_pass.cpp | 86 | ir_opt/ssa_rewrite_pass.cpp |
| 87 | ir_opt/verification_pass.cpp | 87 | ir_opt/verification_pass.cpp |
| 88 | main.cpp | ||
| 89 | object_pool.h | 88 | object_pool.h |
| 89 | profile.h | ||
| 90 | recompiler.cpp | ||
| 91 | recompiler.h | ||
| 90 | shader_info.h | 92 | shader_info.h |
| 91 | ) | 93 | ) |
| 92 | 94 | ||
| 93 | target_include_directories(video_core PRIVATE sirit) | 95 | target_include_directories(shader_recompiler PRIVATE sirit) |
| 94 | target_link_libraries(shader_recompiler PRIVATE fmt::fmt sirit) | 96 | target_link_libraries(shader_recompiler PRIVATE fmt::fmt sirit) |
| 97 | target_link_libraries(shader_recompiler INTERFACE fmt::fmt sirit) | ||
| 98 | |||
| 99 | add_executable(shader_util main.cpp) | ||
| 100 | target_link_libraries(shader_util PRIVATE shader_recompiler) | ||
| 95 | 101 | ||
| 96 | if (MSVC) | 102 | if (MSVC) |
| 97 | target_compile_options(shader_recompiler PRIVATE | 103 | target_compile_options(shader_recompiler PRIVATE |
| @@ -121,3 +127,4 @@ else() | |||
| 121 | endif() | 127 | endif() |
| 122 | 128 | ||
| 123 | create_target_directory_groups(shader_recompiler) | 129 | create_target_directory_groups(shader_recompiler) |
| 130 | create_target_directory_groups(shader_util) | ||
diff --git a/src/shader_recompiler/backend/spirv/emit_context.cpp b/src/shader_recompiler/backend/spirv/emit_context.cpp index 1c985aff8..770067d98 100644 --- a/src/shader_recompiler/backend/spirv/emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/emit_context.cpp | |||
| @@ -115,6 +115,7 @@ void EmitContext::DefineConstantBuffers(const Info& info) { | |||
| 115 | for (const Info::ConstantBufferDescriptor& desc : info.constant_buffer_descriptors) { | 115 | for (const Info::ConstantBufferDescriptor& desc : info.constant_buffer_descriptors) { |
| 116 | const Id id{AddGlobalVariable(uniform_type, spv::StorageClass::Uniform)}; | 116 | const Id id{AddGlobalVariable(uniform_type, spv::StorageClass::Uniform)}; |
| 117 | Decorate(id, spv::Decoration::Binding, binding); | 117 | Decorate(id, spv::Decoration::Binding, binding); |
| 118 | Decorate(id, spv::Decoration::DescriptorSet, 0U); | ||
| 118 | Name(id, fmt::format("c{}", desc.index)); | 119 | Name(id, fmt::format("c{}", desc.index)); |
| 119 | std::fill_n(cbufs.data() + desc.index, desc.count, id); | 120 | std::fill_n(cbufs.data() + desc.index, desc.count, id); |
| 120 | binding += desc.count; | 121 | binding += desc.count; |
| @@ -143,6 +144,7 @@ void EmitContext::DefineStorageBuffers(const Info& info) { | |||
| 143 | for (const Info::StorageBufferDescriptor& desc : info.storage_buffers_descriptors) { | 144 | for (const Info::StorageBufferDescriptor& desc : info.storage_buffers_descriptors) { |
| 144 | const Id id{AddGlobalVariable(storage_type, spv::StorageClass::StorageBuffer)}; | 145 | const Id id{AddGlobalVariable(storage_type, spv::StorageClass::StorageBuffer)}; |
| 145 | Decorate(id, spv::Decoration::Binding, binding); | 146 | Decorate(id, spv::Decoration::Binding, binding); |
| 147 | Decorate(id, spv::Decoration::DescriptorSet, 0U); | ||
| 146 | Name(id, fmt::format("ssbo{}", binding)); | 148 | Name(id, fmt::format("ssbo{}", binding)); |
| 147 | std::fill_n(ssbos.data() + binding, desc.count, id); | 149 | std::fill_n(ssbos.data() + binding, desc.count, id); |
| 148 | binding += desc.count; | 150 | binding += desc.count; |
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp index 55018332e..d59718435 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp | |||
| @@ -2,8 +2,11 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <numeric> | 5 | #include <span> |
| 6 | #include <tuple> | ||
| 6 | #include <type_traits> | 7 | #include <type_traits> |
| 8 | #include <utility> | ||
| 9 | #include <vector> | ||
| 7 | 10 | ||
| 8 | #include "shader_recompiler/backend/spirv/emit_spirv.h" | 11 | #include "shader_recompiler/backend/spirv/emit_spirv.h" |
| 9 | #include "shader_recompiler/frontend/ir/basic_block.h" | 12 | #include "shader_recompiler/frontend/ir/basic_block.h" |
| @@ -14,10 +17,10 @@ | |||
| 14 | namespace Shader::Backend::SPIRV { | 17 | namespace Shader::Backend::SPIRV { |
| 15 | namespace { | 18 | namespace { |
| 16 | template <class Func> | 19 | template <class Func> |
| 17 | struct FuncTraits : FuncTraits<decltype(&Func::operator())> {}; | 20 | struct FuncTraits : FuncTraits<Func> {}; |
| 18 | 21 | ||
| 19 | template <class ClassType, class ReturnType_, class... Args> | 22 | template <class ReturnType_, class... Args> |
| 20 | struct FuncTraits<ReturnType_ (ClassType::*)(Args...)> { | 23 | struct FuncTraits<ReturnType_ (*)(Args...)> { |
| 21 | using ReturnType = ReturnType_; | 24 | using ReturnType = ReturnType_; |
| 22 | 25 | ||
| 23 | static constexpr size_t NUM_ARGS = sizeof...(Args); | 26 | static constexpr size_t NUM_ARGS = sizeof...(Args); |
| @@ -26,15 +29,15 @@ struct FuncTraits<ReturnType_ (ClassType::*)(Args...)> { | |||
| 26 | using ArgType = std::tuple_element_t<I, std::tuple<Args...>>; | 29 | using ArgType = std::tuple_element_t<I, std::tuple<Args...>>; |
| 27 | }; | 30 | }; |
| 28 | 31 | ||
| 29 | template <auto method, typename... Args> | 32 | template <auto func, typename... Args> |
| 30 | void SetDefinition(EmitSPIRV& emit, EmitContext& ctx, IR::Inst* inst, Args... args) { | 33 | void SetDefinition(EmitContext& ctx, IR::Inst* inst, Args... args) { |
| 31 | const Id forward_id{inst->Definition<Id>()}; | 34 | const Id forward_id{inst->Definition<Id>()}; |
| 32 | const bool has_forward_id{Sirit::ValidId(forward_id)}; | 35 | const bool has_forward_id{Sirit::ValidId(forward_id)}; |
| 33 | Id current_id{}; | 36 | Id current_id{}; |
| 34 | if (has_forward_id) { | 37 | if (has_forward_id) { |
| 35 | current_id = ctx.ExchangeCurrentId(forward_id); | 38 | current_id = ctx.ExchangeCurrentId(forward_id); |
| 36 | } | 39 | } |
| 37 | const Id new_id{(emit.*method)(ctx, std::forward<Args>(args)...)}; | 40 | const Id new_id{func(ctx, std::forward<Args>(args)...)}; |
| 38 | if (has_forward_id) { | 41 | if (has_forward_id) { |
| 39 | ctx.ExchangeCurrentId(current_id); | 42 | ctx.ExchangeCurrentId(current_id); |
| 40 | } else { | 43 | } else { |
| @@ -55,42 +58,62 @@ ArgType Arg(EmitContext& ctx, const IR::Value& arg) { | |||
| 55 | } | 58 | } |
| 56 | } | 59 | } |
| 57 | 60 | ||
| 58 | template <auto method, bool is_first_arg_inst, size_t... I> | 61 | template <auto func, bool is_first_arg_inst, size_t... I> |
| 59 | void Invoke(EmitSPIRV& emit, EmitContext& ctx, IR::Inst* inst, std::index_sequence<I...>) { | 62 | void Invoke(EmitContext& ctx, IR::Inst* inst, std::index_sequence<I...>) { |
| 60 | using Traits = FuncTraits<decltype(method)>; | 63 | using Traits = FuncTraits<decltype(func)>; |
| 61 | if constexpr (std::is_same_v<Traits::ReturnType, Id>) { | 64 | if constexpr (std::is_same_v<Traits::ReturnType, Id>) { |
| 62 | if constexpr (is_first_arg_inst) { | 65 | if constexpr (is_first_arg_inst) { |
| 63 | SetDefinition<method>(emit, ctx, inst, inst, | 66 | SetDefinition<func>(ctx, inst, inst, Arg<Traits::ArgType<I + 2>>(ctx, inst->Arg(I))...); |
| 64 | Arg<Traits::ArgType<I + 2>>(ctx, inst->Arg(I))...); | ||
| 65 | } else { | 67 | } else { |
| 66 | SetDefinition<method>(emit, ctx, inst, | 68 | SetDefinition<func>(ctx, inst, Arg<Traits::ArgType<I + 1>>(ctx, inst->Arg(I))...); |
| 67 | Arg<Traits::ArgType<I + 1>>(ctx, inst->Arg(I))...); | ||
| 68 | } | 69 | } |
| 69 | } else { | 70 | } else { |
| 70 | if constexpr (is_first_arg_inst) { | 71 | if constexpr (is_first_arg_inst) { |
| 71 | (emit.*method)(ctx, inst, Arg<Traits::ArgType<I + 2>>(ctx, inst->Arg(I))...); | 72 | func(ctx, inst, Arg<Traits::ArgType<I + 2>>(ctx, inst->Arg(I))...); |
| 72 | } else { | 73 | } else { |
| 73 | (emit.*method)(ctx, Arg<Traits::ArgType<I + 1>>(ctx, inst->Arg(I))...); | 74 | func(ctx, Arg<Traits::ArgType<I + 1>>(ctx, inst->Arg(I))...); |
| 74 | } | 75 | } |
| 75 | } | 76 | } |
| 76 | } | 77 | } |
| 77 | 78 | ||
| 78 | template <auto method> | 79 | template <auto func> |
| 79 | void Invoke(EmitSPIRV& emit, EmitContext& ctx, IR::Inst* inst) { | 80 | void Invoke(EmitContext& ctx, IR::Inst* inst) { |
| 80 | using Traits = FuncTraits<decltype(method)>; | 81 | using Traits = FuncTraits<decltype(func)>; |
| 81 | static_assert(Traits::NUM_ARGS >= 1, "Insufficient arguments"); | 82 | static_assert(Traits::NUM_ARGS >= 1, "Insufficient arguments"); |
| 82 | if constexpr (Traits::NUM_ARGS == 1) { | 83 | if constexpr (Traits::NUM_ARGS == 1) { |
| 83 | Invoke<method, false>(emit, ctx, inst, std::make_index_sequence<0>{}); | 84 | Invoke<func, false>(ctx, inst, std::make_index_sequence<0>{}); |
| 84 | } else { | 85 | } else { |
| 85 | using FirstArgType = typename Traits::template ArgType<1>; | 86 | using FirstArgType = typename Traits::template ArgType<1>; |
| 86 | static constexpr bool is_first_arg_inst = std::is_same_v<FirstArgType, IR::Inst*>; | 87 | static constexpr bool is_first_arg_inst = std::is_same_v<FirstArgType, IR::Inst*>; |
| 87 | using Indices = std::make_index_sequence<Traits::NUM_ARGS - (is_first_arg_inst ? 2 : 1)>; | 88 | using Indices = std::make_index_sequence<Traits::NUM_ARGS - (is_first_arg_inst ? 2 : 1)>; |
| 88 | Invoke<method, is_first_arg_inst>(emit, ctx, inst, Indices{}); | 89 | Invoke<func, is_first_arg_inst>(ctx, inst, Indices{}); |
| 90 | } | ||
| 91 | } | ||
| 92 | |||
| 93 | void EmitInst(EmitContext& ctx, IR::Inst* inst) { | ||
| 94 | switch (inst->Opcode()) { | ||
| 95 | #define OPCODE(name, result_type, ...) \ | ||
| 96 | case IR::Opcode::name: \ | ||
| 97 | return Invoke<&Emit##name>(ctx, inst); | ||
| 98 | #include "shader_recompiler/frontend/ir/opcodes.inc" | ||
| 99 | #undef OPCODE | ||
| 100 | } | ||
| 101 | throw LogicError("Invalid opcode {}", inst->Opcode()); | ||
| 102 | } | ||
| 103 | |||
| 104 | Id TypeId(const EmitContext& ctx, IR::Type type) { | ||
| 105 | switch (type) { | ||
| 106 | case IR::Type::U1: | ||
| 107 | return ctx.U1; | ||
| 108 | case IR::Type::U32: | ||
| 109 | return ctx.U32[1]; | ||
| 110 | default: | ||
| 111 | throw NotImplementedException("Phi node type {}", type); | ||
| 89 | } | 112 | } |
| 90 | } | 113 | } |
| 91 | } // Anonymous namespace | 114 | } // Anonymous namespace |
| 92 | 115 | ||
| 93 | EmitSPIRV::EmitSPIRV(IR::Program& program) { | 116 | std::vector<u32> EmitSPIRV(Environment& env, IR::Program& program) { |
| 94 | EmitContext ctx{program}; | 117 | EmitContext ctx{program}; |
| 95 | const Id void_function{ctx.TypeFunction(ctx.void_id)}; | 118 | const Id void_function{ctx.TypeFunction(ctx.void_id)}; |
| 96 | // FIXME: Forward declare functions (needs sirit support) | 119 | // FIXME: Forward declare functions (needs sirit support) |
| @@ -112,43 +135,17 @@ EmitSPIRV::EmitSPIRV(IR::Program& program) { | |||
| 112 | if (program.info.uses_local_invocation_id) { | 135 | if (program.info.uses_local_invocation_id) { |
| 113 | interfaces.push_back(ctx.local_invocation_id); | 136 | interfaces.push_back(ctx.local_invocation_id); |
| 114 | } | 137 | } |
| 115 | |||
| 116 | const std::span interfaces_span(interfaces.data(), interfaces.size()); | 138 | const std::span interfaces_span(interfaces.data(), interfaces.size()); |
| 117 | ctx.AddEntryPoint(spv::ExecutionModel::Fragment, func, "main", interfaces_span); | 139 | ctx.AddEntryPoint(spv::ExecutionModel::GLCompute, func, "main", interfaces_span); |
| 118 | ctx.AddExecutionMode(func, spv::ExecutionMode::OriginUpperLeft); | ||
| 119 | |||
| 120 | std::vector<u32> result{ctx.Assemble()}; | ||
| 121 | std::FILE* file{std::fopen("D:\\shader.spv", "wb")}; | ||
| 122 | std::fwrite(result.data(), sizeof(u32), result.size(), file); | ||
| 123 | std::fclose(file); | ||
| 124 | std::system("spirv-dis D:\\shader.spv") == 0 && | ||
| 125 | std::system("spirv-val --uniform-buffer-standard-layout D:\\shader.spv") == 0 && | ||
| 126 | std::system("spirv-cross -V D:\\shader.spv") == 0; | ||
| 127 | } | ||
| 128 | 140 | ||
| 129 | void EmitSPIRV::EmitInst(EmitContext& ctx, IR::Inst* inst) { | 141 | const std::array<u32, 3> workgroup_size{env.WorkgroupSize()}; |
| 130 | switch (inst->Opcode()) { | 142 | ctx.AddExecutionMode(func, spv::ExecutionMode::LocalSize, workgroup_size[0], workgroup_size[1], |
| 131 | #define OPCODE(name, result_type, ...) \ | 143 | workgroup_size[2]); |
| 132 | case IR::Opcode::name: \ | ||
| 133 | return Invoke<&EmitSPIRV::Emit##name>(*this, ctx, inst); | ||
| 134 | #include "shader_recompiler/frontend/ir/opcodes.inc" | ||
| 135 | #undef OPCODE | ||
| 136 | } | ||
| 137 | throw LogicError("Invalid opcode {}", inst->Opcode()); | ||
| 138 | } | ||
| 139 | 144 | ||
| 140 | static Id TypeId(const EmitContext& ctx, IR::Type type) { | 145 | return ctx.Assemble(); |
| 141 | switch (type) { | ||
| 142 | case IR::Type::U1: | ||
| 143 | return ctx.U1; | ||
| 144 | case IR::Type::U32: | ||
| 145 | return ctx.U32[1]; | ||
| 146 | default: | ||
| 147 | throw NotImplementedException("Phi node type {}", type); | ||
| 148 | } | ||
| 149 | } | 146 | } |
| 150 | 147 | ||
| 151 | Id EmitSPIRV::EmitPhi(EmitContext& ctx, IR::Inst* inst) { | 148 | Id EmitPhi(EmitContext& ctx, IR::Inst* inst) { |
| 152 | const size_t num_args{inst->NumArgs()}; | 149 | const size_t num_args{inst->NumArgs()}; |
| 153 | boost::container::small_vector<Id, 32> operands; | 150 | boost::container::small_vector<Id, 32> operands; |
| 154 | operands.reserve(num_args * 2); | 151 | operands.reserve(num_args * 2); |
| @@ -178,25 +175,25 @@ Id EmitSPIRV::EmitPhi(EmitContext& ctx, IR::Inst* inst) { | |||
| 178 | return ctx.OpPhi(result_type, std::span(operands.data(), operands.size())); | 175 | return ctx.OpPhi(result_type, std::span(operands.data(), operands.size())); |
| 179 | } | 176 | } |
| 180 | 177 | ||
| 181 | void EmitSPIRV::EmitVoid(EmitContext&) {} | 178 | void EmitVoid(EmitContext&) {} |
| 182 | 179 | ||
| 183 | Id EmitSPIRV::EmitIdentity(EmitContext& ctx, const IR::Value& value) { | 180 | Id EmitIdentity(EmitContext& ctx, const IR::Value& value) { |
| 184 | return ctx.Def(value); | 181 | return ctx.Def(value); |
| 185 | } | 182 | } |
| 186 | 183 | ||
| 187 | void EmitSPIRV::EmitGetZeroFromOp(EmitContext&) { | 184 | void EmitGetZeroFromOp(EmitContext&) { |
| 188 | throw LogicError("Unreachable instruction"); | 185 | throw LogicError("Unreachable instruction"); |
| 189 | } | 186 | } |
| 190 | 187 | ||
| 191 | void EmitSPIRV::EmitGetSignFromOp(EmitContext&) { | 188 | void EmitGetSignFromOp(EmitContext&) { |
| 192 | throw LogicError("Unreachable instruction"); | 189 | throw LogicError("Unreachable instruction"); |
| 193 | } | 190 | } |
| 194 | 191 | ||
| 195 | void EmitSPIRV::EmitGetCarryFromOp(EmitContext&) { | 192 | void EmitGetCarryFromOp(EmitContext&) { |
| 196 | throw LogicError("Unreachable instruction"); | 193 | throw LogicError("Unreachable instruction"); |
| 197 | } | 194 | } |
| 198 | 195 | ||
| 199 | void EmitSPIRV::EmitGetOverflowFromOp(EmitContext&) { | 196 | void EmitGetOverflowFromOp(EmitContext&) { |
| 200 | throw LogicError("Unreachable instruction"); | 197 | throw LogicError("Unreachable instruction"); |
| 201 | } | 198 | } |
| 202 | 199 | ||
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.h b/src/shader_recompiler/backend/spirv/emit_spirv.h index 8bde82613..5813f51ff 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.h +++ b/src/shader_recompiler/backend/spirv/emit_spirv.h | |||
| @@ -8,223 +8,218 @@ | |||
| 8 | 8 | ||
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "shader_recompiler/backend/spirv/emit_context.h" | 10 | #include "shader_recompiler/backend/spirv/emit_context.h" |
| 11 | #include "shader_recompiler/environment.h" | ||
| 11 | #include "shader_recompiler/frontend/ir/microinstruction.h" | 12 | #include "shader_recompiler/frontend/ir/microinstruction.h" |
| 12 | #include "shader_recompiler/frontend/ir/program.h" | 13 | #include "shader_recompiler/frontend/ir/program.h" |
| 13 | 14 | ||
| 14 | namespace Shader::Backend::SPIRV { | 15 | namespace Shader::Backend::SPIRV { |
| 15 | 16 | ||
| 16 | class EmitSPIRV { | 17 | [[nodiscard]] std::vector<u32> EmitSPIRV(Environment& env, IR::Program& program); |
| 17 | public: | ||
| 18 | explicit EmitSPIRV(IR::Program& program); | ||
| 19 | 18 | ||
| 20 | private: | 19 | // Microinstruction emitters |
| 21 | void EmitInst(EmitContext& ctx, IR::Inst* inst); | 20 | Id EmitPhi(EmitContext& ctx, IR::Inst* inst); |
| 22 | 21 | void EmitVoid(EmitContext& ctx); | |
| 23 | // Microinstruction emitters | 22 | Id EmitIdentity(EmitContext& ctx, const IR::Value& value); |
| 24 | Id EmitPhi(EmitContext& ctx, IR::Inst* inst); | 23 | void EmitBranch(EmitContext& ctx, IR::Block* label); |
| 25 | void EmitVoid(EmitContext& ctx); | 24 | void EmitBranchConditional(EmitContext& ctx, Id condition, IR::Block* true_label, |
| 26 | Id EmitIdentity(EmitContext& ctx, const IR::Value& value); | 25 | IR::Block* false_label); |
| 27 | void EmitBranch(EmitContext& ctx, IR::Block* label); | 26 | void EmitLoopMerge(EmitContext& ctx, IR::Block* merge_label, IR::Block* continue_label); |
| 28 | void EmitBranchConditional(EmitContext& ctx, Id condition, IR::Block* true_label, | 27 | void EmitSelectionMerge(EmitContext& ctx, IR::Block* merge_label); |
| 29 | IR::Block* false_label); | 28 | void EmitReturn(EmitContext& ctx); |
| 30 | void EmitLoopMerge(EmitContext& ctx, IR::Block* merge_label, IR::Block* continue_label); | 29 | void EmitGetRegister(EmitContext& ctx); |
| 31 | void EmitSelectionMerge(EmitContext& ctx, IR::Block* merge_label); | 30 | void EmitSetRegister(EmitContext& ctx); |
| 32 | void EmitReturn(EmitContext& ctx); | 31 | void EmitGetPred(EmitContext& ctx); |
| 33 | void EmitGetRegister(EmitContext& ctx); | 32 | void EmitSetPred(EmitContext& ctx); |
| 34 | void EmitSetRegister(EmitContext& ctx); | 33 | void EmitSetGotoVariable(EmitContext& ctx); |
| 35 | void EmitGetPred(EmitContext& ctx); | 34 | void EmitGetGotoVariable(EmitContext& ctx); |
| 36 | void EmitSetPred(EmitContext& ctx); | 35 | Id EmitGetCbuf(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); |
| 37 | void EmitSetGotoVariable(EmitContext& ctx); | 36 | void EmitGetAttribute(EmitContext& ctx); |
| 38 | void EmitGetGotoVariable(EmitContext& ctx); | 37 | void EmitSetAttribute(EmitContext& ctx); |
| 39 | Id EmitGetCbuf(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); | 38 | void EmitGetAttributeIndexed(EmitContext& ctx); |
| 40 | void EmitGetAttribute(EmitContext& ctx); | 39 | void EmitSetAttributeIndexed(EmitContext& ctx); |
| 41 | void EmitSetAttribute(EmitContext& ctx); | 40 | void EmitGetZFlag(EmitContext& ctx); |
| 42 | void EmitGetAttributeIndexed(EmitContext& ctx); | 41 | void EmitGetSFlag(EmitContext& ctx); |
| 43 | void EmitSetAttributeIndexed(EmitContext& ctx); | 42 | void EmitGetCFlag(EmitContext& ctx); |
| 44 | void EmitGetZFlag(EmitContext& ctx); | 43 | void EmitGetOFlag(EmitContext& ctx); |
| 45 | void EmitGetSFlag(EmitContext& ctx); | 44 | void EmitSetZFlag(EmitContext& ctx); |
| 46 | void EmitGetCFlag(EmitContext& ctx); | 45 | void EmitSetSFlag(EmitContext& ctx); |
| 47 | void EmitGetOFlag(EmitContext& ctx); | 46 | void EmitSetCFlag(EmitContext& ctx); |
| 48 | void EmitSetZFlag(EmitContext& ctx); | 47 | void EmitSetOFlag(EmitContext& ctx); |
| 49 | void EmitSetSFlag(EmitContext& ctx); | 48 | Id EmitWorkgroupId(EmitContext& ctx); |
| 50 | void EmitSetCFlag(EmitContext& ctx); | 49 | Id EmitLocalInvocationId(EmitContext& ctx); |
| 51 | void EmitSetOFlag(EmitContext& ctx); | 50 | Id EmitUndefU1(EmitContext& ctx); |
| 52 | Id EmitWorkgroupId(EmitContext& ctx); | 51 | Id EmitUndefU8(EmitContext& ctx); |
| 53 | Id EmitLocalInvocationId(EmitContext& ctx); | 52 | Id EmitUndefU16(EmitContext& ctx); |
| 54 | Id EmitUndefU1(EmitContext& ctx); | 53 | Id EmitUndefU32(EmitContext& ctx); |
| 55 | Id EmitUndefU8(EmitContext& ctx); | 54 | Id EmitUndefU64(EmitContext& ctx); |
| 56 | Id EmitUndefU16(EmitContext& ctx); | 55 | void EmitLoadGlobalU8(EmitContext& ctx); |
| 57 | Id EmitUndefU32(EmitContext& ctx); | 56 | void EmitLoadGlobalS8(EmitContext& ctx); |
| 58 | Id EmitUndefU64(EmitContext& ctx); | 57 | void EmitLoadGlobalU16(EmitContext& ctx); |
| 59 | void EmitLoadGlobalU8(EmitContext& ctx); | 58 | void EmitLoadGlobalS16(EmitContext& ctx); |
| 60 | void EmitLoadGlobalS8(EmitContext& ctx); | 59 | void EmitLoadGlobal32(EmitContext& ctx); |
| 61 | void EmitLoadGlobalU16(EmitContext& ctx); | 60 | void EmitLoadGlobal64(EmitContext& ctx); |
| 62 | void EmitLoadGlobalS16(EmitContext& ctx); | 61 | void EmitLoadGlobal128(EmitContext& ctx); |
| 63 | void EmitLoadGlobal32(EmitContext& ctx); | 62 | void EmitWriteGlobalU8(EmitContext& ctx); |
| 64 | void EmitLoadGlobal64(EmitContext& ctx); | 63 | void EmitWriteGlobalS8(EmitContext& ctx); |
| 65 | void EmitLoadGlobal128(EmitContext& ctx); | 64 | void EmitWriteGlobalU16(EmitContext& ctx); |
| 66 | void EmitWriteGlobalU8(EmitContext& ctx); | 65 | void EmitWriteGlobalS16(EmitContext& ctx); |
| 67 | void EmitWriteGlobalS8(EmitContext& ctx); | 66 | void EmitWriteGlobal32(EmitContext& ctx); |
| 68 | void EmitWriteGlobalU16(EmitContext& ctx); | 67 | void EmitWriteGlobal64(EmitContext& ctx); |
| 69 | void EmitWriteGlobalS16(EmitContext& ctx); | 68 | void EmitWriteGlobal128(EmitContext& ctx); |
| 70 | void EmitWriteGlobal32(EmitContext& ctx); | 69 | void EmitLoadStorageU8(EmitContext& ctx); |
| 71 | void EmitWriteGlobal64(EmitContext& ctx); | 70 | void EmitLoadStorageS8(EmitContext& ctx); |
| 72 | void EmitWriteGlobal128(EmitContext& ctx); | 71 | void EmitLoadStorageU16(EmitContext& ctx); |
| 73 | void EmitLoadStorageU8(EmitContext& ctx); | 72 | void EmitLoadStorageS16(EmitContext& ctx); |
| 74 | void EmitLoadStorageS8(EmitContext& ctx); | 73 | Id EmitLoadStorage32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); |
| 75 | void EmitLoadStorageU16(EmitContext& ctx); | 74 | void EmitLoadStorage64(EmitContext& ctx); |
| 76 | void EmitLoadStorageS16(EmitContext& ctx); | 75 | void EmitLoadStorage128(EmitContext& ctx); |
| 77 | Id EmitLoadStorage32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset); | 76 | void EmitWriteStorageU8(EmitContext& ctx); |
| 78 | void EmitLoadStorage64(EmitContext& ctx); | 77 | void EmitWriteStorageS8(EmitContext& ctx); |
| 79 | void EmitLoadStorage128(EmitContext& ctx); | 78 | void EmitWriteStorageU16(EmitContext& ctx); |
| 80 | void EmitWriteStorageU8(EmitContext& ctx); | 79 | void EmitWriteStorageS16(EmitContext& ctx); |
| 81 | void EmitWriteStorageS8(EmitContext& ctx); | 80 | void EmitWriteStorage32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, |
| 82 | void EmitWriteStorageU16(EmitContext& ctx); | 81 | Id value); |
| 83 | void EmitWriteStorageS16(EmitContext& ctx); | 82 | void EmitWriteStorage64(EmitContext& ctx); |
| 84 | void EmitWriteStorage32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset, | 83 | void EmitWriteStorage128(EmitContext& ctx); |
| 85 | Id value); | 84 | void EmitCompositeConstructU32x2(EmitContext& ctx); |
| 86 | void EmitWriteStorage64(EmitContext& ctx); | 85 | void EmitCompositeConstructU32x3(EmitContext& ctx); |
| 87 | void EmitWriteStorage128(EmitContext& ctx); | 86 | void EmitCompositeConstructU32x4(EmitContext& ctx); |
| 88 | void EmitCompositeConstructU32x2(EmitContext& ctx); | 87 | void EmitCompositeExtractU32x2(EmitContext& ctx); |
| 89 | void EmitCompositeConstructU32x3(EmitContext& ctx); | 88 | Id EmitCompositeExtractU32x3(EmitContext& ctx, Id vector, u32 index); |
| 90 | void EmitCompositeConstructU32x4(EmitContext& ctx); | 89 | void EmitCompositeExtractU32x4(EmitContext& ctx); |
| 91 | void EmitCompositeExtractU32x2(EmitContext& ctx); | 90 | void EmitCompositeConstructF16x2(EmitContext& ctx); |
| 92 | Id EmitCompositeExtractU32x3(EmitContext& ctx, Id vector, u32 index); | 91 | void EmitCompositeConstructF16x3(EmitContext& ctx); |
| 93 | void EmitCompositeExtractU32x4(EmitContext& ctx); | 92 | void EmitCompositeConstructF16x4(EmitContext& ctx); |
| 94 | void EmitCompositeConstructF16x2(EmitContext& ctx); | 93 | void EmitCompositeExtractF16x2(EmitContext& ctx); |
| 95 | void EmitCompositeConstructF16x3(EmitContext& ctx); | 94 | void EmitCompositeExtractF16x3(EmitContext& ctx); |
| 96 | void EmitCompositeConstructF16x4(EmitContext& ctx); | 95 | void EmitCompositeExtractF16x4(EmitContext& ctx); |
| 97 | void EmitCompositeExtractF16x2(EmitContext& ctx); | 96 | void EmitCompositeConstructF32x2(EmitContext& ctx); |
| 98 | void EmitCompositeExtractF16x3(EmitContext& ctx); | 97 | void EmitCompositeConstructF32x3(EmitContext& ctx); |
| 99 | void EmitCompositeExtractF16x4(EmitContext& ctx); | 98 | void EmitCompositeConstructF32x4(EmitContext& ctx); |
| 100 | void EmitCompositeConstructF32x2(EmitContext& ctx); | 99 | void EmitCompositeExtractF32x2(EmitContext& ctx); |
| 101 | void EmitCompositeConstructF32x3(EmitContext& ctx); | 100 | void EmitCompositeExtractF32x3(EmitContext& ctx); |
| 102 | void EmitCompositeConstructF32x4(EmitContext& ctx); | 101 | void EmitCompositeExtractF32x4(EmitContext& ctx); |
| 103 | void EmitCompositeExtractF32x2(EmitContext& ctx); | 102 | void EmitCompositeConstructF64x2(EmitContext& ctx); |
| 104 | void EmitCompositeExtractF32x3(EmitContext& ctx); | 103 | void EmitCompositeConstructF64x3(EmitContext& ctx); |
| 105 | void EmitCompositeExtractF32x4(EmitContext& ctx); | 104 | void EmitCompositeConstructF64x4(EmitContext& ctx); |
| 106 | void EmitCompositeConstructF64x2(EmitContext& ctx); | 105 | void EmitCompositeExtractF64x2(EmitContext& ctx); |
| 107 | void EmitCompositeConstructF64x3(EmitContext& ctx); | 106 | void EmitCompositeExtractF64x3(EmitContext& ctx); |
| 108 | void EmitCompositeConstructF64x4(EmitContext& ctx); | 107 | void EmitCompositeExtractF64x4(EmitContext& ctx); |
| 109 | void EmitCompositeExtractF64x2(EmitContext& ctx); | 108 | void EmitSelect8(EmitContext& ctx); |
| 110 | void EmitCompositeExtractF64x3(EmitContext& ctx); | 109 | void EmitSelect16(EmitContext& ctx); |
| 111 | void EmitCompositeExtractF64x4(EmitContext& ctx); | 110 | void EmitSelect32(EmitContext& ctx); |
| 112 | void EmitSelect8(EmitContext& ctx); | 111 | void EmitSelect64(EmitContext& ctx); |
| 113 | void EmitSelect16(EmitContext& ctx); | 112 | void EmitBitCastU16F16(EmitContext& ctx); |
| 114 | void EmitSelect32(EmitContext& ctx); | 113 | Id EmitBitCastU32F32(EmitContext& ctx, Id value); |
| 115 | void EmitSelect64(EmitContext& ctx); | 114 | void EmitBitCastU64F64(EmitContext& ctx); |
| 116 | void EmitBitCastU16F16(EmitContext& ctx); | 115 | void EmitBitCastF16U16(EmitContext& ctx); |
| 117 | Id EmitBitCastU32F32(EmitContext& ctx, Id value); | 116 | Id EmitBitCastF32U32(EmitContext& ctx, Id value); |
| 118 | void EmitBitCastU64F64(EmitContext& ctx); | 117 | void EmitBitCastF64U64(EmitContext& ctx); |
| 119 | void EmitBitCastF16U16(EmitContext& ctx); | 118 | void EmitPackUint2x32(EmitContext& ctx); |
| 120 | Id EmitBitCastF32U32(EmitContext& ctx, Id value); | 119 | void EmitUnpackUint2x32(EmitContext& ctx); |
| 121 | void EmitBitCastF64U64(EmitContext& ctx); | 120 | void EmitPackFloat2x16(EmitContext& ctx); |
| 122 | void EmitPackUint2x32(EmitContext& ctx); | 121 | void EmitUnpackFloat2x16(EmitContext& ctx); |
| 123 | void EmitUnpackUint2x32(EmitContext& ctx); | 122 | void EmitPackDouble2x32(EmitContext& ctx); |
| 124 | void EmitPackFloat2x16(EmitContext& ctx); | 123 | void EmitUnpackDouble2x32(EmitContext& ctx); |
| 125 | void EmitUnpackFloat2x16(EmitContext& ctx); | 124 | void EmitGetZeroFromOp(EmitContext& ctx); |
| 126 | void EmitPackDouble2x32(EmitContext& ctx); | 125 | void EmitGetSignFromOp(EmitContext& ctx); |
| 127 | void EmitUnpackDouble2x32(EmitContext& ctx); | 126 | void EmitGetCarryFromOp(EmitContext& ctx); |
| 128 | void EmitGetZeroFromOp(EmitContext& ctx); | 127 | void EmitGetOverflowFromOp(EmitContext& ctx); |
| 129 | void EmitGetSignFromOp(EmitContext& ctx); | 128 | void EmitFPAbs16(EmitContext& ctx); |
| 130 | void EmitGetCarryFromOp(EmitContext& ctx); | 129 | void EmitFPAbs32(EmitContext& ctx); |
| 131 | void EmitGetOverflowFromOp(EmitContext& ctx); | 130 | void EmitFPAbs64(EmitContext& ctx); |
| 132 | void EmitFPAbs16(EmitContext& ctx); | 131 | Id EmitFPAdd16(EmitContext& ctx, IR::Inst* inst, Id a, Id b); |
| 133 | void EmitFPAbs32(EmitContext& ctx); | 132 | Id EmitFPAdd32(EmitContext& ctx, IR::Inst* inst, Id a, Id b); |
| 134 | void EmitFPAbs64(EmitContext& ctx); | 133 | Id EmitFPAdd64(EmitContext& ctx, IR::Inst* inst, Id a, Id b); |
| 135 | Id EmitFPAdd16(EmitContext& ctx, IR::Inst* inst, Id a, Id b); | 134 | Id EmitFPFma16(EmitContext& ctx, IR::Inst* inst, Id a, Id b, Id c); |
| 136 | Id EmitFPAdd32(EmitContext& ctx, IR::Inst* inst, Id a, Id b); | 135 | Id EmitFPFma32(EmitContext& ctx, IR::Inst* inst, Id a, Id b, Id c); |
| 137 | Id EmitFPAdd64(EmitContext& ctx, IR::Inst* inst, Id a, Id b); | 136 | Id EmitFPFma64(EmitContext& ctx, IR::Inst* inst, Id a, Id b, Id c); |
| 138 | Id EmitFPFma16(EmitContext& ctx, IR::Inst* inst, Id a, Id b, Id c); | 137 | void EmitFPMax32(EmitContext& ctx); |
| 139 | Id EmitFPFma32(EmitContext& ctx, IR::Inst* inst, Id a, Id b, Id c); | 138 | void EmitFPMax64(EmitContext& ctx); |
| 140 | Id EmitFPFma64(EmitContext& ctx, IR::Inst* inst, Id a, Id b, Id c); | 139 | void EmitFPMin32(EmitContext& ctx); |
| 141 | void EmitFPMax32(EmitContext& ctx); | 140 | void EmitFPMin64(EmitContext& ctx); |
| 142 | void EmitFPMax64(EmitContext& ctx); | 141 | Id EmitFPMul16(EmitContext& ctx, IR::Inst* inst, Id a, Id b); |
| 143 | void EmitFPMin32(EmitContext& ctx); | 142 | Id EmitFPMul32(EmitContext& ctx, IR::Inst* inst, Id a, Id b); |
| 144 | void EmitFPMin64(EmitContext& ctx); | 143 | Id EmitFPMul64(EmitContext& ctx, IR::Inst* inst, Id a, Id b); |
| 145 | Id EmitFPMul16(EmitContext& ctx, IR::Inst* inst, Id a, Id b); | 144 | void EmitFPNeg16(EmitContext& ctx); |
| 146 | Id EmitFPMul32(EmitContext& ctx, IR::Inst* inst, Id a, Id b); | 145 | void EmitFPNeg32(EmitContext& ctx); |
| 147 | Id EmitFPMul64(EmitContext& ctx, IR::Inst* inst, Id a, Id b); | 146 | void EmitFPNeg64(EmitContext& ctx); |
| 148 | void EmitFPNeg16(EmitContext& ctx); | 147 | void EmitFPRecip32(EmitContext& ctx); |
| 149 | void EmitFPNeg32(EmitContext& ctx); | 148 | void EmitFPRecip64(EmitContext& ctx); |
| 150 | void EmitFPNeg64(EmitContext& ctx); | 149 | void EmitFPRecipSqrt32(EmitContext& ctx); |
| 151 | void EmitFPRecip32(EmitContext& ctx); | 150 | void EmitFPRecipSqrt64(EmitContext& ctx); |
| 152 | void EmitFPRecip64(EmitContext& ctx); | 151 | void EmitFPSqrt(EmitContext& ctx); |
| 153 | void EmitFPRecipSqrt32(EmitContext& ctx); | 152 | void EmitFPSin(EmitContext& ctx); |
| 154 | void EmitFPRecipSqrt64(EmitContext& ctx); | 153 | void EmitFPSinNotReduced(EmitContext& ctx); |
| 155 | void EmitFPSqrt(EmitContext& ctx); | 154 | void EmitFPExp2(EmitContext& ctx); |
| 156 | void EmitFPSin(EmitContext& ctx); | 155 | void EmitFPExp2NotReduced(EmitContext& ctx); |
| 157 | void EmitFPSinNotReduced(EmitContext& ctx); | 156 | void EmitFPCos(EmitContext& ctx); |
| 158 | void EmitFPExp2(EmitContext& ctx); | 157 | void EmitFPCosNotReduced(EmitContext& ctx); |
| 159 | void EmitFPExp2NotReduced(EmitContext& ctx); | 158 | void EmitFPLog2(EmitContext& ctx); |
| 160 | void EmitFPCos(EmitContext& ctx); | 159 | void EmitFPSaturate16(EmitContext& ctx); |
| 161 | void EmitFPCosNotReduced(EmitContext& ctx); | 160 | void EmitFPSaturate32(EmitContext& ctx); |
| 162 | void EmitFPLog2(EmitContext& ctx); | 161 | void EmitFPSaturate64(EmitContext& ctx); |
| 163 | void EmitFPSaturate16(EmitContext& ctx); | 162 | void EmitFPRoundEven16(EmitContext& ctx); |
| 164 | void EmitFPSaturate32(EmitContext& ctx); | 163 | void EmitFPRoundEven32(EmitContext& ctx); |
| 165 | void EmitFPSaturate64(EmitContext& ctx); | 164 | void EmitFPRoundEven64(EmitContext& ctx); |
| 166 | void EmitFPRoundEven16(EmitContext& ctx); | 165 | void EmitFPFloor16(EmitContext& ctx); |
| 167 | void EmitFPRoundEven32(EmitContext& ctx); | 166 | void EmitFPFloor32(EmitContext& ctx); |
| 168 | void EmitFPRoundEven64(EmitContext& ctx); | 167 | void EmitFPFloor64(EmitContext& ctx); |
| 169 | void EmitFPFloor16(EmitContext& ctx); | 168 | void EmitFPCeil16(EmitContext& ctx); |
| 170 | void EmitFPFloor32(EmitContext& ctx); | 169 | void EmitFPCeil32(EmitContext& ctx); |
| 171 | void EmitFPFloor64(EmitContext& ctx); | 170 | void EmitFPCeil64(EmitContext& ctx); |
| 172 | void EmitFPCeil16(EmitContext& ctx); | 171 | void EmitFPTrunc16(EmitContext& ctx); |
| 173 | void EmitFPCeil32(EmitContext& ctx); | 172 | void EmitFPTrunc32(EmitContext& ctx); |
| 174 | void EmitFPCeil64(EmitContext& ctx); | 173 | void EmitFPTrunc64(EmitContext& ctx); |
| 175 | void EmitFPTrunc16(EmitContext& ctx); | 174 | Id EmitIAdd32(EmitContext& ctx, IR::Inst* inst, Id a, Id b); |
| 176 | void EmitFPTrunc32(EmitContext& ctx); | 175 | void EmitIAdd64(EmitContext& ctx); |
| 177 | void EmitFPTrunc64(EmitContext& ctx); | 176 | Id EmitISub32(EmitContext& ctx, Id a, Id b); |
| 178 | Id EmitIAdd32(EmitContext& ctx, IR::Inst* inst, Id a, Id b); | 177 | void EmitISub64(EmitContext& ctx); |
| 179 | void EmitIAdd64(EmitContext& ctx); | 178 | Id EmitIMul32(EmitContext& ctx, Id a, Id b); |
| 180 | Id EmitISub32(EmitContext& ctx, Id a, Id b); | 179 | void EmitINeg32(EmitContext& ctx); |
| 181 | void EmitISub64(EmitContext& ctx); | 180 | void EmitIAbs32(EmitContext& ctx); |
| 182 | Id EmitIMul32(EmitContext& ctx, Id a, Id b); | 181 | Id EmitShiftLeftLogical32(EmitContext& ctx, Id base, Id shift); |
| 183 | void EmitINeg32(EmitContext& ctx); | 182 | void EmitShiftRightLogical32(EmitContext& ctx); |
| 184 | void EmitIAbs32(EmitContext& ctx); | 183 | void EmitShiftRightArithmetic32(EmitContext& ctx); |
| 185 | Id EmitShiftLeftLogical32(EmitContext& ctx, Id base, Id shift); | 184 | void EmitBitwiseAnd32(EmitContext& ctx); |
| 186 | void EmitShiftRightLogical32(EmitContext& ctx); | 185 | void EmitBitwiseOr32(EmitContext& ctx); |
| 187 | void EmitShiftRightArithmetic32(EmitContext& ctx); | 186 | void EmitBitwiseXor32(EmitContext& ctx); |
| 188 | void EmitBitwiseAnd32(EmitContext& ctx); | 187 | void EmitBitFieldInsert(EmitContext& ctx); |
| 189 | void EmitBitwiseOr32(EmitContext& ctx); | 188 | void EmitBitFieldSExtract(EmitContext& ctx); |
| 190 | void EmitBitwiseXor32(EmitContext& ctx); | 189 | Id EmitBitFieldUExtract(EmitContext& ctx, Id base, Id offset, Id count); |
| 191 | void EmitBitFieldInsert(EmitContext& ctx); | 190 | Id EmitSLessThan(EmitContext& ctx, Id lhs, Id rhs); |
| 192 | void EmitBitFieldSExtract(EmitContext& ctx); | 191 | void EmitULessThan(EmitContext& ctx); |
| 193 | Id EmitBitFieldUExtract(EmitContext& ctx, Id base, Id offset, Id count); | 192 | void EmitIEqual(EmitContext& ctx); |
| 194 | Id EmitSLessThan(EmitContext& ctx, Id lhs, Id rhs); | 193 | void EmitSLessThanEqual(EmitContext& ctx); |
| 195 | void EmitULessThan(EmitContext& ctx); | 194 | void EmitULessThanEqual(EmitContext& ctx); |
| 196 | void EmitIEqual(EmitContext& ctx); | 195 | Id EmitSGreaterThan(EmitContext& ctx, Id lhs, Id rhs); |
| 197 | void EmitSLessThanEqual(EmitContext& ctx); | 196 | void EmitUGreaterThan(EmitContext& ctx); |
| 198 | void EmitULessThanEqual(EmitContext& ctx); | 197 | void EmitINotEqual(EmitContext& ctx); |
| 199 | Id EmitSGreaterThan(EmitContext& ctx, Id lhs, Id rhs); | 198 | void EmitSGreaterThanEqual(EmitContext& ctx); |
| 200 | void EmitUGreaterThan(EmitContext& ctx); | 199 | Id EmitUGreaterThanEqual(EmitContext& ctx, Id lhs, Id rhs); |
| 201 | void EmitINotEqual(EmitContext& ctx); | 200 | void EmitLogicalOr(EmitContext& ctx); |
| 202 | void EmitSGreaterThanEqual(EmitContext& ctx); | 201 | void EmitLogicalAnd(EmitContext& ctx); |
| 203 | Id EmitUGreaterThanEqual(EmitContext& ctx, Id lhs, Id rhs); | 202 | void EmitLogicalXor(EmitContext& ctx); |
| 204 | void EmitLogicalOr(EmitContext& ctx); | 203 | void EmitLogicalNot(EmitContext& ctx); |
| 205 | void EmitLogicalAnd(EmitContext& ctx); | 204 | void EmitConvertS16F16(EmitContext& ctx); |
| 206 | void EmitLogicalXor(EmitContext& ctx); | 205 | void EmitConvertS16F32(EmitContext& ctx); |
| 207 | void EmitLogicalNot(EmitContext& ctx); | 206 | void EmitConvertS16F64(EmitContext& ctx); |
| 208 | void EmitConvertS16F16(EmitContext& ctx); | 207 | void EmitConvertS32F16(EmitContext& ctx); |
| 209 | void EmitConvertS16F32(EmitContext& ctx); | 208 | void EmitConvertS32F32(EmitContext& ctx); |
| 210 | void EmitConvertS16F64(EmitContext& ctx); | 209 | void EmitConvertS32F64(EmitContext& ctx); |
| 211 | void EmitConvertS32F16(EmitContext& ctx); | 210 | void EmitConvertS64F16(EmitContext& ctx); |
| 212 | void EmitConvertS32F32(EmitContext& ctx); | 211 | void EmitConvertS64F32(EmitContext& ctx); |
| 213 | void EmitConvertS32F64(EmitContext& ctx); | 212 | void EmitConvertS64F64(EmitContext& ctx); |
| 214 | void EmitConvertS64F16(EmitContext& ctx); | 213 | void EmitConvertU16F16(EmitContext& ctx); |
| 215 | void EmitConvertS64F32(EmitContext& ctx); | 214 | void EmitConvertU16F32(EmitContext& ctx); |
| 216 | void EmitConvertS64F64(EmitContext& ctx); | 215 | void EmitConvertU16F64(EmitContext& ctx); |
| 217 | void EmitConvertU16F16(EmitContext& ctx); | 216 | void EmitConvertU32F16(EmitContext& ctx); |
| 218 | void EmitConvertU16F32(EmitContext& ctx); | 217 | void EmitConvertU32F32(EmitContext& ctx); |
| 219 | void EmitConvertU16F64(EmitContext& ctx); | 218 | void EmitConvertU32F64(EmitContext& ctx); |
| 220 | void EmitConvertU32F16(EmitContext& ctx); | 219 | void EmitConvertU64F16(EmitContext& ctx); |
| 221 | void EmitConvertU32F32(EmitContext& ctx); | 220 | void EmitConvertU64F32(EmitContext& ctx); |
| 222 | void EmitConvertU32F64(EmitContext& ctx); | 221 | void EmitConvertU64F64(EmitContext& ctx); |
| 223 | void EmitConvertU64F16(EmitContext& ctx); | 222 | void EmitConvertU64U32(EmitContext& ctx); |
| 224 | void EmitConvertU64F32(EmitContext& ctx); | 223 | void EmitConvertU32U64(EmitContext& ctx); |
| 225 | void EmitConvertU64F64(EmitContext& ctx); | ||
| 226 | void EmitConvertU64U32(EmitContext& ctx); | ||
| 227 | void EmitConvertU32U64(EmitContext& ctx); | ||
| 228 | }; | ||
| 229 | 224 | ||
| 230 | } // namespace Shader::Backend::SPIRV | 225 | } // namespace Shader::Backend::SPIRV |
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_bitwise_conversion.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_bitwise_conversion.cpp index af82df99c..49c200498 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_bitwise_conversion.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_bitwise_conversion.cpp | |||
| @@ -6,51 +6,51 @@ | |||
| 6 | 6 | ||
| 7 | namespace Shader::Backend::SPIRV { | 7 | namespace Shader::Backend::SPIRV { |
| 8 | 8 | ||
| 9 | void EmitSPIRV::EmitBitCastU16F16(EmitContext&) { | 9 | void EmitBitCastU16F16(EmitContext&) { |
| 10 | throw NotImplementedException("SPIR-V Instruction"); | 10 | throw NotImplementedException("SPIR-V Instruction"); |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | Id EmitSPIRV::EmitBitCastU32F32(EmitContext& ctx, Id value) { | 13 | Id EmitBitCastU32F32(EmitContext& ctx, Id value) { |
| 14 | return ctx.OpBitcast(ctx.U32[1], value); | 14 | return ctx.OpBitcast(ctx.U32[1], value); |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | void EmitSPIRV::EmitBitCastU64F64(EmitContext&) { | 17 | void EmitBitCastU64F64(EmitContext&) { |
| 18 | throw NotImplementedException("SPIR-V Instruction"); | 18 | throw NotImplementedException("SPIR-V Instruction"); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | void EmitSPIRV::EmitBitCastF16U16(EmitContext&) { | 21 | void EmitBitCastF16U16(EmitContext&) { |
| 22 | throw NotImplementedException("SPIR-V Instruction"); | 22 | throw NotImplementedException("SPIR-V Instruction"); |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | Id EmitSPIRV::EmitBitCastF32U32(EmitContext& ctx, Id value) { | 25 | Id EmitBitCastF32U32(EmitContext& ctx, Id value) { |
| 26 | return ctx.OpBitcast(ctx.F32[1], value); | 26 | return ctx.OpBitcast(ctx.F32[1], value); |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | void EmitSPIRV::EmitBitCastF64U64(EmitContext&) { | 29 | void EmitBitCastF64U64(EmitContext&) { |
| 30 | throw NotImplementedException("SPIR-V Instruction"); | 30 | throw NotImplementedException("SPIR-V Instruction"); |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | void EmitSPIRV::EmitPackUint2x32(EmitContext&) { | 33 | void EmitPackUint2x32(EmitContext&) { |
| 34 | throw NotImplementedException("SPIR-V Instruction"); | 34 | throw NotImplementedException("SPIR-V Instruction"); |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | void EmitSPIRV::EmitUnpackUint2x32(EmitContext&) { | 37 | void EmitUnpackUint2x32(EmitContext&) { |
| 38 | throw NotImplementedException("SPIR-V Instruction"); | 38 | throw NotImplementedException("SPIR-V Instruction"); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | void EmitSPIRV::EmitPackFloat2x16(EmitContext&) { | 41 | void EmitPackFloat2x16(EmitContext&) { |
| 42 | throw NotImplementedException("SPIR-V Instruction"); | 42 | throw NotImplementedException("SPIR-V Instruction"); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | void EmitSPIRV::EmitUnpackFloat2x16(EmitContext&) { | 45 | void EmitUnpackFloat2x16(EmitContext&) { |
| 46 | throw NotImplementedException("SPIR-V Instruction"); | 46 | throw NotImplementedException("SPIR-V Instruction"); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | void EmitSPIRV::EmitPackDouble2x32(EmitContext&) { | 49 | void EmitPackDouble2x32(EmitContext&) { |
| 50 | throw NotImplementedException("SPIR-V Instruction"); | 50 | throw NotImplementedException("SPIR-V Instruction"); |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | void EmitSPIRV::EmitUnpackDouble2x32(EmitContext&) { | 53 | void EmitUnpackDouble2x32(EmitContext&) { |
| 54 | throw NotImplementedException("SPIR-V Instruction"); | 54 | throw NotImplementedException("SPIR-V Instruction"); |
| 55 | } | 55 | } |
| 56 | 56 | ||
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_composite.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_composite.cpp index a7374c89d..348e4796d 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_composite.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_composite.cpp | |||
| @@ -6,99 +6,99 @@ | |||
| 6 | 6 | ||
| 7 | namespace Shader::Backend::SPIRV { | 7 | namespace Shader::Backend::SPIRV { |
| 8 | 8 | ||
| 9 | void EmitSPIRV::EmitCompositeConstructU32x2(EmitContext&) { | 9 | void EmitCompositeConstructU32x2(EmitContext&) { |
| 10 | throw NotImplementedException("SPIR-V Instruction"); | 10 | throw NotImplementedException("SPIR-V Instruction"); |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | void EmitSPIRV::EmitCompositeConstructU32x3(EmitContext&) { | 13 | void EmitCompositeConstructU32x3(EmitContext&) { |
| 14 | throw NotImplementedException("SPIR-V Instruction"); | 14 | throw NotImplementedException("SPIR-V Instruction"); |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | void EmitSPIRV::EmitCompositeConstructU32x4(EmitContext&) { | 17 | void EmitCompositeConstructU32x4(EmitContext&) { |
| 18 | throw NotImplementedException("SPIR-V Instruction"); | 18 | throw NotImplementedException("SPIR-V Instruction"); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | void EmitSPIRV::EmitCompositeExtractU32x2(EmitContext&) { | 21 | void EmitCompositeExtractU32x2(EmitContext&) { |
| 22 | throw NotImplementedException("SPIR-V Instruction"); | 22 | throw NotImplementedException("SPIR-V Instruction"); |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | Id EmitSPIRV::EmitCompositeExtractU32x3(EmitContext& ctx, Id vector, u32 index) { | 25 | Id EmitCompositeExtractU32x3(EmitContext& ctx, Id vector, u32 index) { |
| 26 | return ctx.OpCompositeExtract(ctx.U32[1], vector, index); | 26 | return ctx.OpCompositeExtract(ctx.U32[1], vector, index); |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | void EmitSPIRV::EmitCompositeExtractU32x4(EmitContext&) { | 29 | void EmitCompositeExtractU32x4(EmitContext&) { |
| 30 | throw NotImplementedException("SPIR-V Instruction"); | 30 | throw NotImplementedException("SPIR-V Instruction"); |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | void EmitSPIRV::EmitCompositeConstructF16x2(EmitContext&) { | 33 | void EmitCompositeConstructF16x2(EmitContext&) { |
| 34 | throw NotImplementedException("SPIR-V Instruction"); | 34 | throw NotImplementedException("SPIR-V Instruction"); |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | void EmitSPIRV::EmitCompositeConstructF16x3(EmitContext&) { | 37 | void EmitCompositeConstructF16x3(EmitContext&) { |
| 38 | throw NotImplementedException("SPIR-V Instruction"); | 38 | throw NotImplementedException("SPIR-V Instruction"); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | void EmitSPIRV::EmitCompositeConstructF16x4(EmitContext&) { | 41 | void EmitCompositeConstructF16x4(EmitContext&) { |
| 42 | throw NotImplementedException("SPIR-V Instruction"); | 42 | throw NotImplementedException("SPIR-V Instruction"); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | void EmitSPIRV::EmitCompositeExtractF16x2(EmitContext&) { | 45 | void EmitCompositeExtractF16x2(EmitContext&) { |
| 46 | throw NotImplementedException("SPIR-V Instruction"); | 46 | throw NotImplementedException("SPIR-V Instruction"); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | void EmitSPIRV::EmitCompositeExtractF16x3(EmitContext&) { | 49 | void EmitCompositeExtractF16x3(EmitContext&) { |
| 50 | throw NotImplementedException("SPIR-V Instruction"); | 50 | throw NotImplementedException("SPIR-V Instruction"); |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | void EmitSPIRV::EmitCompositeExtractF16x4(EmitContext&) { | 53 | void EmitCompositeExtractF16x4(EmitContext&) { |
| 54 | throw NotImplementedException("SPIR-V Instruction"); | 54 | throw NotImplementedException("SPIR-V Instruction"); |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | void EmitSPIRV::EmitCompositeConstructF32x2(EmitContext&) { | 57 | void EmitCompositeConstructF32x2(EmitContext&) { |
| 58 | throw NotImplementedException("SPIR-V Instruction"); | 58 | throw NotImplementedException("SPIR-V Instruction"); |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | void EmitSPIRV::EmitCompositeConstructF32x3(EmitContext&) { | 61 | void EmitCompositeConstructF32x3(EmitContext&) { |
| 62 | throw NotImplementedException("SPIR-V Instruction"); | 62 | throw NotImplementedException("SPIR-V Instruction"); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | void EmitSPIRV::EmitCompositeConstructF32x4(EmitContext&) { | 65 | void EmitCompositeConstructF32x4(EmitContext&) { |
| 66 | throw NotImplementedException("SPIR-V Instruction"); | 66 | throw NotImplementedException("SPIR-V Instruction"); |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | void EmitSPIRV::EmitCompositeExtractF32x2(EmitContext&) { | 69 | void EmitCompositeExtractF32x2(EmitContext&) { |
| 70 | throw NotImplementedException("SPIR-V Instruction"); | 70 | throw NotImplementedException("SPIR-V Instruction"); |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | void EmitSPIRV::EmitCompositeExtractF32x3(EmitContext&) { | 73 | void EmitCompositeExtractF32x3(EmitContext&) { |
| 74 | throw NotImplementedException("SPIR-V Instruction"); | 74 | throw NotImplementedException("SPIR-V Instruction"); |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | void EmitSPIRV::EmitCompositeExtractF32x4(EmitContext&) { | 77 | void EmitCompositeExtractF32x4(EmitContext&) { |
| 78 | throw NotImplementedException("SPIR-V Instruction"); | 78 | throw NotImplementedException("SPIR-V Instruction"); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | void EmitSPIRV::EmitCompositeConstructF64x2(EmitContext&) { | 81 | void EmitCompositeConstructF64x2(EmitContext&) { |
| 82 | throw NotImplementedException("SPIR-V Instruction"); | 82 | throw NotImplementedException("SPIR-V Instruction"); |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | void EmitSPIRV::EmitCompositeConstructF64x3(EmitContext&) { | 85 | void EmitCompositeConstructF64x3(EmitContext&) { |
| 86 | throw NotImplementedException("SPIR-V Instruction"); | 86 | throw NotImplementedException("SPIR-V Instruction"); |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | void EmitSPIRV::EmitCompositeConstructF64x4(EmitContext&) { | 89 | void EmitCompositeConstructF64x4(EmitContext&) { |
| 90 | throw NotImplementedException("SPIR-V Instruction"); | 90 | throw NotImplementedException("SPIR-V Instruction"); |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | void EmitSPIRV::EmitCompositeExtractF64x2(EmitContext&) { | 93 | void EmitCompositeExtractF64x2(EmitContext&) { |
| 94 | throw NotImplementedException("SPIR-V Instruction"); | 94 | throw NotImplementedException("SPIR-V Instruction"); |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | void EmitSPIRV::EmitCompositeExtractF64x3(EmitContext&) { | 97 | void EmitCompositeExtractF64x3(EmitContext&) { |
| 98 | throw NotImplementedException("SPIR-V Instruction"); | 98 | throw NotImplementedException("SPIR-V Instruction"); |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | void EmitSPIRV::EmitCompositeExtractF64x4(EmitContext&) { | 101 | void EmitCompositeExtractF64x4(EmitContext&) { |
| 102 | throw NotImplementedException("SPIR-V Instruction"); | 102 | throw NotImplementedException("SPIR-V Instruction"); |
| 103 | } | 103 | } |
| 104 | 104 | ||
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp index f4c9970eb..eb9c01c5a 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp | |||
| @@ -6,31 +6,31 @@ | |||
| 6 | 6 | ||
| 7 | namespace Shader::Backend::SPIRV { | 7 | namespace Shader::Backend::SPIRV { |
| 8 | 8 | ||
| 9 | void EmitSPIRV::EmitGetRegister(EmitContext&) { | 9 | void EmitGetRegister(EmitContext&) { |
| 10 | throw NotImplementedException("SPIR-V Instruction"); | 10 | throw NotImplementedException("SPIR-V Instruction"); |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | void EmitSPIRV::EmitSetRegister(EmitContext&) { | 13 | void EmitSetRegister(EmitContext&) { |
| 14 | throw NotImplementedException("SPIR-V Instruction"); | 14 | throw NotImplementedException("SPIR-V Instruction"); |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | void EmitSPIRV::EmitGetPred(EmitContext&) { | 17 | void EmitGetPred(EmitContext&) { |
| 18 | throw NotImplementedException("SPIR-V Instruction"); | 18 | throw NotImplementedException("SPIR-V Instruction"); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | void EmitSPIRV::EmitSetPred(EmitContext&) { | 21 | void EmitSetPred(EmitContext&) { |
| 22 | throw NotImplementedException("SPIR-V Instruction"); | 22 | throw NotImplementedException("SPIR-V Instruction"); |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | void EmitSPIRV::EmitSetGotoVariable(EmitContext&) { | 25 | void EmitSetGotoVariable(EmitContext&) { |
| 26 | throw NotImplementedException("SPIR-V Instruction"); | 26 | throw NotImplementedException("SPIR-V Instruction"); |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | void EmitSPIRV::EmitGetGotoVariable(EmitContext&) { | 29 | void EmitGetGotoVariable(EmitContext&) { |
| 30 | throw NotImplementedException("SPIR-V Instruction"); | 30 | throw NotImplementedException("SPIR-V Instruction"); |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | Id EmitSPIRV::EmitGetCbuf(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset) { | 33 | Id EmitGetCbuf(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset) { |
| 34 | if (!binding.IsImmediate()) { | 34 | if (!binding.IsImmediate()) { |
| 35 | throw NotImplementedException("Constant buffer indexing"); | 35 | throw NotImplementedException("Constant buffer indexing"); |
| 36 | } | 36 | } |
| @@ -43,59 +43,59 @@ Id EmitSPIRV::EmitGetCbuf(EmitContext& ctx, const IR::Value& binding, const IR:: | |||
| 43 | return ctx.OpLoad(ctx.U32[1], access_chain); | 43 | return ctx.OpLoad(ctx.U32[1], access_chain); |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | void EmitSPIRV::EmitGetAttribute(EmitContext&) { | 46 | void EmitGetAttribute(EmitContext&) { |
| 47 | throw NotImplementedException("SPIR-V Instruction"); | 47 | throw NotImplementedException("SPIR-V Instruction"); |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | void EmitSPIRV::EmitSetAttribute(EmitContext&) { | 50 | void EmitSetAttribute(EmitContext&) { |
| 51 | throw NotImplementedException("SPIR-V Instruction"); | 51 | throw NotImplementedException("SPIR-V Instruction"); |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | void EmitSPIRV::EmitGetAttributeIndexed(EmitContext&) { | 54 | void EmitGetAttributeIndexed(EmitContext&) { |
| 55 | throw NotImplementedException("SPIR-V Instruction"); | 55 | throw NotImplementedException("SPIR-V Instruction"); |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | void EmitSPIRV::EmitSetAttributeIndexed(EmitContext&) { | 58 | void EmitSetAttributeIndexed(EmitContext&) { |
| 59 | throw NotImplementedException("SPIR-V Instruction"); | 59 | throw NotImplementedException("SPIR-V Instruction"); |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | void EmitSPIRV::EmitGetZFlag(EmitContext&) { | 62 | void EmitGetZFlag(EmitContext&) { |
| 63 | throw NotImplementedException("SPIR-V Instruction"); | 63 | throw NotImplementedException("SPIR-V Instruction"); |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | void EmitSPIRV::EmitGetSFlag(EmitContext&) { | 66 | void EmitGetSFlag(EmitContext&) { |
| 67 | throw NotImplementedException("SPIR-V Instruction"); | 67 | throw NotImplementedException("SPIR-V Instruction"); |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | void EmitSPIRV::EmitGetCFlag(EmitContext&) { | 70 | void EmitGetCFlag(EmitContext&) { |
| 71 | throw NotImplementedException("SPIR-V Instruction"); | 71 | throw NotImplementedException("SPIR-V Instruction"); |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | void EmitSPIRV::EmitGetOFlag(EmitContext&) { | 74 | void EmitGetOFlag(EmitContext&) { |
| 75 | throw NotImplementedException("SPIR-V Instruction"); | 75 | throw NotImplementedException("SPIR-V Instruction"); |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | void EmitSPIRV::EmitSetZFlag(EmitContext&) { | 78 | void EmitSetZFlag(EmitContext&) { |
| 79 | throw NotImplementedException("SPIR-V Instruction"); | 79 | throw NotImplementedException("SPIR-V Instruction"); |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | void EmitSPIRV::EmitSetSFlag(EmitContext&) { | 82 | void EmitSetSFlag(EmitContext&) { |
| 83 | throw NotImplementedException("SPIR-V Instruction"); | 83 | throw NotImplementedException("SPIR-V Instruction"); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | void EmitSPIRV::EmitSetCFlag(EmitContext&) { | 86 | void EmitSetCFlag(EmitContext&) { |
| 87 | throw NotImplementedException("SPIR-V Instruction"); | 87 | throw NotImplementedException("SPIR-V Instruction"); |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | void EmitSPIRV::EmitSetOFlag(EmitContext&) { | 90 | void EmitSetOFlag(EmitContext&) { |
| 91 | throw NotImplementedException("SPIR-V Instruction"); | 91 | throw NotImplementedException("SPIR-V Instruction"); |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | Id EmitSPIRV::EmitWorkgroupId(EmitContext& ctx) { | 94 | Id EmitWorkgroupId(EmitContext& ctx) { |
| 95 | return ctx.OpLoad(ctx.U32[3], ctx.workgroup_id); | 95 | return ctx.OpLoad(ctx.U32[3], ctx.workgroup_id); |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | Id EmitSPIRV::EmitLocalInvocationId(EmitContext& ctx) { | 98 | Id EmitLocalInvocationId(EmitContext& ctx) { |
| 99 | return ctx.OpLoad(ctx.U32[3], ctx.local_invocation_id); | 99 | return ctx.OpLoad(ctx.U32[3], ctx.local_invocation_id); |
| 100 | } | 100 | } |
| 101 | 101 | ||
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_control_flow.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_control_flow.cpp index 549c1907a..6c4199664 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_control_flow.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_control_flow.cpp | |||
| @@ -6,25 +6,25 @@ | |||
| 6 | 6 | ||
| 7 | namespace Shader::Backend::SPIRV { | 7 | namespace Shader::Backend::SPIRV { |
| 8 | 8 | ||
| 9 | void EmitSPIRV::EmitBranch(EmitContext& ctx, IR::Block* label) { | 9 | void EmitBranch(EmitContext& ctx, IR::Block* label) { |
| 10 | ctx.OpBranch(label->Definition<Id>()); | 10 | ctx.OpBranch(label->Definition<Id>()); |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | void EmitSPIRV::EmitBranchConditional(EmitContext& ctx, Id condition, IR::Block* true_label, | 13 | void EmitBranchConditional(EmitContext& ctx, Id condition, IR::Block* true_label, |
| 14 | IR::Block* false_label) { | 14 | IR::Block* false_label) { |
| 15 | ctx.OpBranchConditional(condition, true_label->Definition<Id>(), false_label->Definition<Id>()); | 15 | ctx.OpBranchConditional(condition, true_label->Definition<Id>(), false_label->Definition<Id>()); |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | void EmitSPIRV::EmitLoopMerge(EmitContext& ctx, IR::Block* merge_label, IR::Block* continue_label) { | 18 | void EmitLoopMerge(EmitContext& ctx, IR::Block* merge_label, IR::Block* continue_label) { |
| 19 | ctx.OpLoopMerge(merge_label->Definition<Id>(), continue_label->Definition<Id>(), | 19 | ctx.OpLoopMerge(merge_label->Definition<Id>(), continue_label->Definition<Id>(), |
| 20 | spv::LoopControlMask::MaskNone); | 20 | spv::LoopControlMask::MaskNone); |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | void EmitSPIRV::EmitSelectionMerge(EmitContext& ctx, IR::Block* merge_label) { | 23 | void EmitSelectionMerge(EmitContext& ctx, IR::Block* merge_label) { |
| 24 | ctx.OpSelectionMerge(merge_label->Definition<Id>(), spv::SelectionControlMask::MaskNone); | 24 | ctx.OpSelectionMerge(merge_label->Definition<Id>(), spv::SelectionControlMask::MaskNone); |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | void EmitSPIRV::EmitReturn(EmitContext& ctx) { | 27 | void EmitReturn(EmitContext& ctx) { |
| 28 | ctx.OpReturn(); | 28 | ctx.OpReturn(); |
| 29 | } | 29 | } |
| 30 | 30 | ||
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_floating_point.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_floating_point.cpp index c9bc121f8..d24fbb353 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_floating_point.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_floating_point.cpp | |||
| @@ -33,187 +33,187 @@ Id Decorate(EmitContext& ctx, IR::Inst* inst, Id op) { | |||
| 33 | 33 | ||
| 34 | } // Anonymous namespace | 34 | } // Anonymous namespace |
| 35 | 35 | ||
| 36 | void EmitSPIRV::EmitFPAbs16(EmitContext&) { | 36 | void EmitFPAbs16(EmitContext&) { |
| 37 | throw NotImplementedException("SPIR-V Instruction"); | 37 | throw NotImplementedException("SPIR-V Instruction"); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | void EmitSPIRV::EmitFPAbs32(EmitContext&) { | 40 | void EmitFPAbs32(EmitContext&) { |
| 41 | throw NotImplementedException("SPIR-V Instruction"); | 41 | throw NotImplementedException("SPIR-V Instruction"); |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | void EmitSPIRV::EmitFPAbs64(EmitContext&) { | 44 | void EmitFPAbs64(EmitContext&) { |
| 45 | throw NotImplementedException("SPIR-V Instruction"); | 45 | throw NotImplementedException("SPIR-V Instruction"); |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | Id EmitSPIRV::EmitFPAdd16(EmitContext& ctx, IR::Inst* inst, Id a, Id b) { | 48 | Id EmitFPAdd16(EmitContext& ctx, IR::Inst* inst, Id a, Id b) { |
| 49 | return Decorate(ctx, inst, ctx.OpFAdd(ctx.F16[1], a, b)); | 49 | return Decorate(ctx, inst, ctx.OpFAdd(ctx.F16[1], a, b)); |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | Id EmitSPIRV::EmitFPAdd32(EmitContext& ctx, IR::Inst* inst, Id a, Id b) { | 52 | Id EmitFPAdd32(EmitContext& ctx, IR::Inst* inst, Id a, Id b) { |
| 53 | return Decorate(ctx, inst, ctx.OpFAdd(ctx.F32[1], a, b)); | 53 | return Decorate(ctx, inst, ctx.OpFAdd(ctx.F32[1], a, b)); |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | Id EmitSPIRV::EmitFPAdd64(EmitContext& ctx, IR::Inst* inst, Id a, Id b) { | 56 | Id EmitFPAdd64(EmitContext& ctx, IR::Inst* inst, Id a, Id b) { |
| 57 | return Decorate(ctx, inst, ctx.OpFAdd(ctx.F64[1], a, b)); | 57 | return Decorate(ctx, inst, ctx.OpFAdd(ctx.F64[1], a, b)); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | Id EmitSPIRV::EmitFPFma16(EmitContext& ctx, IR::Inst* inst, Id a, Id b, Id c) { | 60 | Id EmitFPFma16(EmitContext& ctx, IR::Inst* inst, Id a, Id b, Id c) { |
| 61 | return Decorate(ctx, inst, ctx.OpFma(ctx.F16[1], a, b, c)); | 61 | return Decorate(ctx, inst, ctx.OpFma(ctx.F16[1], a, b, c)); |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | Id EmitSPIRV::EmitFPFma32(EmitContext& ctx, IR::Inst* inst, Id a, Id b, Id c) { | 64 | Id EmitFPFma32(EmitContext& ctx, IR::Inst* inst, Id a, Id b, Id c) { |
| 65 | return Decorate(ctx, inst, ctx.OpFma(ctx.F32[1], a, b, c)); | 65 | return Decorate(ctx, inst, ctx.OpFma(ctx.F32[1], a, b, c)); |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | Id EmitSPIRV::EmitFPFma64(EmitContext& ctx, IR::Inst* inst, Id a, Id b, Id c) { | 68 | Id EmitFPFma64(EmitContext& ctx, IR::Inst* inst, Id a, Id b, Id c) { |
| 69 | return Decorate(ctx, inst, ctx.OpFma(ctx.F64[1], a, b, c)); | 69 | return Decorate(ctx, inst, ctx.OpFma(ctx.F64[1], a, b, c)); |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | void EmitSPIRV::EmitFPMax32(EmitContext&) { | 72 | void EmitFPMax32(EmitContext&) { |
| 73 | throw NotImplementedException("SPIR-V Instruction"); | 73 | throw NotImplementedException("SPIR-V Instruction"); |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | void EmitSPIRV::EmitFPMax64(EmitContext&) { | 76 | void EmitFPMax64(EmitContext&) { |
| 77 | throw NotImplementedException("SPIR-V Instruction"); | 77 | throw NotImplementedException("SPIR-V Instruction"); |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | void EmitSPIRV::EmitFPMin32(EmitContext&) { | 80 | void EmitFPMin32(EmitContext&) { |
| 81 | throw NotImplementedException("SPIR-V Instruction"); | 81 | throw NotImplementedException("SPIR-V Instruction"); |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | void EmitSPIRV::EmitFPMin64(EmitContext&) { | 84 | void EmitFPMin64(EmitContext&) { |
| 85 | throw NotImplementedException("SPIR-V Instruction"); | 85 | throw NotImplementedException("SPIR-V Instruction"); |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | Id EmitSPIRV::EmitFPMul16(EmitContext& ctx, IR::Inst* inst, Id a, Id b) { | 88 | Id EmitFPMul16(EmitContext& ctx, IR::Inst* inst, Id a, Id b) { |
| 89 | return Decorate(ctx, inst, ctx.OpFMul(ctx.F16[1], a, b)); | 89 | return Decorate(ctx, inst, ctx.OpFMul(ctx.F16[1], a, b)); |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | Id EmitSPIRV::EmitFPMul32(EmitContext& ctx, IR::Inst* inst, Id a, Id b) { | 92 | Id EmitFPMul32(EmitContext& ctx, IR::Inst* inst, Id a, Id b) { |
| 93 | return Decorate(ctx, inst, ctx.OpFMul(ctx.F32[1], a, b)); | 93 | return Decorate(ctx, inst, ctx.OpFMul(ctx.F32[1], a, b)); |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | Id EmitSPIRV::EmitFPMul64(EmitContext& ctx, IR::Inst* inst, Id a, Id b) { | 96 | Id EmitFPMul64(EmitContext& ctx, IR::Inst* inst, Id a, Id b) { |
| 97 | return Decorate(ctx, inst, ctx.OpFMul(ctx.F64[1], a, b)); | 97 | return Decorate(ctx, inst, ctx.OpFMul(ctx.F64[1], a, b)); |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | void EmitSPIRV::EmitFPNeg16(EmitContext&) { | 100 | void EmitFPNeg16(EmitContext&) { |
| 101 | throw NotImplementedException("SPIR-V Instruction"); | 101 | throw NotImplementedException("SPIR-V Instruction"); |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | void EmitSPIRV::EmitFPNeg32(EmitContext&) { | 104 | void EmitFPNeg32(EmitContext&) { |
| 105 | throw NotImplementedException("SPIR-V Instruction"); | 105 | throw NotImplementedException("SPIR-V Instruction"); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | void EmitSPIRV::EmitFPNeg64(EmitContext&) { | 108 | void EmitFPNeg64(EmitContext&) { |
| 109 | throw NotImplementedException("SPIR-V Instruction"); | 109 | throw NotImplementedException("SPIR-V Instruction"); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | void EmitSPIRV::EmitFPRecip32(EmitContext&) { | 112 | void EmitFPRecip32(EmitContext&) { |
| 113 | throw NotImplementedException("SPIR-V Instruction"); | 113 | throw NotImplementedException("SPIR-V Instruction"); |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | void EmitSPIRV::EmitFPRecip64(EmitContext&) { | 116 | void EmitFPRecip64(EmitContext&) { |
| 117 | throw NotImplementedException("SPIR-V Instruction"); | 117 | throw NotImplementedException("SPIR-V Instruction"); |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | void EmitSPIRV::EmitFPRecipSqrt32(EmitContext&) { | 120 | void EmitFPRecipSqrt32(EmitContext&) { |
| 121 | throw NotImplementedException("SPIR-V Instruction"); | 121 | throw NotImplementedException("SPIR-V Instruction"); |
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | void EmitSPIRV::EmitFPRecipSqrt64(EmitContext&) { | 124 | void EmitFPRecipSqrt64(EmitContext&) { |
| 125 | throw NotImplementedException("SPIR-V Instruction"); | 125 | throw NotImplementedException("SPIR-V Instruction"); |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | void EmitSPIRV::EmitFPSqrt(EmitContext&) { | 128 | void EmitFPSqrt(EmitContext&) { |
| 129 | throw NotImplementedException("SPIR-V Instruction"); | 129 | throw NotImplementedException("SPIR-V Instruction"); |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | void EmitSPIRV::EmitFPSin(EmitContext&) { | 132 | void EmitFPSin(EmitContext&) { |
| 133 | throw NotImplementedException("SPIR-V Instruction"); | 133 | throw NotImplementedException("SPIR-V Instruction"); |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | void EmitSPIRV::EmitFPSinNotReduced(EmitContext&) { | 136 | void EmitFPSinNotReduced(EmitContext&) { |
| 137 | throw NotImplementedException("SPIR-V Instruction"); | 137 | throw NotImplementedException("SPIR-V Instruction"); |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | void EmitSPIRV::EmitFPExp2(EmitContext&) { | 140 | void EmitFPExp2(EmitContext&) { |
| 141 | throw NotImplementedException("SPIR-V Instruction"); | 141 | throw NotImplementedException("SPIR-V Instruction"); |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | void EmitSPIRV::EmitFPExp2NotReduced(EmitContext&) { | 144 | void EmitFPExp2NotReduced(EmitContext&) { |
| 145 | throw NotImplementedException("SPIR-V Instruction"); | 145 | throw NotImplementedException("SPIR-V Instruction"); |
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | void EmitSPIRV::EmitFPCos(EmitContext&) { | 148 | void EmitFPCos(EmitContext&) { |
| 149 | throw NotImplementedException("SPIR-V Instruction"); | 149 | throw NotImplementedException("SPIR-V Instruction"); |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | void EmitSPIRV::EmitFPCosNotReduced(EmitContext&) { | 152 | void EmitFPCosNotReduced(EmitContext&) { |
| 153 | throw NotImplementedException("SPIR-V Instruction"); | 153 | throw NotImplementedException("SPIR-V Instruction"); |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | void EmitSPIRV::EmitFPLog2(EmitContext&) { | 156 | void EmitFPLog2(EmitContext&) { |
| 157 | throw NotImplementedException("SPIR-V Instruction"); | 157 | throw NotImplementedException("SPIR-V Instruction"); |
| 158 | } | 158 | } |
| 159 | 159 | ||
| 160 | void EmitSPIRV::EmitFPSaturate16(EmitContext&) { | 160 | void EmitFPSaturate16(EmitContext&) { |
| 161 | throw NotImplementedException("SPIR-V Instruction"); | 161 | throw NotImplementedException("SPIR-V Instruction"); |
| 162 | } | 162 | } |
| 163 | 163 | ||
| 164 | void EmitSPIRV::EmitFPSaturate32(EmitContext&) { | 164 | void EmitFPSaturate32(EmitContext&) { |
| 165 | throw NotImplementedException("SPIR-V Instruction"); | 165 | throw NotImplementedException("SPIR-V Instruction"); |
| 166 | } | 166 | } |
| 167 | 167 | ||
| 168 | void EmitSPIRV::EmitFPSaturate64(EmitContext&) { | 168 | void EmitFPSaturate64(EmitContext&) { |
| 169 | throw NotImplementedException("SPIR-V Instruction"); | 169 | throw NotImplementedException("SPIR-V Instruction"); |
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | void EmitSPIRV::EmitFPRoundEven16(EmitContext&) { | 172 | void EmitFPRoundEven16(EmitContext&) { |
| 173 | throw NotImplementedException("SPIR-V Instruction"); | 173 | throw NotImplementedException("SPIR-V Instruction"); |
| 174 | } | 174 | } |
| 175 | 175 | ||
| 176 | void EmitSPIRV::EmitFPRoundEven32(EmitContext&) { | 176 | void EmitFPRoundEven32(EmitContext&) { |
| 177 | throw NotImplementedException("SPIR-V Instruction"); | 177 | throw NotImplementedException("SPIR-V Instruction"); |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | void EmitSPIRV::EmitFPRoundEven64(EmitContext&) { | 180 | void EmitFPRoundEven64(EmitContext&) { |
| 181 | throw NotImplementedException("SPIR-V Instruction"); | 181 | throw NotImplementedException("SPIR-V Instruction"); |
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | void EmitSPIRV::EmitFPFloor16(EmitContext&) { | 184 | void EmitFPFloor16(EmitContext&) { |
| 185 | throw NotImplementedException("SPIR-V Instruction"); | 185 | throw NotImplementedException("SPIR-V Instruction"); |
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | void EmitSPIRV::EmitFPFloor32(EmitContext&) { | 188 | void EmitFPFloor32(EmitContext&) { |
| 189 | throw NotImplementedException("SPIR-V Instruction"); | 189 | throw NotImplementedException("SPIR-V Instruction"); |
| 190 | } | 190 | } |
| 191 | 191 | ||
| 192 | void EmitSPIRV::EmitFPFloor64(EmitContext&) { | 192 | void EmitFPFloor64(EmitContext&) { |
| 193 | throw NotImplementedException("SPIR-V Instruction"); | 193 | throw NotImplementedException("SPIR-V Instruction"); |
| 194 | } | 194 | } |
| 195 | 195 | ||
| 196 | void EmitSPIRV::EmitFPCeil16(EmitContext&) { | 196 | void EmitFPCeil16(EmitContext&) { |
| 197 | throw NotImplementedException("SPIR-V Instruction"); | 197 | throw NotImplementedException("SPIR-V Instruction"); |
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | void EmitSPIRV::EmitFPCeil32(EmitContext&) { | 200 | void EmitFPCeil32(EmitContext&) { |
| 201 | throw NotImplementedException("SPIR-V Instruction"); | 201 | throw NotImplementedException("SPIR-V Instruction"); |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | void EmitSPIRV::EmitFPCeil64(EmitContext&) { | 204 | void EmitFPCeil64(EmitContext&) { |
| 205 | throw NotImplementedException("SPIR-V Instruction"); | 205 | throw NotImplementedException("SPIR-V Instruction"); |
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | void EmitSPIRV::EmitFPTrunc16(EmitContext&) { | 208 | void EmitFPTrunc16(EmitContext&) { |
| 209 | throw NotImplementedException("SPIR-V Instruction"); | 209 | throw NotImplementedException("SPIR-V Instruction"); |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | void EmitSPIRV::EmitFPTrunc32(EmitContext&) { | 212 | void EmitFPTrunc32(EmitContext&) { |
| 213 | throw NotImplementedException("SPIR-V Instruction"); | 213 | throw NotImplementedException("SPIR-V Instruction"); |
| 214 | } | 214 | } |
| 215 | 215 | ||
| 216 | void EmitSPIRV::EmitFPTrunc64(EmitContext&) { | 216 | void EmitFPTrunc64(EmitContext&) { |
| 217 | throw NotImplementedException("SPIR-V Instruction"); | 217 | throw NotImplementedException("SPIR-V Instruction"); |
| 218 | } | 218 | } |
| 219 | 219 | ||
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp index 32af94a73..a1d16b81e 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_integer.cpp | |||
| @@ -6,126 +6,126 @@ | |||
| 6 | 6 | ||
| 7 | namespace Shader::Backend::SPIRV { | 7 | namespace Shader::Backend::SPIRV { |
| 8 | 8 | ||
| 9 | Id EmitSPIRV::EmitIAdd32(EmitContext& ctx, IR::Inst* inst, Id a, Id b) { | 9 | Id EmitIAdd32(EmitContext& ctx, IR::Inst* inst, Id a, Id b) { |
| 10 | if (inst->HasAssociatedPseudoOperation()) { | 10 | if (inst->HasAssociatedPseudoOperation()) { |
| 11 | throw NotImplementedException("Pseudo-operations on IAdd32"); | 11 | throw NotImplementedException("Pseudo-operations on IAdd32"); |
| 12 | } | 12 | } |
| 13 | return ctx.OpIAdd(ctx.U32[1], a, b); | 13 | return ctx.OpIAdd(ctx.U32[1], a, b); |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | void EmitSPIRV::EmitIAdd64(EmitContext&) { | 16 | void EmitIAdd64(EmitContext&) { |
| 17 | throw NotImplementedException("SPIR-V Instruction"); | 17 | throw NotImplementedException("SPIR-V Instruction"); |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | Id EmitSPIRV::EmitISub32(EmitContext& ctx, Id a, Id b) { | 20 | Id EmitISub32(EmitContext& ctx, Id a, Id b) { |
| 21 | return ctx.OpISub(ctx.U32[1], a, b); | 21 | return ctx.OpISub(ctx.U32[1], a, b); |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | void EmitSPIRV::EmitISub64(EmitContext&) { | 24 | void EmitISub64(EmitContext&) { |
| 25 | throw NotImplementedException("SPIR-V Instruction"); | 25 | throw NotImplementedException("SPIR-V Instruction"); |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | Id EmitSPIRV::EmitIMul32(EmitContext& ctx, Id a, Id b) { | 28 | Id EmitIMul32(EmitContext& ctx, Id a, Id b) { |
| 29 | return ctx.OpIMul(ctx.U32[1], a, b); | 29 | return ctx.OpIMul(ctx.U32[1], a, b); |
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | void EmitSPIRV::EmitINeg32(EmitContext&) { | 32 | void EmitINeg32(EmitContext&) { |
| 33 | throw NotImplementedException("SPIR-V Instruction"); | 33 | throw NotImplementedException("SPIR-V Instruction"); |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | void EmitSPIRV::EmitIAbs32(EmitContext&) { | 36 | void EmitIAbs32(EmitContext&) { |
| 37 | throw NotImplementedException("SPIR-V Instruction"); | 37 | throw NotImplementedException("SPIR-V Instruction"); |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | Id EmitSPIRV::EmitShiftLeftLogical32(EmitContext& ctx, Id base, Id shift) { | 40 | Id EmitShiftLeftLogical32(EmitContext& ctx, Id base, Id shift) { |
| 41 | return ctx.OpShiftLeftLogical(ctx.U32[1], base, shift); | 41 | return ctx.OpShiftLeftLogical(ctx.U32[1], base, shift); |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | void EmitSPIRV::EmitShiftRightLogical32(EmitContext&) { | 44 | void EmitShiftRightLogical32(EmitContext&) { |
| 45 | throw NotImplementedException("SPIR-V Instruction"); | 45 | throw NotImplementedException("SPIR-V Instruction"); |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | void EmitSPIRV::EmitShiftRightArithmetic32(EmitContext&) { | 48 | void EmitShiftRightArithmetic32(EmitContext&) { |
| 49 | throw NotImplementedException("SPIR-V Instruction"); | 49 | throw NotImplementedException("SPIR-V Instruction"); |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | void EmitSPIRV::EmitBitwiseAnd32(EmitContext&) { | 52 | void EmitBitwiseAnd32(EmitContext&) { |
| 53 | throw NotImplementedException("SPIR-V Instruction"); | 53 | throw NotImplementedException("SPIR-V Instruction"); |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | void EmitSPIRV::EmitBitwiseOr32(EmitContext&) { | 56 | void EmitBitwiseOr32(EmitContext&) { |
| 57 | throw NotImplementedException("SPIR-V Instruction"); | 57 | throw NotImplementedException("SPIR-V Instruction"); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | void EmitSPIRV::EmitBitwiseXor32(EmitContext&) { | 60 | void EmitBitwiseXor32(EmitContext&) { |
| 61 | throw NotImplementedException("SPIR-V Instruction"); | 61 | throw NotImplementedException("SPIR-V Instruction"); |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | void EmitSPIRV::EmitBitFieldInsert(EmitContext&) { | 64 | void EmitBitFieldInsert(EmitContext&) { |
| 65 | throw NotImplementedException("SPIR-V Instruction"); | 65 | throw NotImplementedException("SPIR-V Instruction"); |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | void EmitSPIRV::EmitBitFieldSExtract(EmitContext&) { | 68 | void EmitBitFieldSExtract(EmitContext&) { |
| 69 | throw NotImplementedException("SPIR-V Instruction"); | 69 | throw NotImplementedException("SPIR-V Instruction"); |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | Id EmitSPIRV::EmitBitFieldUExtract(EmitContext& ctx, Id base, Id offset, Id count) { | 72 | Id EmitBitFieldUExtract(EmitContext& ctx, Id base, Id offset, Id count) { |
| 73 | return ctx.OpBitFieldUExtract(ctx.U32[1], base, offset, count); | 73 | return ctx.OpBitFieldUExtract(ctx.U32[1], base, offset, count); |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | Id EmitSPIRV::EmitSLessThan(EmitContext& ctx, Id lhs, Id rhs) { | 76 | Id EmitSLessThan(EmitContext& ctx, Id lhs, Id rhs) { |
| 77 | return ctx.OpSLessThan(ctx.U1, lhs, rhs); | 77 | return ctx.OpSLessThan(ctx.U1, lhs, rhs); |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | void EmitSPIRV::EmitULessThan(EmitContext&) { | 80 | void EmitULessThan(EmitContext&) { |
| 81 | throw NotImplementedException("SPIR-V Instruction"); | 81 | throw NotImplementedException("SPIR-V Instruction"); |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | void EmitSPIRV::EmitIEqual(EmitContext&) { | 84 | void EmitIEqual(EmitContext&) { |
| 85 | throw NotImplementedException("SPIR-V Instruction"); | 85 | throw NotImplementedException("SPIR-V Instruction"); |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | void EmitSPIRV::EmitSLessThanEqual(EmitContext&) { | 88 | void EmitSLessThanEqual(EmitContext&) { |
| 89 | throw NotImplementedException("SPIR-V Instruction"); | 89 | throw NotImplementedException("SPIR-V Instruction"); |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | void EmitSPIRV::EmitULessThanEqual(EmitContext&) { | 92 | void EmitULessThanEqual(EmitContext&) { |
| 93 | throw NotImplementedException("SPIR-V Instruction"); | 93 | throw NotImplementedException("SPIR-V Instruction"); |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | Id EmitSPIRV::EmitSGreaterThan(EmitContext& ctx, Id lhs, Id rhs) { | 96 | Id EmitSGreaterThan(EmitContext& ctx, Id lhs, Id rhs) { |
| 97 | return ctx.OpSGreaterThan(ctx.U1, lhs, rhs); | 97 | return ctx.OpSGreaterThan(ctx.U1, lhs, rhs); |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | void EmitSPIRV::EmitUGreaterThan(EmitContext&) { | 100 | void EmitUGreaterThan(EmitContext&) { |
| 101 | throw NotImplementedException("SPIR-V Instruction"); | 101 | throw NotImplementedException("SPIR-V Instruction"); |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | void EmitSPIRV::EmitINotEqual(EmitContext&) { | 104 | void EmitINotEqual(EmitContext&) { |
| 105 | throw NotImplementedException("SPIR-V Instruction"); | 105 | throw NotImplementedException("SPIR-V Instruction"); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | void EmitSPIRV::EmitSGreaterThanEqual(EmitContext&) { | 108 | void EmitSGreaterThanEqual(EmitContext&) { |
| 109 | throw NotImplementedException("SPIR-V Instruction"); | 109 | throw NotImplementedException("SPIR-V Instruction"); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | Id EmitSPIRV::EmitUGreaterThanEqual(EmitContext& ctx, Id lhs, Id rhs) { | 112 | Id EmitUGreaterThanEqual(EmitContext& ctx, Id lhs, Id rhs) { |
| 113 | return ctx.OpUGreaterThanEqual(ctx.U1, lhs, rhs); | 113 | return ctx.OpUGreaterThanEqual(ctx.U1, lhs, rhs); |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | void EmitSPIRV::EmitLogicalOr(EmitContext&) { | 116 | void EmitLogicalOr(EmitContext&) { |
| 117 | throw NotImplementedException("SPIR-V Instruction"); | 117 | throw NotImplementedException("SPIR-V Instruction"); |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | void EmitSPIRV::EmitLogicalAnd(EmitContext&) { | 120 | void EmitLogicalAnd(EmitContext&) { |
| 121 | throw NotImplementedException("SPIR-V Instruction"); | 121 | throw NotImplementedException("SPIR-V Instruction"); |
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | void EmitSPIRV::EmitLogicalXor(EmitContext&) { | 124 | void EmitLogicalXor(EmitContext&) { |
| 125 | throw NotImplementedException("SPIR-V Instruction"); | 125 | throw NotImplementedException("SPIR-V Instruction"); |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | void EmitSPIRV::EmitLogicalNot(EmitContext&) { | 128 | void EmitLogicalNot(EmitContext&) { |
| 129 | throw NotImplementedException("SPIR-V Instruction"); | 129 | throw NotImplementedException("SPIR-V Instruction"); |
| 130 | } | 130 | } |
| 131 | 131 | ||
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_logical.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_logical.cpp index 7b43c4ed8..ff2f4fb74 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_logical.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_logical.cpp | |||
| @@ -6,83 +6,83 @@ | |||
| 6 | 6 | ||
| 7 | namespace Shader::Backend::SPIRV { | 7 | namespace Shader::Backend::SPIRV { |
| 8 | 8 | ||
| 9 | void EmitSPIRV::EmitConvertS16F16(EmitContext&) { | 9 | void EmitConvertS16F16(EmitContext&) { |
| 10 | throw NotImplementedException("SPIR-V Instruction"); | 10 | throw NotImplementedException("SPIR-V Instruction"); |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | void EmitSPIRV::EmitConvertS16F32(EmitContext&) { | 13 | void EmitConvertS16F32(EmitContext&) { |
| 14 | throw NotImplementedException("SPIR-V Instruction"); | 14 | throw NotImplementedException("SPIR-V Instruction"); |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | void EmitSPIRV::EmitConvertS16F64(EmitContext&) { | 17 | void EmitConvertS16F64(EmitContext&) { |
| 18 | throw NotImplementedException("SPIR-V Instruction"); | 18 | throw NotImplementedException("SPIR-V Instruction"); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | void EmitSPIRV::EmitConvertS32F16(EmitContext&) { | 21 | void EmitConvertS32F16(EmitContext&) { |
| 22 | throw NotImplementedException("SPIR-V Instruction"); | 22 | throw NotImplementedException("SPIR-V Instruction"); |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | void EmitSPIRV::EmitConvertS32F32(EmitContext&) { | 25 | void EmitConvertS32F32(EmitContext&) { |
| 26 | throw NotImplementedException("SPIR-V Instruction"); | 26 | throw NotImplementedException("SPIR-V Instruction"); |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | void EmitSPIRV::EmitConvertS32F64(EmitContext&) { | 29 | void EmitConvertS32F64(EmitContext&) { |
| 30 | throw NotImplementedException("SPIR-V Instruction"); | 30 | throw NotImplementedException("SPIR-V Instruction"); |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | void EmitSPIRV::EmitConvertS64F16(EmitContext&) { | 33 | void EmitConvertS64F16(EmitContext&) { |
| 34 | throw NotImplementedException("SPIR-V Instruction"); | 34 | throw NotImplementedException("SPIR-V Instruction"); |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | void EmitSPIRV::EmitConvertS64F32(EmitContext&) { | 37 | void EmitConvertS64F32(EmitContext&) { |
| 38 | throw NotImplementedException("SPIR-V Instruction"); | 38 | throw NotImplementedException("SPIR-V Instruction"); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | void EmitSPIRV::EmitConvertS64F64(EmitContext&) { | 41 | void EmitConvertS64F64(EmitContext&) { |
| 42 | throw NotImplementedException("SPIR-V Instruction"); | 42 | throw NotImplementedException("SPIR-V Instruction"); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | void EmitSPIRV::EmitConvertU16F16(EmitContext&) { | 45 | void EmitConvertU16F16(EmitContext&) { |
| 46 | throw NotImplementedException("SPIR-V Instruction"); | 46 | throw NotImplementedException("SPIR-V Instruction"); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | void EmitSPIRV::EmitConvertU16F32(EmitContext&) { | 49 | void EmitConvertU16F32(EmitContext&) { |
| 50 | throw NotImplementedException("SPIR-V Instruction"); | 50 | throw NotImplementedException("SPIR-V Instruction"); |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | void EmitSPIRV::EmitConvertU16F64(EmitContext&) { | 53 | void EmitConvertU16F64(EmitContext&) { |
| 54 | throw NotImplementedException("SPIR-V Instruction"); | 54 | throw NotImplementedException("SPIR-V Instruction"); |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | void EmitSPIRV::EmitConvertU32F16(EmitContext&) { | 57 | void EmitConvertU32F16(EmitContext&) { |
| 58 | throw NotImplementedException("SPIR-V Instruction"); | 58 | throw NotImplementedException("SPIR-V Instruction"); |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | void EmitSPIRV::EmitConvertU32F32(EmitContext&) { | 61 | void EmitConvertU32F32(EmitContext&) { |
| 62 | throw NotImplementedException("SPIR-V Instruction"); | 62 | throw NotImplementedException("SPIR-V Instruction"); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | void EmitSPIRV::EmitConvertU32F64(EmitContext&) { | 65 | void EmitConvertU32F64(EmitContext&) { |
| 66 | throw NotImplementedException("SPIR-V Instruction"); | 66 | throw NotImplementedException("SPIR-V Instruction"); |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | void EmitSPIRV::EmitConvertU64F16(EmitContext&) { | 69 | void EmitConvertU64F16(EmitContext&) { |
| 70 | throw NotImplementedException("SPIR-V Instruction"); | 70 | throw NotImplementedException("SPIR-V Instruction"); |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | void EmitSPIRV::EmitConvertU64F32(EmitContext&) { | 73 | void EmitConvertU64F32(EmitContext&) { |
| 74 | throw NotImplementedException("SPIR-V Instruction"); | 74 | throw NotImplementedException("SPIR-V Instruction"); |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | void EmitSPIRV::EmitConvertU64F64(EmitContext&) { | 77 | void EmitConvertU64F64(EmitContext&) { |
| 78 | throw NotImplementedException("SPIR-V Instruction"); | 78 | throw NotImplementedException("SPIR-V Instruction"); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | void EmitSPIRV::EmitConvertU64U32(EmitContext&) { | 81 | void EmitConvertU64U32(EmitContext&) { |
| 82 | throw NotImplementedException("SPIR-V Instruction"); | 82 | throw NotImplementedException("SPIR-V Instruction"); |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | void EmitSPIRV::EmitConvertU32U64(EmitContext&) { | 85 | void EmitConvertU32U64(EmitContext&) { |
| 86 | throw NotImplementedException("SPIR-V Instruction"); | 86 | throw NotImplementedException("SPIR-V Instruction"); |
| 87 | } | 87 | } |
| 88 | 88 | ||
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_memory.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_memory.cpp index 5769a3c95..77d698ffd 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_memory.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_memory.cpp | |||
| @@ -22,79 +22,79 @@ static Id StorageIndex(EmitContext& ctx, const IR::Value& offset, size_t element | |||
| 22 | return ctx.OpShiftRightLogical(ctx.U32[1], index, shift_id); | 22 | return ctx.OpShiftRightLogical(ctx.U32[1], index, shift_id); |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | void EmitSPIRV::EmitLoadGlobalU8(EmitContext&) { | 25 | void EmitLoadGlobalU8(EmitContext&) { |
| 26 | throw NotImplementedException("SPIR-V Instruction"); | 26 | throw NotImplementedException("SPIR-V Instruction"); |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | void EmitSPIRV::EmitLoadGlobalS8(EmitContext&) { | 29 | void EmitLoadGlobalS8(EmitContext&) { |
| 30 | throw NotImplementedException("SPIR-V Instruction"); | 30 | throw NotImplementedException("SPIR-V Instruction"); |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | void EmitSPIRV::EmitLoadGlobalU16(EmitContext&) { | 33 | void EmitLoadGlobalU16(EmitContext&) { |
| 34 | throw NotImplementedException("SPIR-V Instruction"); | 34 | throw NotImplementedException("SPIR-V Instruction"); |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | void EmitSPIRV::EmitLoadGlobalS16(EmitContext&) { | 37 | void EmitLoadGlobalS16(EmitContext&) { |
| 38 | throw NotImplementedException("SPIR-V Instruction"); | 38 | throw NotImplementedException("SPIR-V Instruction"); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | void EmitSPIRV::EmitLoadGlobal32(EmitContext&) { | 41 | void EmitLoadGlobal32(EmitContext&) { |
| 42 | throw NotImplementedException("SPIR-V Instruction"); | 42 | throw NotImplementedException("SPIR-V Instruction"); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | void EmitSPIRV::EmitLoadGlobal64(EmitContext&) { | 45 | void EmitLoadGlobal64(EmitContext&) { |
| 46 | throw NotImplementedException("SPIR-V Instruction"); | 46 | throw NotImplementedException("SPIR-V Instruction"); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | void EmitSPIRV::EmitLoadGlobal128(EmitContext&) { | 49 | void EmitLoadGlobal128(EmitContext&) { |
| 50 | throw NotImplementedException("SPIR-V Instruction"); | 50 | throw NotImplementedException("SPIR-V Instruction"); |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | void EmitSPIRV::EmitWriteGlobalU8(EmitContext&) { | 53 | void EmitWriteGlobalU8(EmitContext&) { |
| 54 | throw NotImplementedException("SPIR-V Instruction"); | 54 | throw NotImplementedException("SPIR-V Instruction"); |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | void EmitSPIRV::EmitWriteGlobalS8(EmitContext&) { | 57 | void EmitWriteGlobalS8(EmitContext&) { |
| 58 | throw NotImplementedException("SPIR-V Instruction"); | 58 | throw NotImplementedException("SPIR-V Instruction"); |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | void EmitSPIRV::EmitWriteGlobalU16(EmitContext&) { | 61 | void EmitWriteGlobalU16(EmitContext&) { |
| 62 | throw NotImplementedException("SPIR-V Instruction"); | 62 | throw NotImplementedException("SPIR-V Instruction"); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | void EmitSPIRV::EmitWriteGlobalS16(EmitContext&) { | 65 | void EmitWriteGlobalS16(EmitContext&) { |
| 66 | throw NotImplementedException("SPIR-V Instruction"); | 66 | throw NotImplementedException("SPIR-V Instruction"); |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | void EmitSPIRV::EmitWriteGlobal32(EmitContext&) { | 69 | void EmitWriteGlobal32(EmitContext&) { |
| 70 | throw NotImplementedException("SPIR-V Instruction"); | 70 | throw NotImplementedException("SPIR-V Instruction"); |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | void EmitSPIRV::EmitWriteGlobal64(EmitContext&) { | 73 | void EmitWriteGlobal64(EmitContext&) { |
| 74 | throw NotImplementedException("SPIR-V Instruction"); | 74 | throw NotImplementedException("SPIR-V Instruction"); |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | void EmitSPIRV::EmitWriteGlobal128(EmitContext&) { | 77 | void EmitWriteGlobal128(EmitContext&) { |
| 78 | throw NotImplementedException("SPIR-V Instruction"); | 78 | throw NotImplementedException("SPIR-V Instruction"); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | void EmitSPIRV::EmitLoadStorageU8(EmitContext&) { | 81 | void EmitLoadStorageU8(EmitContext&) { |
| 82 | throw NotImplementedException("SPIR-V Instruction"); | 82 | throw NotImplementedException("SPIR-V Instruction"); |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | void EmitSPIRV::EmitLoadStorageS8(EmitContext&) { | 85 | void EmitLoadStorageS8(EmitContext&) { |
| 86 | throw NotImplementedException("SPIR-V Instruction"); | 86 | throw NotImplementedException("SPIR-V Instruction"); |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | void EmitSPIRV::EmitLoadStorageU16(EmitContext&) { | 89 | void EmitLoadStorageU16(EmitContext&) { |
| 90 | throw NotImplementedException("SPIR-V Instruction"); | 90 | throw NotImplementedException("SPIR-V Instruction"); |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | void EmitSPIRV::EmitLoadStorageS16(EmitContext&) { | 93 | void EmitLoadStorageS16(EmitContext&) { |
| 94 | throw NotImplementedException("SPIR-V Instruction"); | 94 | throw NotImplementedException("SPIR-V Instruction"); |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | Id EmitSPIRV::EmitLoadStorage32(EmitContext& ctx, const IR::Value& binding, | 97 | Id EmitLoadStorage32(EmitContext& ctx, const IR::Value& binding, |
| 98 | const IR::Value& offset) { | 98 | const IR::Value& offset) { |
| 99 | if (!binding.IsImmediate()) { | 99 | if (!binding.IsImmediate()) { |
| 100 | throw NotImplementedException("Dynamic storage buffer indexing"); | 100 | throw NotImplementedException("Dynamic storage buffer indexing"); |
| @@ -105,31 +105,31 @@ Id EmitSPIRV::EmitLoadStorage32(EmitContext& ctx, const IR::Value& binding, | |||
| 105 | return ctx.OpLoad(ctx.U32[1], pointer); | 105 | return ctx.OpLoad(ctx.U32[1], pointer); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | void EmitSPIRV::EmitLoadStorage64(EmitContext&) { | 108 | void EmitLoadStorage64(EmitContext&) { |
| 109 | throw NotImplementedException("SPIR-V Instruction"); | 109 | throw NotImplementedException("SPIR-V Instruction"); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | void EmitSPIRV::EmitLoadStorage128(EmitContext&) { | 112 | void EmitLoadStorage128(EmitContext&) { |
| 113 | throw NotImplementedException("SPIR-V Instruction"); | 113 | throw NotImplementedException("SPIR-V Instruction"); |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | void EmitSPIRV::EmitWriteStorageU8(EmitContext&) { | 116 | void EmitWriteStorageU8(EmitContext&) { |
| 117 | throw NotImplementedException("SPIR-V Instruction"); | 117 | throw NotImplementedException("SPIR-V Instruction"); |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | void EmitSPIRV::EmitWriteStorageS8(EmitContext&) { | 120 | void EmitWriteStorageS8(EmitContext&) { |
| 121 | throw NotImplementedException("SPIR-V Instruction"); | 121 | throw NotImplementedException("SPIR-V Instruction"); |
| 122 | } | 122 | } |
| 123 | 123 | ||
| 124 | void EmitSPIRV::EmitWriteStorageU16(EmitContext&) { | 124 | void EmitWriteStorageU16(EmitContext&) { |
| 125 | throw NotImplementedException("SPIR-V Instruction"); | 125 | throw NotImplementedException("SPIR-V Instruction"); |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | void EmitSPIRV::EmitWriteStorageS16(EmitContext&) { | 128 | void EmitWriteStorageS16(EmitContext&) { |
| 129 | throw NotImplementedException("SPIR-V Instruction"); | 129 | throw NotImplementedException("SPIR-V Instruction"); |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | void EmitSPIRV::EmitWriteStorage32(EmitContext& ctx, const IR::Value& binding, | 132 | void EmitWriteStorage32(EmitContext& ctx, const IR::Value& binding, |
| 133 | const IR::Value& offset, Id value) { | 133 | const IR::Value& offset, Id value) { |
| 134 | if (!binding.IsImmediate()) { | 134 | if (!binding.IsImmediate()) { |
| 135 | throw NotImplementedException("Dynamic storage buffer indexing"); | 135 | throw NotImplementedException("Dynamic storage buffer indexing"); |
| @@ -140,11 +140,11 @@ void EmitSPIRV::EmitWriteStorage32(EmitContext& ctx, const IR::Value& binding, | |||
| 140 | ctx.OpStore(pointer, value); | 140 | ctx.OpStore(pointer, value); |
| 141 | } | 141 | } |
| 142 | 142 | ||
| 143 | void EmitSPIRV::EmitWriteStorage64(EmitContext&) { | 143 | void EmitWriteStorage64(EmitContext&) { |
| 144 | throw NotImplementedException("SPIR-V Instruction"); | 144 | throw NotImplementedException("SPIR-V Instruction"); |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | void EmitSPIRV::EmitWriteStorage128(EmitContext&) { | 147 | void EmitWriteStorage128(EmitContext&) { |
| 148 | throw NotImplementedException("SPIR-V Instruction"); | 148 | throw NotImplementedException("SPIR-V Instruction"); |
| 149 | } | 149 | } |
| 150 | 150 | ||
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_select.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_select.cpp index 40a856f72..8d5062724 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_select.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_select.cpp | |||
| @@ -6,19 +6,19 @@ | |||
| 6 | 6 | ||
| 7 | namespace Shader::Backend::SPIRV { | 7 | namespace Shader::Backend::SPIRV { |
| 8 | 8 | ||
| 9 | void EmitSPIRV::EmitSelect8(EmitContext&) { | 9 | void EmitSelect8(EmitContext&) { |
| 10 | throw NotImplementedException("SPIR-V Instruction"); | 10 | throw NotImplementedException("SPIR-V Instruction"); |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | void EmitSPIRV::EmitSelect16(EmitContext&) { | 13 | void EmitSelect16(EmitContext&) { |
| 14 | throw NotImplementedException("SPIR-V Instruction"); | 14 | throw NotImplementedException("SPIR-V Instruction"); |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | void EmitSPIRV::EmitSelect32(EmitContext&) { | 17 | void EmitSelect32(EmitContext&) { |
| 18 | throw NotImplementedException("SPIR-V Instruction"); | 18 | throw NotImplementedException("SPIR-V Instruction"); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | void EmitSPIRV::EmitSelect64(EmitContext&) { | 21 | void EmitSelect64(EmitContext&) { |
| 22 | throw NotImplementedException("SPIR-V Instruction"); | 22 | throw NotImplementedException("SPIR-V Instruction"); |
| 23 | } | 23 | } |
| 24 | 24 | ||
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_undefined.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_undefined.cpp index c1ed8f281..19b06dbe4 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_undefined.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_undefined.cpp | |||
| @@ -6,23 +6,23 @@ | |||
| 6 | 6 | ||
| 7 | namespace Shader::Backend::SPIRV { | 7 | namespace Shader::Backend::SPIRV { |
| 8 | 8 | ||
| 9 | Id EmitSPIRV::EmitUndefU1(EmitContext& ctx) { | 9 | Id EmitUndefU1(EmitContext& ctx) { |
| 10 | return ctx.OpUndef(ctx.U1); | 10 | return ctx.OpUndef(ctx.U1); |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | Id EmitSPIRV::EmitUndefU8(EmitContext&) { | 13 | Id EmitUndefU8(EmitContext&) { |
| 14 | throw NotImplementedException("SPIR-V Instruction"); | 14 | throw NotImplementedException("SPIR-V Instruction"); |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | Id EmitSPIRV::EmitUndefU16(EmitContext&) { | 17 | Id EmitUndefU16(EmitContext&) { |
| 18 | throw NotImplementedException("SPIR-V Instruction"); | 18 | throw NotImplementedException("SPIR-V Instruction"); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | Id EmitSPIRV::EmitUndefU32(EmitContext& ctx) { | 21 | Id EmitUndefU32(EmitContext& ctx) { |
| 22 | return ctx.OpUndef(ctx.U32[1]); | 22 | return ctx.OpUndef(ctx.U32[1]); |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | Id EmitSPIRV::EmitUndefU64(EmitContext&) { | 25 | Id EmitUndefU64(EmitContext&) { |
| 26 | throw NotImplementedException("SPIR-V Instruction"); | 26 | throw NotImplementedException("SPIR-V Instruction"); |
| 27 | } | 27 | } |
| 28 | 28 | ||
diff --git a/src/shader_recompiler/environment.h b/src/shader_recompiler/environment.h index f6230e817..0ba681fb9 100644 --- a/src/shader_recompiler/environment.h +++ b/src/shader_recompiler/environment.h | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | 2 | ||
| 3 | #include <array> | ||
| 4 | |||
| 3 | #include "common/common_types.h" | 5 | #include "common/common_types.h" |
| 4 | 6 | ||
| 5 | namespace Shader { | 7 | namespace Shader { |
| @@ -8,7 +10,9 @@ class Environment { | |||
| 8 | public: | 10 | public: |
| 9 | virtual ~Environment() = default; | 11 | virtual ~Environment() = default; |
| 10 | 12 | ||
| 11 | [[nodiscard]] virtual u64 ReadInstruction(u32 address) const = 0; | 13 | [[nodiscard]] virtual u64 ReadInstruction(u32 address) = 0; |
| 14 | |||
| 15 | [[nodiscard]] virtual std::array<u32, 3> WorkgroupSize() = 0; | ||
| 12 | }; | 16 | }; |
| 13 | 17 | ||
| 14 | } // namespace Shader | 18 | } // namespace Shader |
diff --git a/src/shader_recompiler/file_environment.cpp b/src/shader_recompiler/file_environment.cpp index b34bf462b..5127523f9 100644 --- a/src/shader_recompiler/file_environment.cpp +++ b/src/shader_recompiler/file_environment.cpp | |||
| @@ -29,7 +29,7 @@ FileEnvironment::FileEnvironment(const char* path) { | |||
| 29 | 29 | ||
| 30 | FileEnvironment::~FileEnvironment() = default; | 30 | FileEnvironment::~FileEnvironment() = default; |
| 31 | 31 | ||
| 32 | u64 FileEnvironment::ReadInstruction(u32 offset) const { | 32 | u64 FileEnvironment::ReadInstruction(u32 offset) { |
| 33 | if (offset % 8 != 0) { | 33 | if (offset % 8 != 0) { |
| 34 | throw InvalidArgument("offset={} is not aligned to 8", offset); | 34 | throw InvalidArgument("offset={} is not aligned to 8", offset); |
| 35 | } | 35 | } |
| @@ -39,4 +39,8 @@ u64 FileEnvironment::ReadInstruction(u32 offset) const { | |||
| 39 | return data[offset / 8]; | 39 | return data[offset / 8]; |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | std::array<u32, 3> FileEnvironment::WorkgroupSize() { | ||
| 43 | return {1, 1, 1}; | ||
| 44 | } | ||
| 45 | |||
| 42 | } // namespace Shader | 46 | } // namespace Shader |
diff --git a/src/shader_recompiler/file_environment.h b/src/shader_recompiler/file_environment.h index c294bc6fa..b8c4bbadd 100644 --- a/src/shader_recompiler/file_environment.h +++ b/src/shader_recompiler/file_environment.h | |||
| @@ -12,7 +12,9 @@ public: | |||
| 12 | explicit FileEnvironment(const char* path); | 12 | explicit FileEnvironment(const char* path); |
| 13 | ~FileEnvironment() override; | 13 | ~FileEnvironment() override; |
| 14 | 14 | ||
| 15 | u64 ReadInstruction(u32 offset) const override; | 15 | u64 ReadInstruction(u32 offset) override; |
| 16 | |||
| 17 | std::array<u32, 3> WorkgroupSize() override; | ||
| 16 | 18 | ||
| 17 | private: | 19 | private: |
| 18 | std::vector<u64> data; | 20 | std::vector<u64> data; |
diff --git a/src/shader_recompiler/frontend/ir/basic_block.cpp b/src/shader_recompiler/frontend/ir/basic_block.cpp index 5ae91dd7d..ec029dfd6 100644 --- a/src/shader_recompiler/frontend/ir/basic_block.cpp +++ b/src/shader_recompiler/frontend/ir/basic_block.cpp | |||
| @@ -127,6 +127,8 @@ static std::string ArgToIndex(const std::map<const Block*, size_t>& block_to_ind | |||
| 127 | return fmt::format("#{}", arg.U32()); | 127 | return fmt::format("#{}", arg.U32()); |
| 128 | case Type::U64: | 128 | case Type::U64: |
| 129 | return fmt::format("#{}", arg.U64()); | 129 | return fmt::format("#{}", arg.U64()); |
| 130 | case Type::F32: | ||
| 131 | return fmt::format("#{}", arg.F32()); | ||
| 130 | case Type::Reg: | 132 | case Type::Reg: |
| 131 | return fmt::format("{}", arg.Reg()); | 133 | return fmt::format("{}", arg.Reg()); |
| 132 | case Type::Pred: | 134 | case Type::Pred: |
diff --git a/src/shader_recompiler/frontend/ir/post_order.cpp b/src/shader_recompiler/frontend/ir/post_order.cpp index a48b8dec5..8709a2ea1 100644 --- a/src/shader_recompiler/frontend/ir/post_order.cpp +++ b/src/shader_recompiler/frontend/ir/post_order.cpp | |||
| @@ -28,7 +28,7 @@ BlockList PostOrder(const BlockList& blocks) { | |||
| 28 | if (!visited.insert(branch).second) { | 28 | if (!visited.insert(branch).second) { |
| 29 | return false; | 29 | return false; |
| 30 | } | 30 | } |
| 31 | // Calling push_back twice is faster than insert on msvc | 31 | // Calling push_back twice is faster than insert on MSVC |
| 32 | block_stack.push_back(block); | 32 | block_stack.push_back(block); |
| 33 | block_stack.push_back(branch); | 33 | block_stack.push_back(branch); |
| 34 | return true; | 34 | return true; |
diff --git a/src/shader_recompiler/frontend/maxwell/program.cpp b/src/shader_recompiler/frontend/maxwell/program.cpp index 8331d576c..8c44ebb29 100644 --- a/src/shader_recompiler/frontend/maxwell/program.cpp +++ b/src/shader_recompiler/frontend/maxwell/program.cpp | |||
| @@ -69,7 +69,7 @@ IR::Program TranslateProgram(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::Blo | |||
| 69 | Optimization::VerificationPass(function); | 69 | Optimization::VerificationPass(function); |
| 70 | } | 70 | } |
| 71 | Optimization::CollectShaderInfoPass(program); | 71 | Optimization::CollectShaderInfoPass(program); |
| 72 | //*/ | 72 | fmt::print(stdout, "{}\n", IR::DumpProgram(program)); |
| 73 | return program; | 73 | return program; |
| 74 | } | 74 | } |
| 75 | 75 | ||
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp index 3c9eaddd9..079e3497f 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/impl.cpp | |||
| @@ -24,6 +24,14 @@ void TranslatorVisitor::F(IR::Reg dest_reg, const IR::F32& value) { | |||
| 24 | X(dest_reg, ir.BitCast<IR::U32>(value)); | 24 | X(dest_reg, ir.BitCast<IR::U32>(value)); |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | IR::U32 TranslatorVisitor::GetReg8(u64 insn) { | ||
| 28 | union { | ||
| 29 | u64 raw; | ||
| 30 | BitField<8, 8, IR::Reg> index; | ||
| 31 | } const reg{insn}; | ||
| 32 | return X(reg.index); | ||
| 33 | } | ||
| 34 | |||
| 27 | IR::U32 TranslatorVisitor::GetReg20(u64 insn) { | 35 | IR::U32 TranslatorVisitor::GetReg20(u64 insn) { |
| 28 | union { | 36 | union { |
| 29 | u64 raw; | 37 | u64 raw; |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/impl.h b/src/shader_recompiler/frontend/maxwell/translate/impl/impl.h index b701605d7..8bd468244 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/impl.h +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/impl.h | |||
| @@ -301,6 +301,7 @@ public: | |||
| 301 | void X(IR::Reg dest_reg, const IR::U32& value); | 301 | void X(IR::Reg dest_reg, const IR::U32& value); |
| 302 | void F(IR::Reg dest_reg, const IR::F32& value); | 302 | void F(IR::Reg dest_reg, const IR::F32& value); |
| 303 | 303 | ||
| 304 | [[nodiscard]] IR::U32 GetReg8(u64 insn); | ||
| 304 | [[nodiscard]] IR::U32 GetReg20(u64 insn); | 305 | [[nodiscard]] IR::U32 GetReg20(u64 insn); |
| 305 | [[nodiscard]] IR::U32 GetReg39(u64 insn); | 306 | [[nodiscard]] IR::U32 GetReg39(u64 insn); |
| 306 | [[nodiscard]] IR::F32 GetReg20F(u64 insn); | 307 | [[nodiscard]] IR::F32 GetReg20F(u64 insn); |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/move_register.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/move_register.cpp index 1f83d1068..c3c4b9abd 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/move_register.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/move_register.cpp | |||
| @@ -10,36 +10,35 @@ | |||
| 10 | 10 | ||
| 11 | namespace Shader::Maxwell { | 11 | namespace Shader::Maxwell { |
| 12 | namespace { | 12 | namespace { |
| 13 | union MOV { | 13 | void MOV(TranslatorVisitor& v, u64 insn, const IR::U32& src, bool is_mov32i = false) { |
| 14 | u64 raw; | 14 | union { |
| 15 | BitField<0, 8, IR::Reg> dest_reg; | 15 | u64 raw; |
| 16 | BitField<20, 8, IR::Reg> src_reg; | 16 | BitField<0, 8, IR::Reg> dest_reg; |
| 17 | BitField<39, 4, u64> mask; | 17 | BitField<39, 4, u64> mask; |
| 18 | }; | 18 | BitField<12, 4, u64> mov32i_mask; |
| 19 | 19 | } const mov{insn}; | |
| 20 | void CheckMask(MOV mov) { | 20 | |
| 21 | if (mov.mask != 0xf) { | 21 | if ((is_mov32i ? mov.mov32i_mask : mov.mask) != 0xf) { |
| 22 | throw NotImplementedException("Non-full move mask"); | 22 | throw NotImplementedException("Non-full move mask"); |
| 23 | } | 23 | } |
| 24 | v.X(mov.dest_reg, src); | ||
| 24 | } | 25 | } |
| 25 | } // Anonymous namespace | 26 | } // Anonymous namespace |
| 26 | 27 | ||
| 27 | void TranslatorVisitor::MOV_reg(u64 insn) { | 28 | void TranslatorVisitor::MOV_reg(u64 insn) { |
| 28 | const MOV mov{insn}; | 29 | MOV(*this, insn, GetReg8(insn)); |
| 29 | CheckMask(mov); | ||
| 30 | X(mov.dest_reg, X(mov.src_reg)); | ||
| 31 | } | 30 | } |
| 32 | 31 | ||
| 33 | void TranslatorVisitor::MOV_cbuf(u64 insn) { | 32 | void TranslatorVisitor::MOV_cbuf(u64 insn) { |
| 34 | const MOV mov{insn}; | 33 | MOV(*this, insn, GetCbuf(insn)); |
| 35 | CheckMask(mov); | ||
| 36 | X(mov.dest_reg, GetCbuf(insn)); | ||
| 37 | } | 34 | } |
| 38 | 35 | ||
| 39 | void TranslatorVisitor::MOV_imm(u64 insn) { | 36 | void TranslatorVisitor::MOV_imm(u64 insn) { |
| 40 | const MOV mov{insn}; | 37 | MOV(*this, insn, GetImm20(insn)); |
| 41 | CheckMask(mov); | 38 | } |
| 42 | X(mov.dest_reg, GetImm20(insn)); | 39 | |
| 40 | void TranslatorVisitor::MOV32I(u64 insn) { | ||
| 41 | MOV(*this, insn, GetImm32(insn), true); | ||
| 43 | } | 42 | } |
| 44 | 43 | ||
| 45 | } // namespace Shader::Maxwell | 44 | } // namespace Shader::Maxwell |
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/not_implemented.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/not_implemented.cpp index 1bb160acb..6b2a1356b 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/not_implemented.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/not_implemented.cpp | |||
| @@ -617,10 +617,6 @@ void TranslatorVisitor::MEMBAR(u64) { | |||
| 617 | ThrowNotImplemented(Opcode::MEMBAR); | 617 | ThrowNotImplemented(Opcode::MEMBAR); |
| 618 | } | 618 | } |
| 619 | 619 | ||
| 620 | void TranslatorVisitor::MOV32I(u64) { | ||
| 621 | ThrowNotImplemented(Opcode::MOV32I); | ||
| 622 | } | ||
| 623 | |||
| 624 | void TranslatorVisitor::NOP(u64) { | 620 | void TranslatorVisitor::NOP(u64) { |
| 625 | ThrowNotImplemented(Opcode::NOP); | 621 | ThrowNotImplemented(Opcode::NOP); |
| 626 | } | 622 | } |
diff --git a/src/shader_recompiler/main.cpp b/src/shader_recompiler/main.cpp index 1610bb34e..050a37f18 100644 --- a/src/shader_recompiler/main.cpp +++ b/src/shader_recompiler/main.cpp | |||
| @@ -76,5 +76,5 @@ int main() { | |||
| 76 | fmt::print(stdout, "{}\n", cfg.Dot()); | 76 | fmt::print(stdout, "{}\n", cfg.Dot()); |
| 77 | IR::Program program{TranslateProgram(inst_pool, block_pool, env, cfg)}; | 77 | IR::Program program{TranslateProgram(inst_pool, block_pool, env, cfg)}; |
| 78 | fmt::print(stdout, "{}\n", IR::DumpProgram(program)); | 78 | fmt::print(stdout, "{}\n", IR::DumpProgram(program)); |
| 79 | Backend::SPIRV::EmitSPIRV spirv{program}; | 79 | void(Backend::SPIRV::EmitSPIRV(env, program)); |
| 80 | } | 80 | } |
diff --git a/src/shader_recompiler/profile.h b/src/shader_recompiler/profile.h new file mode 100644 index 000000000..c96d783b7 --- /dev/null +++ b/src/shader_recompiler/profile.h | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | namespace Shader { | ||
| 8 | |||
| 9 | struct Profile { | ||
| 10 | bool unified_descriptor_binding; | ||
| 11 | }; | ||
| 12 | |||
| 13 | } // namespace Shader | ||
diff --git a/src/shader_recompiler/recompiler.cpp b/src/shader_recompiler/recompiler.cpp new file mode 100644 index 000000000..b25081e39 --- /dev/null +++ b/src/shader_recompiler/recompiler.cpp | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include <vector> | ||
| 6 | |||
| 7 | #include "common/common_types.h" | ||
| 8 | #include "shader_recompiler/backend/spirv/emit_spirv.h" | ||
| 9 | #include "shader_recompiler/environment.h" | ||
| 10 | #include "shader_recompiler/frontend/maxwell/control_flow.h" | ||
| 11 | #include "shader_recompiler/frontend/maxwell/program.h" | ||
| 12 | #include "shader_recompiler/object_pool.h" | ||
| 13 | #include "shader_recompiler/recompiler.h" | ||
| 14 | |||
| 15 | namespace Shader { | ||
| 16 | |||
| 17 | std::pair<Info, std::vector<u32>> RecompileSPIRV(Environment& env, u32 start_address) { | ||
| 18 | ObjectPool<Maxwell::Flow::Block> flow_block_pool; | ||
| 19 | ObjectPool<IR::Inst> inst_pool; | ||
| 20 | ObjectPool<IR::Block> block_pool; | ||
| 21 | |||
| 22 | Maxwell::Flow::CFG cfg{env, flow_block_pool, start_address}; | ||
| 23 | IR::Program program{Maxwell::TranslateProgram(inst_pool, block_pool, env, cfg)}; | ||
| 24 | return {std::move(program.info), Backend::SPIRV::EmitSPIRV(env, program)}; | ||
| 25 | } | ||
| 26 | |||
| 27 | } // namespace Shader | ||
diff --git a/src/shader_recompiler/recompiler.h b/src/shader_recompiler/recompiler.h new file mode 100644 index 000000000..4cb973878 --- /dev/null +++ b/src/shader_recompiler/recompiler.h | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | // Copyright 2021 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <utility> | ||
| 8 | #include <vector> | ||
| 9 | |||
| 10 | #include "common/common_types.h" | ||
| 11 | #include "shader_recompiler/environment.h" | ||
| 12 | #include "shader_recompiler/shader_info.h" | ||
| 13 | |||
| 14 | namespace Shader { | ||
| 15 | |||
| 16 | [[nodiscard]] std::pair<Info, std::vector<u32>> RecompileSPIRV(Environment& env, u32 start_address); | ||
| 17 | |||
| 18 | } // namespace Shader | ||