diff options
author | Liam <byteslice@airmail.cc> | 2023-01-21 01:30:45 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-01-23 18:03:19 +0100 |
commit | 76a4356e55d0725d288866a04743f1e991ec3e36 (patch) | |
tree | 47d51ec570aaa51eb4397e08152fc26c73497a8d /src/shader_recompiler/backend/spirv | |
parent | Merge pull request #9555 from abouvier/catch2-update (diff) | |
download | yuzu-76a4356e55d0725d288866a04743f1e991ec3e36.tar yuzu-76a4356e55d0725d288866a04743f1e991ec3e36.tar.gz yuzu-76a4356e55d0725d288866a04743f1e991ec3e36.tar.bz2 yuzu-76a4356e55d0725d288866a04743f1e991ec3e36.tar.lz yuzu-76a4356e55d0725d288866a04743f1e991ec3e36.tar.xz yuzu-76a4356e55d0725d288866a04743f1e991ec3e36.tar.zst yuzu-76a4356e55d0725d288866a04743f1e991ec3e36.zip |
Diffstat (limited to 'src/shader_recompiler/backend/spirv')
-rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_image.cpp | 4 | ||||
-rw-r--r-- | src/shader_recompiler/backend/spirv/spirv_emit_context.cpp | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp index fb5799c42..c898ce12f 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp @@ -436,6 +436,10 @@ Id EmitImageFetch(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id c if (info.type == TextureType::Buffer) { lod = Id{}; } + if (Sirit::ValidId(ms)) { + // This image is multisampled, lod must be implicit + lod = Id{}; + } const ImageOperands operands(offset, lod, ms); return Emit(&EmitContext::OpImageSparseFetch, &EmitContext::OpImageFetch, ctx, inst, ctx.F32[4], TextureImage(ctx, info, index), coords, operands.MaskOptional(), operands.Span()); diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp index a0c155fdb..3b97721e1 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp @@ -35,6 +35,7 @@ Id ImageType(EmitContext& ctx, const TextureDescriptor& desc) { const spv::ImageFormat format{spv::ImageFormat::Unknown}; const Id type{ctx.F32[1]}; const bool depth{desc.is_depth}; + const bool ms{desc.is_multisample}; switch (desc.type) { case TextureType::Color1D: return ctx.TypeImage(type, spv::Dim::Dim1D, depth, false, false, 1, format); @@ -42,9 +43,9 @@ Id ImageType(EmitContext& ctx, const TextureDescriptor& desc) { return ctx.TypeImage(type, spv::Dim::Dim1D, depth, true, false, 1, format); case TextureType::Color2D: case TextureType::Color2DRect: - return ctx.TypeImage(type, spv::Dim::Dim2D, depth, false, false, 1, format); + return ctx.TypeImage(type, spv::Dim::Dim2D, depth, false, ms, 1, format); case TextureType::ColorArray2D: - return ctx.TypeImage(type, spv::Dim::Dim2D, depth, true, false, 1, format); + return ctx.TypeImage(type, spv::Dim::Dim2D, depth, true, ms, 1, format); case TextureType::Color3D: return ctx.TypeImage(type, spv::Dim::Dim3D, depth, false, false, 1, format); case TextureType::ColorCube: |