diff options
| author | 2021-04-05 22:25:22 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:26 -0400 | |
| commit | 0bb85f6a753c769266c95c4ba146b25b9eaaaffd (patch) | |
| tree | e5d818ae7dc1d0025bb115c7a63235d866e53286 /src/shader_recompiler/backend/spirv/emit_spirv.cpp | |
| parent | shader: Fix FCMP immediate variant (diff) | |
| download | yuzu-0bb85f6a753c769266c95c4ba146b25b9eaaaffd.tar.gz yuzu-0bb85f6a753c769266c95c4ba146b25b9eaaaffd.tar.xz yuzu-0bb85f6a753c769266c95c4ba146b25b9eaaaffd.zip | |
shader_recompiler,video_core: Cleanup some GCC and Clang errors
Mostly fixing unused *, implicit conversion, braced scalar init,
fpermissive, and some others.
Some Clang errors likely remain in video_core, and std::ranges is still
a pertinent issue in shader_recompiler
shader_recompiler: cmake: Force bracket depth to 1024 on Clang
Increases the maximum fold expression depth
thread_worker: Include condition_variable
Don't use list initializers in control flow
Co-authored-by: ReinUsesLisp <reinuseslisp@airmail.cc>
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_spirv.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp index 32512a0e5..355cf0ca8 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp | |||
| @@ -16,7 +16,7 @@ | |||
| 16 | namespace Shader::Backend::SPIRV { | 16 | namespace Shader::Backend::SPIRV { |
| 17 | namespace { | 17 | namespace { |
| 18 | template <class Func> | 18 | template <class Func> |
| 19 | struct FuncTraits : FuncTraits<Func> {}; | 19 | struct FuncTraits {}; |
| 20 | 20 | ||
| 21 | template <class ReturnType_, class... Args> | 21 | template <class ReturnType_, class... Args> |
| 22 | struct FuncTraits<ReturnType_ (*)(Args...)> { | 22 | struct FuncTraits<ReturnType_ (*)(Args...)> { |
| @@ -64,17 +64,20 @@ ArgType Arg(EmitContext& ctx, const IR::Value& arg) { | |||
| 64 | template <auto func, bool is_first_arg_inst, size_t... I> | 64 | template <auto func, bool is_first_arg_inst, size_t... I> |
| 65 | void Invoke(EmitContext& ctx, IR::Inst* inst, std::index_sequence<I...>) { | 65 | void Invoke(EmitContext& ctx, IR::Inst* inst, std::index_sequence<I...>) { |
| 66 | using Traits = FuncTraits<decltype(func)>; | 66 | using Traits = FuncTraits<decltype(func)>; |
| 67 | if constexpr (std::is_same_v<Traits::ReturnType, Id>) { | 67 | if constexpr (std::is_same_v<typename Traits::ReturnType, Id>) { |
| 68 | if constexpr (is_first_arg_inst) { | 68 | if constexpr (is_first_arg_inst) { |
| 69 | SetDefinition<func>(ctx, inst, inst, Arg<Traits::ArgType<I + 2>>(ctx, inst->Arg(I))...); | 69 | SetDefinition<func>( |
| 70 | ctx, inst, inst, | ||
| 71 | Arg<typename Traits::template ArgType<I + 2>>(ctx, inst->Arg(I))...); | ||
| 70 | } else { | 72 | } else { |
| 71 | SetDefinition<func>(ctx, inst, Arg<Traits::ArgType<I + 1>>(ctx, inst->Arg(I))...); | 73 | SetDefinition<func>( |
| 74 | ctx, inst, Arg<typename Traits::template ArgType<I + 1>>(ctx, inst->Arg(I))...); | ||
| 72 | } | 75 | } |
| 73 | } else { | 76 | } else { |
| 74 | if constexpr (is_first_arg_inst) { | 77 | if constexpr (is_first_arg_inst) { |
| 75 | func(ctx, inst, Arg<Traits::ArgType<I + 2>>(ctx, inst->Arg(I))...); | 78 | func(ctx, inst, Arg<typename Traits::template ArgType<I + 2>>(ctx, inst->Arg(I))...); |
| 76 | } else { | 79 | } else { |
| 77 | func(ctx, Arg<Traits::ArgType<I + 1>>(ctx, inst->Arg(I))...); | 80 | func(ctx, Arg<typename Traits::template ArgType<I + 1>>(ctx, inst->Arg(I))...); |
| 78 | } | 81 | } |
| 79 | } | 82 | } |
| 80 | } | 83 | } |
| @@ -94,14 +97,14 @@ void Invoke(EmitContext& ctx, IR::Inst* inst) { | |||
| 94 | } | 97 | } |
| 95 | 98 | ||
| 96 | void EmitInst(EmitContext& ctx, IR::Inst* inst) { | 99 | void EmitInst(EmitContext& ctx, IR::Inst* inst) { |
| 97 | switch (inst->Opcode()) { | 100 | switch (inst->GetOpcode()) { |
| 98 | #define OPCODE(name, result_type, ...) \ | 101 | #define OPCODE(name, result_type, ...) \ |
| 99 | case IR::Opcode::name: \ | 102 | case IR::Opcode::name: \ |
| 100 | return Invoke<&Emit##name>(ctx, inst); | 103 | return Invoke<&Emit##name>(ctx, inst); |
| 101 | #include "shader_recompiler/frontend/ir/opcodes.inc" | 104 | #include "shader_recompiler/frontend/ir/opcodes.inc" |
| 102 | #undef OPCODE | 105 | #undef OPCODE |
| 103 | } | 106 | } |
| 104 | throw LogicError("Invalid opcode {}", inst->Opcode()); | 107 | throw LogicError("Invalid opcode {}", inst->GetOpcode()); |
| 105 | } | 108 | } |
| 106 | 109 | ||
| 107 | Id TypeId(const EmitContext& ctx, IR::Type type) { | 110 | Id TypeId(const EmitContext& ctx, IR::Type type) { |