diff options
| author | bunnei <bunneidev@gmail.com> | 2019-07-18 13:52:01 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-18 13:52:01 -0400 |
| commit | 63bda67a342cf0516501fb30a24452ce9944caa0 (patch) | |
| tree | fdd92aac366c60923a9ae451baa78b33a1a8425f /src/video_core/shader/track.cpp | |
| parent | d4b95bfc25cfb097fc91f4c8f45b56ff5c7a2337 (diff) | |
| parent | bebbdc20677c900aec5a6fa9481b1861f202ca02 (diff) | |
Merge pull request #2738 from lioncash/shader-ir
shader-ir: Minor cleanup-related changes
Diffstat (limited to 'src/video_core/shader/track.cpp')
| -rw-r--r-- | src/video_core/shader/track.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/video_core/shader/track.cpp b/src/video_core/shader/track.cpp index dc132a4a3..a53e02253 100644 --- a/src/video_core/shader/track.cpp +++ b/src/video_core/shader/track.cpp @@ -15,18 +15,20 @@ namespace { std::pair<Node, s64> FindOperation(const NodeBlock& code, s64 cursor, OperationCode operation_code) { for (; cursor >= 0; --cursor) { - const Node node = code.at(cursor); + Node node = code.at(cursor); + if (const auto operation = std::get_if<OperationNode>(&*node)) { if (operation->GetCode() == operation_code) { - return {node, cursor}; + return {std::move(node), cursor}; } } + if (const auto conditional = std::get_if<ConditionalNode>(&*node)) { const auto& conditional_code = conditional->GetCode(); - const auto [found, internal_cursor] = FindOperation( + auto [found, internal_cursor] = FindOperation( conditional_code, static_cast<s64>(conditional_code.size() - 1), operation_code); if (found) { - return {found, cursor}; + return {std::move(found), cursor}; } } } |
