diff options
| author | 2020-01-16 04:00:52 -0300 | |
|---|---|---|
| committer | 2020-01-16 17:30:55 -0300 | |
| commit | 63ba41a26d6bfdd30a4d7cd0879003fb4000332b (patch) | |
| tree | 03ab5eb4426af574feeba06adde3842a8e2d92d5 /src/video_core/shader/decode | |
| parent | Merge pull request #3308 from lioncash/private (diff) | |
| download | yuzu-63ba41a26d6bfdd30a4d7cd0879003fb4000332b.tar.gz yuzu-63ba41a26d6bfdd30a4d7cd0879003fb4000332b.tar.xz yuzu-63ba41a26d6bfdd30a4d7cd0879003fb4000332b.zip | |
shader/memory: Implement ATOMS.ADD.U32
Diffstat (limited to 'src/video_core/shader/decode')
| -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 @@ | |||
| 16 | 16 | ||
| 17 | namespace VideoCommon::Shader { | 17 | namespace VideoCommon::Shader { |
| 18 | 18 | ||
| 19 | using Tegra::Shader::AtomicOp; | ||
| 20 | using Tegra::Shader::AtomicType; | ||
| 19 | using Tegra::Shader::Attribute; | 21 | using Tegra::Shader::Attribute; |
| 20 | using Tegra::Shader::Instruction; | 22 | using Tegra::Shader::Instruction; |
| 21 | using Tegra::Shader::OpCode; | 23 | using Tegra::Shader::OpCode; |
| @@ -333,6 +335,23 @@ u32 ShaderIR::DecodeMemory(NodeBlock& bb, u32 pc) { | |||
| 333 | } | 335 | } |
| 334 | break; | 336 | break; |
| 335 | } | 337 | } |
| 338 | case OpCode::Id::ATOMS: { | ||
| 339 | UNIMPLEMENTED_IF_MSG(instr.atoms.operation != AtomicOp::Add, "operation={}", | ||
| 340 | static_cast<int>(instr.atoms.operation.Value())); | ||
| 341 | UNIMPLEMENTED_IF_MSG(instr.atoms.type != AtomicType::U32, "type={}", | ||
| 342 | static_cast<int>(instr.atoms.type.Value())); | ||
| 343 | |||
| 344 | const s32 offset = instr.atoms.GetImmediateOffset(); | ||
| 345 | Node address = GetRegister(instr.gpr8); | ||
| 346 | address = Operation(OperationCode::IAdd, std::move(address), Immediate(offset)); | ||
| 347 | |||
| 348 | Node memory = GetSharedMemory(std::move(address)); | ||
| 349 | Node data = GetRegister(instr.gpr20); | ||
| 350 | |||
| 351 | Node value = Operation(OperationCode::UAtomicAdd, std::move(memory), std::move(data)); | ||
| 352 | SetRegister(bb, instr.gpr0, std::move(value)); | ||
| 353 | break; | ||
| 354 | } | ||
| 336 | case OpCode::Id::AL2P: { | 355 | case OpCode::Id::AL2P: { |
| 337 | // Ignore al2p.direction since we don't care about it. | 356 | // Ignore al2p.direction since we don't care about it. |
| 338 | 357 | ||