diff options
author | Lioncash <mathew1800@gmail.com> | 2020-04-16 03:50:06 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2020-04-16 03:50:09 +0200 |
commit | e15ec2705c20ead2257ea7e7f85619a16a7c7de8 (patch) | |
tree | 64dee74aad2c8c0213876c7ff16c91288adedf80 /src/video_core/shader/track.cpp | |
parent | Merge pull request #3612 from ReinUsesLisp/red (diff) | |
download | yuzu-e15ec2705c20ead2257ea7e7f85619a16a7c7de8.tar yuzu-e15ec2705c20ead2257ea7e7f85619a16a7c7de8.tar.gz yuzu-e15ec2705c20ead2257ea7e7f85619a16a7c7de8.tar.bz2 yuzu-e15ec2705c20ead2257ea7e7f85619a16a7c7de8.tar.lz yuzu-e15ec2705c20ead2257ea7e7f85619a16a7c7de8.tar.xz yuzu-e15ec2705c20ead2257ea7e7f85619a16a7c7de8.tar.zst yuzu-e15ec2705c20ead2257ea7e7f85619a16a7c7de8.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/shader/track.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/video_core/shader/track.cpp b/src/video_core/shader/track.cpp index 10739b37d..ffd1d5504 100644 --- a/src/video_core/shader/track.cpp +++ b/src/video_core/shader/track.cpp @@ -75,12 +75,13 @@ std::tuple<Node, TrackSampler> ShaderIR::TrackBindlessSampler(Node tracked, cons s64 cursor) { if (const auto cbuf = std::get_if<CbufNode>(&*tracked)) { // Constant buffer found, test if it's an immediate - const auto offset = cbuf->GetOffset(); + const auto& offset = cbuf->GetOffset(); if (const auto immediate = std::get_if<ImmediateNode>(&*offset)) { auto track = MakeTrackSampler<BindlessSamplerNode>(cbuf->GetIndex(), immediate->GetValue()); return {tracked, track}; - } else if (const auto operation = std::get_if<OperationNode>(&*offset)) { + } + if (const auto operation = std::get_if<OperationNode>(&*offset)) { const u32 bound_buffer = registry.GetBoundBuffer(); if (bound_buffer != cbuf->GetIndex()) { return {}; @@ -93,12 +94,12 @@ std::tuple<Node, TrackSampler> ShaderIR::TrackBindlessSampler(Node tracked, cons const auto offset_inm = std::get_if<ImmediateNode>(&*base_offset); const auto& gpu_driver = registry.AccessGuestDriverProfile(); const u32 bindless_cv = NewCustomVariable(); - const Node op = + Node op = Operation(OperationCode::UDiv, gpr, Immediate(gpu_driver.GetTextureHandlerSize())); const Node cv_node = GetCustomVariable(bindless_cv); Node amend_op = Operation(OperationCode::Assign, cv_node, std::move(op)); - const std::size_t amend_index = DeclareAmend(amend_op); + const std::size_t amend_index = DeclareAmend(std::move(amend_op)); AmendNodeCv(amend_index, code[cursor]); // TODO Implement Bindless Index custom variable auto track = MakeTrackSampler<ArraySamplerNode>(cbuf->GetIndex(), @@ -141,7 +142,7 @@ std::tuple<Node, u32, u32> ShaderIR::TrackCbuf(Node tracked, const NodeBlock& co s64 cursor) const { if (const auto cbuf = std::get_if<CbufNode>(&*tracked)) { // Constant buffer found, test if it's an immediate - const auto offset = cbuf->GetOffset(); + const auto& offset = cbuf->GetOffset(); if (const auto immediate = std::get_if<ImmediateNode>(&*offset)) { return {tracked, cbuf->GetIndex(), immediate->GetValue()}; } |