diff options
author | Lioncash <mathew1800@gmail.com> | 2019-05-19 10:10:32 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-05-19 14:23:09 +0200 |
commit | e09ee0ff23bc70069277df87698f86cc07fb8785 (patch) | |
tree | b33bf68596b3dcacc7301292173e27ca7741916d /src/video_core/shader/track.cpp | |
parent | shader/shader_ir: Place implementations of constructor and destructor in cpp file (diff) | |
download | yuzu-e09ee0ff23bc70069277df87698f86cc07fb8785.tar yuzu-e09ee0ff23bc70069277df87698f86cc07fb8785.tar.gz yuzu-e09ee0ff23bc70069277df87698f86cc07fb8785.tar.bz2 yuzu-e09ee0ff23bc70069277df87698f86cc07fb8785.tar.lz yuzu-e09ee0ff23bc70069277df87698f86cc07fb8785.tar.xz yuzu-e09ee0ff23bc70069277df87698f86cc07fb8785.tar.zst yuzu-e09ee0ff23bc70069277df87698f86cc07fb8785.zip |
Diffstat (limited to 'src/video_core/shader/track.cpp')
-rw-r--r-- | src/video_core/shader/track.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/video_core/shader/track.cpp b/src/video_core/shader/track.cpp index 4505667ff..19ede1eb9 100644 --- a/src/video_core/shader/track.cpp +++ b/src/video_core/shader/track.cpp @@ -17,22 +17,24 @@ std::pair<Node, s64> FindOperation(const NodeBlock& code, s64 cursor, for (; cursor >= 0; --cursor) { const Node node = code.at(cursor); if (const auto operation = std::get_if<OperationNode>(node)) { - if (operation->GetCode() == operation_code) + if (operation->GetCode() == operation_code) { return {node, cursor}; + } } if (const auto conditional = std::get_if<ConditionalNode>(node)) { const auto& conditional_code = conditional->GetCode(); const auto [found, internal_cursor] = FindOperation( conditional_code, static_cast<s64>(conditional_code.size() - 1), operation_code); - if (found) + if (found) { return {found, cursor}; + } } } return {}; } } // namespace -Node ShaderIR::TrackCbuf(Node tracked, const NodeBlock& code, s64 cursor) { +Node ShaderIR::TrackCbuf(Node tracked, const NodeBlock& code, s64 cursor) const { if (const auto cbuf = std::get_if<CbufNode>(tracked)) { // Cbuf found, but it has to be immediate return std::holds_alternative<ImmediateNode>(*cbuf->GetOffset()) ? tracked : nullptr; @@ -65,7 +67,7 @@ Node ShaderIR::TrackCbuf(Node tracked, const NodeBlock& code, s64 cursor) { return nullptr; } -std::optional<u32> ShaderIR::TrackImmediate(Node tracked, const NodeBlock& code, s64 cursor) { +std::optional<u32> ShaderIR::TrackImmediate(Node tracked, const NodeBlock& code, s64 cursor) const { // Reduce the cursor in one to avoid infinite loops when the instruction sets the same register // that it uses as operand const auto [found, found_cursor] = @@ -80,7 +82,7 @@ std::optional<u32> ShaderIR::TrackImmediate(Node tracked, const NodeBlock& code, } std::pair<Node, s64> ShaderIR::TrackRegister(const GprNode* tracked, const NodeBlock& code, - s64 cursor) { + s64 cursor) const { for (; cursor >= 0; --cursor) { const auto [found_node, new_cursor] = FindOperation(code, cursor, OperationCode::Assign); if (!found_node) { |