summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/shader/track.cpp11
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
75 s64 cursor) { 75 s64 cursor) {
76 if (const auto cbuf = std::get_if<CbufNode>(&*tracked)) { 76 if (const auto cbuf = std::get_if<CbufNode>(&*tracked)) {
77 // Constant buffer found, test if it's an immediate 77 // Constant buffer found, test if it's an immediate
78 const auto offset = cbuf->GetOffset(); 78 const auto& offset = cbuf->GetOffset();
79 if (const auto immediate = std::get_if<ImmediateNode>(&*offset)) { 79 if (const auto immediate = std::get_if<ImmediateNode>(&*offset)) {
80 auto track = 80 auto track =
81 MakeTrackSampler<BindlessSamplerNode>(cbuf->GetIndex(), immediate->GetValue()); 81 MakeTrackSampler<BindlessSamplerNode>(cbuf->GetIndex(), immediate->GetValue());
82 return {tracked, track}; 82 return {tracked, track};
83 } else if (const auto operation = std::get_if<OperationNode>(&*offset)) { 83 }
84 if (const auto operation = std::get_if<OperationNode>(&*offset)) {
84 const u32 bound_buffer = registry.GetBoundBuffer(); 85 const u32 bound_buffer = registry.GetBoundBuffer();
85 if (bound_buffer != cbuf->GetIndex()) { 86 if (bound_buffer != cbuf->GetIndex()) {
86 return {}; 87 return {};
@@ -93,12 +94,12 @@ std::tuple<Node, TrackSampler> ShaderIR::TrackBindlessSampler(Node tracked, cons
93 const auto offset_inm = std::get_if<ImmediateNode>(&*base_offset); 94 const auto offset_inm = std::get_if<ImmediateNode>(&*base_offset);
94 const auto& gpu_driver = registry.AccessGuestDriverProfile(); 95 const auto& gpu_driver = registry.AccessGuestDriverProfile();
95 const u32 bindless_cv = NewCustomVariable(); 96 const u32 bindless_cv = NewCustomVariable();
96 const Node op = 97 Node op =
97 Operation(OperationCode::UDiv, gpr, Immediate(gpu_driver.GetTextureHandlerSize())); 98 Operation(OperationCode::UDiv, gpr, Immediate(gpu_driver.GetTextureHandlerSize()));
98 99
99 const Node cv_node = GetCustomVariable(bindless_cv); 100 const Node cv_node = GetCustomVariable(bindless_cv);
100 Node amend_op = Operation(OperationCode::Assign, cv_node, std::move(op)); 101 Node amend_op = Operation(OperationCode::Assign, cv_node, std::move(op));
101 const std::size_t amend_index = DeclareAmend(amend_op); 102 const std::size_t amend_index = DeclareAmend(std::move(amend_op));
102 AmendNodeCv(amend_index, code[cursor]); 103 AmendNodeCv(amend_index, code[cursor]);
103 // TODO Implement Bindless Index custom variable 104 // TODO Implement Bindless Index custom variable
104 auto track = MakeTrackSampler<ArraySamplerNode>(cbuf->GetIndex(), 105 auto track = MakeTrackSampler<ArraySamplerNode>(cbuf->GetIndex(),
@@ -141,7 +142,7 @@ std::tuple<Node, u32, u32> ShaderIR::TrackCbuf(Node tracked, const NodeBlock& co
141 s64 cursor) const { 142 s64 cursor) const {
142 if (const auto cbuf = std::get_if<CbufNode>(&*tracked)) { 143 if (const auto cbuf = std::get_if<CbufNode>(&*tracked)) {
143 // Constant buffer found, test if it's an immediate 144 // Constant buffer found, test if it's an immediate
144 const auto offset = cbuf->GetOffset(); 145 const auto& offset = cbuf->GetOffset();
145 if (const auto immediate = std::get_if<ImmediateNode>(&*offset)) { 146 if (const auto immediate = std::get_if<ImmediateNode>(&*offset)) {
146 return {tracked, cbuf->GetIndex(), immediate->GetValue()}; 147 return {tracked, cbuf->GetIndex(), immediate->GetValue()};
147 } 148 }