diff options
| author | 2020-01-24 10:44:34 -0400 | |
|---|---|---|
| committer | 2020-01-25 09:04:59 -0400 | |
| commit | bb8eb15d392d69693f8cda0427669d011e23db97 (patch) | |
| tree | cebd080530de75e7b5400f46c25c307a80e3c222 /src/video_core/shader/track.cpp | |
| parent | Shader_IR: Change name of TrackSampler function so it does not confuse with t... (diff) | |
| download | yuzu-bb8eb15d392d69693f8cda0427669d011e23db97.tar.gz yuzu-bb8eb15d392d69693f8cda0427669d011e23db97.tar.xz yuzu-bb8eb15d392d69693f8cda0427669d011e23db97.zip | |
Shader_IR: Address feedback.
Diffstat (limited to 'src/video_core/shader/track.cpp')
| -rw-r--r-- | src/video_core/shader/track.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/video_core/shader/track.cpp b/src/video_core/shader/track.cpp index 4db721f69..ea39bca54 100644 --- a/src/video_core/shader/track.cpp +++ b/src/video_core/shader/track.cpp | |||
| @@ -36,7 +36,6 @@ std::pair<Node, s64> FindOperation(const NodeBlock& code, s64 cursor, | |||
| 36 | } | 36 | } |
| 37 | return {}; | 37 | return {}; |
| 38 | } | 38 | } |
| 39 | } // Anonymous namespace | ||
| 40 | 39 | ||
| 41 | std::optional<std::pair<Node, Node>> DecoupleIndirectRead(const OperationNode& operation) { | 40 | std::optional<std::pair<Node, Node>> DecoupleIndirectRead(const OperationNode& operation) { |
| 42 | if (operation.GetCode() != OperationCode::UAdd) { | 41 | if (operation.GetCode() != OperationCode::UAdd) { |
| @@ -44,9 +43,7 @@ std::optional<std::pair<Node, Node>> DecoupleIndirectRead(const OperationNode& o | |||
| 44 | } | 43 | } |
| 45 | Node gpr{}; | 44 | Node gpr{}; |
| 46 | Node offset{}; | 45 | Node offset{}; |
| 47 | if (operation.GetOperandsCount() != 2) { | 46 | ASSERT(operation.GetOperandsCount() == 2); |
| 48 | return std::nullopt; | ||
| 49 | } | ||
| 50 | for (std::size_t i = 0; i < operation.GetOperandsCount(); i++) { | 47 | for (std::size_t i = 0; i < operation.GetOperandsCount(); i++) { |
| 51 | Node operand = operation[i]; | 48 | Node operand = operation[i]; |
| 52 | if (std::holds_alternative<ImmediateNode>(*operand)) { | 49 | if (std::holds_alternative<ImmediateNode>(*operand)) { |
| @@ -56,7 +53,7 @@ std::optional<std::pair<Node, Node>> DecoupleIndirectRead(const OperationNode& o | |||
| 56 | } | 53 | } |
| 57 | } | 54 | } |
| 58 | if (offset && gpr) { | 55 | if (offset && gpr) { |
| 59 | return {std::make_pair(gpr, offset)}; | 56 | return std::make_pair(gpr, offset); |
| 60 | } | 57 | } |
| 61 | return std::nullopt; | 58 | return std::nullopt; |
| 62 | } | 59 | } |
| @@ -72,6 +69,8 @@ bool AmendNodeCv(std::size_t amend_index, Node node) { | |||
| 72 | return false; | 69 | return false; |
| 73 | } | 70 | } |
| 74 | 71 | ||
| 72 | } // Anonymous namespace | ||
| 73 | |||
| 75 | std::tuple<Node, TrackSampler> ShaderIR::TrackBindlessSampler(Node tracked, const NodeBlock& code, | 74 | std::tuple<Node, TrackSampler> ShaderIR::TrackBindlessSampler(Node tracked, const NodeBlock& code, |
| 76 | s64 cursor) { | 75 | s64 cursor) { |
| 77 | if (const auto cbuf = std::get_if<CbufNode>(&*tracked)) { | 76 | if (const auto cbuf = std::get_if<CbufNode>(&*tracked)) { |