diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-01-16 08:00:52 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-01-16 21:30:55 +0100 |
commit | 63ba41a26d6bfdd30a4d7cd0879003fb4000332b (patch) | |
tree | 03ab5eb4426af574feeba06adde3842a8e2d92d5 /src/video_core/shader/decode/memory.cpp | |
parent | Merge pull request #3308 from lioncash/private (diff) | |
download | yuzu-63ba41a26d6bfdd30a4d7cd0879003fb4000332b.tar yuzu-63ba41a26d6bfdd30a4d7cd0879003fb4000332b.tar.gz yuzu-63ba41a26d6bfdd30a4d7cd0879003fb4000332b.tar.bz2 yuzu-63ba41a26d6bfdd30a4d7cd0879003fb4000332b.tar.lz yuzu-63ba41a26d6bfdd30a4d7cd0879003fb4000332b.tar.xz yuzu-63ba41a26d6bfdd30a4d7cd0879003fb4000332b.tar.zst yuzu-63ba41a26d6bfdd30a4d7cd0879003fb4000332b.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/shader/decode/memory.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/video_core/shader/decode/memory.cpp b/src/video_core/shader/decode/memory.cpp index 8cc84e935..7591a715f 100644 --- a/src/video_core/shader/decode/memory.cpp +++ b/src/video_core/shader/decode/memory.cpp @@ -16,6 +16,8 @@ namespace VideoCommon::Shader { +using Tegra::Shader::AtomicOp; +using Tegra::Shader::AtomicType; using Tegra::Shader::Attribute; using Tegra::Shader::Instruction; using Tegra::Shader::OpCode; @@ -333,6 +335,23 @@ u32 ShaderIR::DecodeMemory(NodeBlock& bb, u32 pc) { } break; } + case OpCode::Id::ATOMS: { + UNIMPLEMENTED_IF_MSG(instr.atoms.operation != AtomicOp::Add, "operation={}", + static_cast<int>(instr.atoms.operation.Value())); + UNIMPLEMENTED_IF_MSG(instr.atoms.type != AtomicType::U32, "type={}", + static_cast<int>(instr.atoms.type.Value())); + + const s32 offset = instr.atoms.GetImmediateOffset(); + Node address = GetRegister(instr.gpr8); + address = Operation(OperationCode::IAdd, std::move(address), Immediate(offset)); + + Node memory = GetSharedMemory(std::move(address)); + Node data = GetRegister(instr.gpr20); + + Node value = Operation(OperationCode::UAtomicAdd, std::move(memory), std::move(data)); + SetRegister(bb, instr.gpr0, std::move(value)); + break; + } case OpCode::Id::AL2P: { // Ignore al2p.direction since we don't care about it. |