summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-01-18 06:54:07 +0100
committerGitHub <noreply@github.com>2020-01-18 06:54:07 +0100
commit15163edaaa6a452e970de6c2577f9d51aa76bea1 (patch)
tree80b21abaee7d30f3bfd33a2eacb0a090d3bec8d6 /src/video_core/renderer_opengl
parentMerge pull request #3318 from jroweboy/remove-cpu-vendor (diff)
parentshader/memory: Implement ATOMS.ADD.U32 (diff)
downloadyuzu-15163edaaa6a452e970de6c2577f9d51aa76bea1.tar
yuzu-15163edaaa6a452e970de6c2577f9d51aa76bea1.tar.gz
yuzu-15163edaaa6a452e970de6c2577f9d51aa76bea1.tar.bz2
yuzu-15163edaaa6a452e970de6c2577f9d51aa76bea1.tar.lz
yuzu-15163edaaa6a452e970de6c2577f9d51aa76bea1.tar.xz
yuzu-15163edaaa6a452e970de6c2577f9d51aa76bea1.tar.zst
yuzu-15163edaaa6a452e970de6c2577f9d51aa76bea1.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index f9f7a97b5..19751939a 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -1856,6 +1856,16 @@ private:
Type::Uint};
}
+ template <const std::string_view& opname, Type type>
+ Expression Atomic(Operation operation) {
+ ASSERT(stage == ShaderType::Compute);
+ auto& smem = std::get<SmemNode>(*operation[0]);
+
+ return {fmt::format("atomic{}(smem[{} >> 2], {})", opname, Visit(smem.GetAddress()).AsInt(),
+ Visit(operation[1]).As(type)),
+ type};
+ }
+
Expression Branch(Operation operation) {
const auto target = std::get_if<ImmediateNode>(&*operation[0]);
UNIMPLEMENTED_IF(!target);
@@ -2194,6 +2204,8 @@ private:
&GLSLDecompiler::AtomicImage<Func::Xor>,
&GLSLDecompiler::AtomicImage<Func::Exchange>,
+ &GLSLDecompiler::Atomic<Func::Add, Type::Uint>,
+
&GLSLDecompiler::Branch,
&GLSLDecompiler::BranchIndirect,
&GLSLDecompiler::PushFlowStack,