diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-05-11 00:32:10 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:31 +0200 |
commit | 8c81a20ace8c65d0a9d58b9cf333049a2bc0383a (patch) | |
tree | 86c653e99c02225f7ed5ee93b42d272b11404a93 /src/shader_recompiler/backend | |
parent | glasm: Enable unintentionally disabled register aliasing on GLASM (diff) | |
download | yuzu-8c81a20ace8c65d0a9d58b9cf333049a2bc0383a.tar yuzu-8c81a20ace8c65d0a9d58b9cf333049a2bc0383a.tar.gz yuzu-8c81a20ace8c65d0a9d58b9cf333049a2bc0383a.tar.bz2 yuzu-8c81a20ace8c65d0a9d58b9cf333049a2bc0383a.tar.lz yuzu-8c81a20ace8c65d0a9d58b9cf333049a2bc0383a.tar.xz yuzu-8c81a20ace8c65d0a9d58b9cf333049a2bc0383a.tar.zst yuzu-8c81a20ace8c65d0a9d58b9cf333049a2bc0383a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm.cpp b/src/shader_recompiler/backend/glasm/emit_glasm.cpp index c90b80e48..047b2f89c 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm.cpp @@ -128,24 +128,27 @@ auto Arg(EmitContext& ctx, const IR::Value& arg) { } } -template <auto func, bool is_first_arg_inst, typename... Args> -void InvokeCall(EmitContext& ctx, IR::Inst* inst, Args&&... args) { - if constexpr (is_first_arg_inst) { - func(ctx, *inst, args.Extract()...); - } else { - func(ctx, args.Extract()...); +template <auto func, bool is_first_arg_inst> +struct InvokeCall { + template <typename... Args> + InvokeCall(EmitContext& ctx, IR::Inst* inst, Args&&... args) { + if constexpr (is_first_arg_inst) { + func(ctx, *inst, args.Extract()...); + } else { + func(ctx, args.Extract()...); + } } -} +}; template <auto func, bool is_first_arg_inst, size_t... I> void Invoke(EmitContext& ctx, IR::Inst* inst, std::index_sequence<I...>) { using Traits = FuncTraits<decltype(func)>; if constexpr (is_first_arg_inst) { - InvokeCall<func, is_first_arg_inst>( - ctx, inst, Arg<typename Traits::template ArgType<I + 2>>(ctx, inst->Arg(I))...); + InvokeCall<func, is_first_arg_inst>{ + ctx, inst, Arg<typename Traits::template ArgType<I + 2>>(ctx, inst->Arg(I))...}; } else { - InvokeCall<func, is_first_arg_inst>( - ctx, inst, Arg<typename Traits::template ArgType<I + 1>>(ctx, inst->Arg(I))...); + InvokeCall<func, is_first_arg_inst>{ + ctx, inst, Arg<typename Traits::template ArgType<I + 1>>(ctx, inst->Arg(I))...}; } } |