summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/frontend/maxwell/translate/impl
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2023-01-28 22:09:58 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2023-01-28 22:25:18 +0100
commit2c2e019a44e353921d5fdf3cc6ab4304502eb2bd (patch)
tree37c9582394bca3fe15fe2827d82f4b0da4e450a8 /src/shader_recompiler/frontend/maxwell/translate/impl
parentMerge pull request #9685 from liamwhite/minmax (diff)
downloadyuzu-2c2e019a44e353921d5fdf3cc6ab4304502eb2bd.tar
yuzu-2c2e019a44e353921d5fdf3cc6ab4304502eb2bd.tar.gz
yuzu-2c2e019a44e353921d5fdf3cc6ab4304502eb2bd.tar.bz2
yuzu-2c2e019a44e353921d5fdf3cc6ab4304502eb2bd.tar.lz
yuzu-2c2e019a44e353921d5fdf3cc6ab4304502eb2bd.tar.xz
yuzu-2c2e019a44e353921d5fdf3cc6ab4304502eb2bd.tar.zst
yuzu-2c2e019a44e353921d5fdf3cc6ab4304502eb2bd.zip
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell/translate/impl')
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/texture_query.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_query.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_query.cpp
index f8cfd4ab6..39af62559 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/texture_query.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/texture_query.cpp
@@ -15,11 +15,13 @@ enum class Mode : u64 {
SamplePos = 5,
};
-IR::Value Query(TranslatorVisitor& v, const IR::U32& handle, Mode mode, IR::Reg src_reg) {
+IR::Value Query(TranslatorVisitor& v, const IR::U32& handle, Mode mode, IR::Reg src_reg, u64 mask) {
switch (mode) {
case Mode::Dimension: {
+ const bool needs_num_mips{((mask >> 3) & 1) != 0};
+ const IR::U1 skip_mips{v.ir.Imm1(!needs_num_mips)};
const IR::U32 lod{v.X(src_reg)};
- return v.ir.ImageQueryDimension(handle, lod);
+ return v.ir.ImageQueryDimension(handle, lod, skip_mips);
}
case Mode::TextureType:
case Mode::SamplePos:
@@ -46,7 +48,7 @@ void Impl(TranslatorVisitor& v, u64 insn, std::optional<u32> cbuf_offset) {
handle = v.X(src_reg);
++src_reg;
}
- const IR::Value query{Query(v, handle, txq.mode, src_reg)};
+ const IR::Value query{Query(v, handle, txq.mode, src_reg, txq.mask)};
IR::Reg dest_reg{txq.dest_reg};
for (int element = 0; element < 4; ++element) {
if (((txq.mask >> element) & 1) == 0) {