summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-04-15 21:03:49 +0200
committerGitHub <noreply@github.com>2020-04-15 21:03:49 +0200
commite33196d4e7687dd29636decd4b52e01b10fe8984 (patch)
treeb20b84dc47b9ef48c8701951ead117f52252e6e5 /src/video_core/renderer_opengl/gl_shader_decompiler.cpp
parentMerge pull request #3670 from lioncash/reorder (diff)
parentshader/memory: Implement RED.E.ADD (diff)
downloadyuzu-e33196d4e7687dd29636decd4b52e01b10fe8984.tar
yuzu-e33196d4e7687dd29636decd4b52e01b10fe8984.tar.gz
yuzu-e33196d4e7687dd29636decd4b52e01b10fe8984.tar.bz2
yuzu-e33196d4e7687dd29636decd4b52e01b10fe8984.tar.lz
yuzu-e33196d4e7687dd29636decd4b52e01b10fe8984.tar.xz
yuzu-e33196d4e7687dd29636decd4b52e01b10fe8984.tar.zst
yuzu-e33196d4e7687dd29636decd4b52e01b10fe8984.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp24
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 59bbd1211..b1804e9ea 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,