diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-02-02 04:38:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-02 04:38:00 +0100 |
commit | a9a860a4f7fbf192435107ce9855d84c9fe1f475 (patch) | |
tree | 5063c9bbadfdfa449e590f2d945e55233e9f090a /src/shader_recompiler/backend/glasm/emit_glasm_image.cpp | |
parent | Merge pull request #9696 from german77/please_forgive_me_for_this_sin (diff) | |
parent | spirv: Fix TXQ with MSAA textures (diff) | |
download | yuzu-a9a860a4f7fbf192435107ce9855d84c9fe1f475.tar yuzu-a9a860a4f7fbf192435107ce9855d84c9fe1f475.tar.gz yuzu-a9a860a4f7fbf192435107ce9855d84c9fe1f475.tar.bz2 yuzu-a9a860a4f7fbf192435107ce9855d84c9fe1f475.tar.lz yuzu-a9a860a4f7fbf192435107ce9855d84c9fe1f475.tar.xz yuzu-a9a860a4f7fbf192435107ce9855d84c9fe1f475.tar.zst yuzu-a9a860a4f7fbf192435107ce9855d84c9fe1f475.zip |
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_glasm_image.cpp')
-rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_image.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp index b7bc11416..85ee27333 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_image.cpp @@ -59,6 +59,13 @@ std::string Image(EmitContext& ctx, IR::TextureInstInfo info, } } +bool IsTextureMsaa(EmitContext& ctx, const IR::TextureInstInfo& info) { + if (info.type == TextureType::Buffer) { + return false; + } + return ctx.info.texture_descriptors.at(info.descriptor_index).is_multisample; +} + std::string_view TextureType(IR::TextureInstInfo info, bool is_ms = false) { if (info.is_depth) { switch (info.type) { @@ -535,7 +542,8 @@ void EmitImageQueryDimensions(EmitContext& ctx, IR::Inst& inst, const IR::Value& ScalarS32 lod, [[maybe_unused]] const IR::Value& skip_mips) { const auto info{inst.Flags<IR::TextureInstInfo>()}; const std::string texture{Texture(ctx, info, index)}; - const std::string_view type{TextureType(info)}; + const bool is_msaa{IsTextureMsaa(ctx, info)}; + const std::string_view type{TextureType(info, is_msaa)}; ctx.Add("TXQ {},{},{},{};", inst, lod, texture, type); } |