diff options
| author | 2023-01-20 19:30:45 -0500 | |
|---|---|---|
| committer | 2023-01-23 12:03:19 -0500 | |
| commit | 76a4356e55d0725d288866a04743f1e991ec3e36 (patch) | |
| tree | 47d51ec570aaa51eb4397e08152fc26c73497a8d /src/shader_recompiler/ir_opt/texture_pass.cpp | |
| parent | Merge pull request #9555 from abouvier/catch2-update (diff) | |
| download | yuzu-76a4356e55d0725d288866a04743f1e991ec3e36.tar.gz yuzu-76a4356e55d0725d288866a04743f1e991ec3e36.tar.xz yuzu-76a4356e55d0725d288866a04743f1e991ec3e36.zip | |
spirv: fix multisampled image fetch
Diffstat (limited to 'src/shader_recompiler/ir_opt/texture_pass.cpp')
| -rw-r--r-- | src/shader_recompiler/ir_opt/texture_pass.cpp | 8 |
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 | |||
| 524 | 524 | ||
| 525 | const auto& cbuf{texture_inst.cbuf}; | 525 | const auto& cbuf{texture_inst.cbuf}; |
| 526 | auto flags{inst->Flags<IR::TextureInstInfo>()}; | 526 | auto flags{inst->Flags<IR::TextureInstInfo>()}; |
| 527 | bool is_multisample{false}; | ||
| 527 | switch (inst->GetOpcode()) { | 528 | switch (inst->GetOpcode()) { |
| 528 | case IR::Opcode::ImageQueryDimensions: | 529 | case IR::Opcode::ImageQueryDimensions: |
| 529 | flags.type.Assign(ReadTextureType(env, cbuf)); | 530 | flags.type.Assign(ReadTextureType(env, cbuf)); |
| @@ -538,6 +539,12 @@ void TexturePass(Environment& env, IR::Program& program, const HostTranslateInfo | |||
| 538 | } | 539 | } |
| 539 | break; | 540 | break; |
| 540 | case IR::Opcode::ImageFetch: | 541 | case IR::Opcode::ImageFetch: |
| 542 | if (flags.type == TextureType::Color2D || flags.type == TextureType::Color2DRect || | ||
| 543 | flags.type == TextureType::ColorArray2D) { | ||
| 544 | is_multisample = !inst->Arg(4).IsEmpty(); | ||
| 545 | } else { | ||
| 546 | inst->SetArg(4, IR::U32{}); | ||
| 547 | } | ||
| 541 | if (flags.type != TextureType::Color1D) { | 548 | if (flags.type != TextureType::Color1D) { |
| 542 | break; | 549 | break; |
| 543 | } | 550 | } |
| @@ -613,6 +620,7 @@ void TexturePass(Environment& env, IR::Program& program, const HostTranslateInfo | |||
| 613 | index = descriptors.Add(TextureDescriptor{ | 620 | index = descriptors.Add(TextureDescriptor{ |
| 614 | .type = flags.type, | 621 | .type = flags.type, |
| 615 | .is_depth = flags.is_depth != 0, | 622 | .is_depth = flags.is_depth != 0, |
| 623 | .is_multisample = is_multisample, | ||
| 616 | .has_secondary = cbuf.has_secondary, | 624 | .has_secondary = cbuf.has_secondary, |
| 617 | .cbuf_index = cbuf.index, | 625 | .cbuf_index = cbuf.index, |
| 618 | .cbuf_offset = cbuf.offset, | 626 | .cbuf_offset = cbuf.offset, |