diff options
| author | 2019-01-30 02:20:05 -0300 | |
|---|---|---|
| committer | 2019-02-03 17:21:20 -0300 | |
| commit | 0d1d755086f95fb20975fe2a4fd6c9c9de43789b (patch) | |
| tree | 7d60ff631153b866580d73f7dfc4c495694c319c | |
| parent | shader_ir: Rename BasicBlock to NodeBlock (diff) | |
| download | yuzu-0d1d755086f95fb20975fe2a4fd6c9c9de43789b.tar.gz yuzu-0d1d755086f95fb20975fe2a4fd6c9c9de43789b.tar.xz yuzu-0d1d755086f95fb20975fe2a4fd6c9c9de43789b.zip | |
shader/track: Search inside of conditional nodes
Some games search conditionally use global memory instructions. This
allows the heuristic to search inside conditional nodes for the source
constant buffer.
| -rw-r--r-- | src/video_core/shader/track.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/video_core/shader/track.cpp b/src/video_core/shader/track.cpp index 343c129c7..be4635342 100644 --- a/src/video_core/shader/track.cpp +++ b/src/video_core/shader/track.cpp | |||
| @@ -19,6 +19,13 @@ std::pair<Node, s64> FindOperation(const NodeBlock& code, s64 cursor, | |||
| 19 | if (operation->GetCode() == operation_code) | 19 | if (operation->GetCode() == operation_code) |
| 20 | return {node, cursor}; | 20 | return {node, cursor}; |
| 21 | } | 21 | } |
| 22 | if (const auto conditional = std::get_if<ConditionalNode>(node)) { | ||
| 23 | const auto& code = conditional->GetCode(); | ||
| 24 | const auto [found, internal_cursor] = | ||
| 25 | FindOperation(code, static_cast<s64>(code.size() - 1), operation_code); | ||
| 26 | if (found) | ||
| 27 | return {found, cursor}; | ||
| 28 | } | ||
| 22 | } | 29 | } |
| 23 | return {}; | 30 | return {}; |
| 24 | } | 31 | } |
| @@ -50,6 +57,10 @@ Node ShaderIR::TrackCbuf(Node tracked, const NodeBlock& code, s64 cursor) { | |||
| 50 | } | 57 | } |
| 51 | return nullptr; | 58 | return nullptr; |
| 52 | } | 59 | } |
| 60 | if (const auto conditional = std::get_if<ConditionalNode>(tracked)) { | ||
| 61 | const auto& code = conditional->GetCode(); | ||
| 62 | return TrackCbuf(tracked, code, static_cast<s64>(code.size())); | ||
| 63 | } | ||
| 53 | return nullptr; | 64 | return nullptr; |
| 54 | } | 65 | } |
| 55 | 66 | ||