diff options
author | FernandoS27 <fsahmkow27@gmail.com> | 2021-03-30 08:41:21 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:25 +0200 |
commit | 4d0d29fc2092bf02e102b8bac9cfa1b509274901 (patch) | |
tree | 97fbee1b64a0e5d8189cac30e8dd0a1a72a8ec4a /src/shader_recompiler/frontend/maxwell/translate/impl/texture_load.cpp | |
parent | shader: Always pass a lod for TexelFetch (diff) | |
download | yuzu-4d0d29fc2092bf02e102b8bac9cfa1b509274901.tar yuzu-4d0d29fc2092bf02e102b8bac9cfa1b509274901.tar.gz yuzu-4d0d29fc2092bf02e102b8bac9cfa1b509274901.tar.bz2 yuzu-4d0d29fc2092bf02e102b8bac9cfa1b509274901.tar.lz yuzu-4d0d29fc2092bf02e102b8bac9cfa1b509274901.tar.xz yuzu-4d0d29fc2092bf02e102b8bac9cfa1b509274901.tar.zst yuzu-4d0d29fc2092bf02e102b8bac9cfa1b509274901.zip |
Diffstat (limited to '')
-rw-r--r-- | src/shader_recompiler/frontend/maxwell/translate/impl/texture_load.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_load.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_load.cpp index df38f87a3..987b7ec34 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_load.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_load.cpp @@ -117,10 +117,10 @@ void Impl(TranslatorVisitor& v, u64 insn, bool is_bindless) { IR::Value offset; IR::U32 lod; IR::U32 multisample; - if (!is_bindless) { - handle = v.ir.Imm32(static_cast<u32>(tld.cbuf_offset.Value() * 4)); - } else { + if (is_bindless) { handle = v.X(meta_reg++); + } else { + handle = v.ir.Imm32(static_cast<u32>(tld.cbuf_offset.Value() * 4)); } if (tld.lod != 0) { lod = v.X(meta_reg++); @@ -138,9 +138,7 @@ void Impl(TranslatorVisitor& v, u64 insn, bool is_bindless) { } IR::TextureInstInfo info{}; info.type.Assign(GetType(tld.type, false)); - const IR::Value sample{[&]() -> IR::Value { - return v.ir.ImageFetch(handle, coords, offset, lod, multisample, info); - }()}; + const IR::Value sample{v.ir.ImageFetch(handle, coords, offset, lod, multisample, info)}; IR::Reg dest_reg{tld.dest_reg}; for (size_t element = 0; element < 4; ++element) { |