summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/ir_opt/texture_pass.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2023-01-26 07:28:18 +0100
committerGitHub <noreply@github.com>2023-01-26 07:28:18 +0100
commit58ba508e9a2c794bdb8bbf10e42a7865c48b9b77 (patch)
treef223fa57dd2419cab12ccda44d29f09bd58febc0 /src/shader_recompiler/ir_opt/texture_pass.cpp
parentMerge pull request #9604 from liamwhite/pt (diff)
parentspirv: fix multisampled image fetch (diff)
downloadyuzu-58ba508e9a2c794bdb8bbf10e42a7865c48b9b77.tar
yuzu-58ba508e9a2c794bdb8bbf10e42a7865c48b9b77.tar.gz
yuzu-58ba508e9a2c794bdb8bbf10e42a7865c48b9b77.tar.bz2
yuzu-58ba508e9a2c794bdb8bbf10e42a7865c48b9b77.tar.lz
yuzu-58ba508e9a2c794bdb8bbf10e42a7865c48b9b77.tar.xz
yuzu-58ba508e9a2c794bdb8bbf10e42a7865c48b9b77.tar.zst
yuzu-58ba508e9a2c794bdb8bbf10e42a7865c48b9b77.zip
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/ir_opt/texture_pass.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/shader_recompiler/ir_opt/texture_pass.cpp b/src/shader_recompiler/ir_opt/texture_pass.cpp
index f5c86fcb1..9718c6921 100644
--- a/src/shader_recompiler/ir_opt/texture_pass.cpp
+++ b/src/shader_recompiler/ir_opt/texture_pass.cpp
@@ -524,6 +524,7 @@ void TexturePass(Environment& env, IR::Program& program, const HostTranslateInfo
const auto& cbuf{texture_inst.cbuf};
auto flags{inst->Flags<IR::TextureInstInfo>()};
+ bool is_multisample{false};
switch (inst->GetOpcode()) {
case IR::Opcode::ImageQueryDimensions:
flags.type.Assign(ReadTextureType(env, cbuf));
@@ -538,6 +539,12 @@ void TexturePass(Environment& env, IR::Program& program, const HostTranslateInfo
}
break;
case IR::Opcode::ImageFetch:
+ if (flags.type == TextureType::Color2D || flags.type == TextureType::Color2DRect ||
+ flags.type == TextureType::ColorArray2D) {
+ is_multisample = !inst->Arg(4).IsEmpty();
+ } else {
+ inst->SetArg(4, IR::U32{});
+ }
if (flags.type != TextureType::Color1D) {
break;
}
@@ -613,6 +620,7 @@ void TexturePass(Environment& env, IR::Program& program, const HostTranslateInfo
index = descriptors.Add(TextureDescriptor{
.type = flags.type,
.is_depth = flags.is_depth != 0,
+ .is_multisample = is_multisample,
.has_secondary = cbuf.has_secondary,
.cbuf_index = cbuf.index,
.cbuf_offset = cbuf.offset,