diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-04-06 07:24:47 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-04-06 07:24:47 +0200 |
commit | 3185245845f7487c3b832035b0c19fdc4f1a8262 (patch) | |
tree | c002fb721c5db8fc5f035bbf218e423b8d982f85 /src/video_core/renderer_opengl | |
parent | shader/memory: Add "using std::move" (diff) | |
download | yuzu-3185245845f7487c3b832035b0c19fdc4f1a8262.tar yuzu-3185245845f7487c3b832035b0c19fdc4f1a8262.tar.gz yuzu-3185245845f7487c3b832035b0c19fdc4f1a8262.tar.bz2 yuzu-3185245845f7487c3b832035b0c19fdc4f1a8262.tar.lz yuzu-3185245845f7487c3b832035b0c19fdc4f1a8262.tar.xz yuzu-3185245845f7487c3b832035b0c19fdc4f1a8262.tar.zst yuzu-3185245845f7487c3b832035b0c19fdc4f1a8262.zip |
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index c7d24cf14..a25280a47 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -2119,8 +2119,14 @@ private: return {}; } return {fmt::format("atomic{}({}, {})", opname, Visit(operation[0]).GetCode(), - Visit(operation[1]).As(type)), - type}; + Visit(operation[1]).AsUint()), + Type::Uint}; + } + + template <const std::string_view& opname, Type type> + Expression Reduce(Operation operation) { + code.AddLine("{};", Atomic<opname, type>(operation).GetCode()); + return {}; } Expression Branch(Operation operation) { @@ -2479,6 +2485,20 @@ private: &GLSLDecompiler::Atomic<Func::Or, Type::Int>, &GLSLDecompiler::Atomic<Func::Xor, Type::Int>, + &GLSLDecompiler::Reduce<Func::Add, Type::Uint>, + &GLSLDecompiler::Reduce<Func::Min, Type::Uint>, + &GLSLDecompiler::Reduce<Func::Max, Type::Uint>, + &GLSLDecompiler::Reduce<Func::And, Type::Uint>, + &GLSLDecompiler::Reduce<Func::Or, Type::Uint>, + &GLSLDecompiler::Reduce<Func::Xor, Type::Uint>, + + &GLSLDecompiler::Reduce<Func::Add, Type::Int>, + &GLSLDecompiler::Reduce<Func::Min, Type::Int>, + &GLSLDecompiler::Reduce<Func::Max, Type::Int>, + &GLSLDecompiler::Reduce<Func::And, Type::Int>, + &GLSLDecompiler::Reduce<Func::Or, Type::Int>, + &GLSLDecompiler::Reduce<Func::Xor, Type::Int>, + &GLSLDecompiler::Branch, &GLSLDecompiler::BranchIndirect, &GLSLDecompiler::PushFlowStack, |