aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/shader/decode/texture.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-05-31 19:14:34 -0300
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-07-14 22:36:44 -0300
commitafa8096df5e3c24cb3b639a7fbc65f7225a17137 (patch)
tree1787485f5b47e86d2c0b2f277cd1085266e5e9b8 /src/video_core/shader/decode/texture.cpp
parent3477b92289244a26e0bfd5a95d60bce53fd1ed61 (diff)
shader: Allow tracking of indirect buffers without variable offset
While changing this code, simplify tracking code to allow returning the base address node, this way callers don't have to manually rebuild it on each invocation.
Diffstat (limited to 'src/video_core/shader/decode/texture.cpp')
-rw-r--r--src/video_core/shader/decode/texture.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/video_core/shader/decode/texture.cpp b/src/video_core/shader/decode/texture.cpp
index 323be3f14..e1ee5c190 100644
--- a/src/video_core/shader/decode/texture.cpp
+++ b/src/video_core/shader/decode/texture.cpp
@@ -308,13 +308,9 @@ const Sampler& ShaderIR::GetSampler(const Tegra::Shader::Sampler& sampler, Textu
const Sampler& ShaderIR::GetBindlessSampler(const Tegra::Shader::Register& reg, TextureType type,
bool is_array, bool is_shadow) {
const Node sampler_register = GetRegister(reg);
- const Node base_sampler =
+ const auto [base_sampler, cbuf_index, cbuf_offset] =
TrackCbuf(sampler_register, global_code, static_cast<s64>(global_code.size()));
- const auto cbuf = std::get_if<CbufNode>(&*base_sampler);
- const auto cbuf_offset_imm = std::get_if<ImmediateNode>(&*cbuf->GetOffset());
- ASSERT(cbuf_offset_imm != nullptr);
- const auto cbuf_offset = cbuf_offset_imm->GetValue();
- const auto cbuf_index = cbuf->GetIndex();
+ ASSERT(base_sampler != nullptr);
const auto cbuf_key = (static_cast<u64>(cbuf_index) << 32) | static_cast<u64>(cbuf_offset);
// If this sampler has already been used, return the existing mapping.