diff options
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/shader/decode/memory.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/video_core/shader/decode/memory.cpp b/src/video_core/shader/decode/memory.cpp index 20a953379..1a93540fe 100644 --- a/src/video_core/shader/decode/memory.cpp +++ b/src/video_core/shader/decode/memory.cpp | |||
| @@ -3,7 +3,9 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | 5 | #include <algorithm> |
| 6 | #include <utility> | ||
| 6 | #include <vector> | 7 | #include <vector> |
| 8 | |||
| 7 | #include <fmt/format.h> | 9 | #include <fmt/format.h> |
| 8 | 10 | ||
| 9 | #include "common/alignment.h" | 11 | #include "common/alignment.h" |
| @@ -16,6 +18,7 @@ | |||
| 16 | 18 | ||
| 17 | namespace VideoCommon::Shader { | 19 | namespace VideoCommon::Shader { |
| 18 | 20 | ||
| 21 | using std::move; | ||
| 19 | using Tegra::Shader::AtomicOp; | 22 | using Tegra::Shader::AtomicOp; |
| 20 | using Tegra::Shader::AtomicType; | 23 | using Tegra::Shader::AtomicType; |
| 21 | using Tegra::Shader::Attribute; | 24 | using Tegra::Shader::Attribute; |
| @@ -87,23 +90,22 @@ u32 GetMemorySize(Tegra::Shader::UniformType uniform_type) { | |||
| 87 | 90 | ||
| 88 | Node ExtractUnaligned(Node value, Node address, u32 mask, u32 size) { | 91 | Node ExtractUnaligned(Node value, Node address, u32 mask, u32 size) { |
| 89 | Node offset = Operation(OperationCode::UBitwiseAnd, address, Immediate(mask)); | 92 | Node offset = Operation(OperationCode::UBitwiseAnd, address, Immediate(mask)); |
| 90 | offset = Operation(OperationCode::ULogicalShiftLeft, std::move(offset), Immediate(3)); | 93 | offset = Operation(OperationCode::ULogicalShiftLeft, move(offset), Immediate(3)); |
| 91 | return Operation(OperationCode::UBitfieldExtract, std::move(value), std::move(offset), | 94 | return Operation(OperationCode::UBitfieldExtract, move(value), move(offset), Immediate(size)); |
| 92 | Immediate(size)); | ||
| 93 | } | 95 | } |
| 94 | 96 | ||
| 95 | Node InsertUnaligned(Node dest, Node value, Node address, u32 mask, u32 size) { | 97 | Node InsertUnaligned(Node dest, Node value, Node address, u32 mask, u32 size) { |
| 96 | Node offset = Operation(OperationCode::UBitwiseAnd, std::move(address), Immediate(mask)); | 98 | Node offset = Operation(OperationCode::UBitwiseAnd, move(address), Immediate(mask)); |
| 97 | offset = Operation(OperationCode::ULogicalShiftLeft, std::move(offset), Immediate(3)); | 99 | offset = Operation(OperationCode::ULogicalShiftLeft, move(offset), Immediate(3)); |
| 98 | return Operation(OperationCode::UBitfieldInsert, std::move(dest), std::move(value), | 100 | return Operation(OperationCode::UBitfieldInsert, move(dest), move(value), move(offset), |
| 99 | std::move(offset), Immediate(size)); | 101 | Immediate(size)); |
| 100 | } | 102 | } |
| 101 | 103 | ||
| 102 | Node Sign16Extend(Node value) { | 104 | Node Sign16Extend(Node value) { |
| 103 | Node sign = Operation(OperationCode::UBitwiseAnd, value, Immediate(1U << 15)); | 105 | Node sign = Operation(OperationCode::UBitwiseAnd, value, Immediate(1U << 15)); |
| 104 | Node is_sign = Operation(OperationCode::LogicalUEqual, std::move(sign), Immediate(1U << 15)); | 106 | Node is_sign = Operation(OperationCode::LogicalUEqual, move(sign), Immediate(1U << 15)); |
| 105 | Node extend = Operation(OperationCode::Select, is_sign, Immediate(0xFFFF0000), Immediate(0)); | 107 | Node extend = Operation(OperationCode::Select, is_sign, Immediate(0xFFFF0000), Immediate(0)); |
| 106 | return Operation(OperationCode::UBitwiseOr, std::move(value), std::move(extend)); | 108 | return Operation(OperationCode::UBitwiseOr, move(value), move(extend)); |
| 107 | } | 109 | } |
| 108 | 110 | ||
| 109 | } // Anonymous namespace | 111 | } // Anonymous namespace |
| @@ -420,10 +422,10 @@ u32 ShaderIR::DecodeMemory(NodeBlock& bb, u32 pc) { | |||
| 420 | instr.atoms.type == AtomicType::S32 || instr.atoms.type == AtomicType::S64; | 422 | instr.atoms.type == AtomicType::S32 || instr.atoms.type == AtomicType::S64; |
| 421 | const s32 offset = instr.atoms.GetImmediateOffset(); | 423 | const s32 offset = instr.atoms.GetImmediateOffset(); |
| 422 | Node address = GetRegister(instr.gpr8); | 424 | Node address = GetRegister(instr.gpr8); |
| 423 | address = Operation(OperationCode::IAdd, std::move(address), Immediate(offset)); | 425 | address = Operation(OperationCode::IAdd, move(address), Immediate(offset)); |
| 424 | SetRegister(bb, instr.gpr0, | 426 | SetRegister(bb, instr.gpr0, |
| 425 | SignedOperation(GetAtomOperation(instr.atoms.operation), is_signed, | 427 | SignedOperation(GetAtomOperation(instr.atoms.operation), is_signed, |
| 426 | GetSharedMemory(std::move(address)), GetRegister(instr.gpr20))); | 428 | GetSharedMemory(move(address)), GetRegister(instr.gpr20))); |
| 427 | break; | 429 | break; |
| 428 | } | 430 | } |
| 429 | case OpCode::Id::AL2P: { | 431 | case OpCode::Id::AL2P: { |