summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/frontend/maxwell/translate/impl
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-01-29 18:27:26 +0100
committerGitHub <noreply@github.com>2023-01-29 18:27:26 +0100
commit208e635f370d7cf90b80e9a5301f161283eefd8b (patch)
tree830bb769857629e25b0e43fefd79d8bfe0b231e9 /src/shader_recompiler/frontend/maxwell/translate/impl
parentMerge pull request #9684 from liamwhite/read-the-spec (diff)
parentshader_recompiler: TXQ: Skip QueryLevels when possible (diff)
downloadyuzu-208e635f370d7cf90b80e9a5301f161283eefd8b.tar
yuzu-208e635f370d7cf90b80e9a5301f161283eefd8b.tar.gz
yuzu-208e635f370d7cf90b80e9a5301f161283eefd8b.tar.bz2
yuzu-208e635f370d7cf90b80e9a5301f161283eefd8b.tar.lz
yuzu-208e635f370d7cf90b80e9a5301f161283eefd8b.tar.xz
yuzu-208e635f370d7cf90b80e9a5301f161283eefd8b.tar.zst
yuzu-208e635f370d7cf90b80e9a5301f161283eefd8b.zip
Diffstat (limited to '')
-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) {