diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2023-01-28 22:09:58 +0100 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2023-01-28 22:25:18 +0100 |
commit | 2c2e019a44e353921d5fdf3cc6ab4304502eb2bd (patch) | |
tree | 37c9582394bca3fe15fe2827d82f4b0da4e450a8 /src/shader_recompiler/backend/spirv/emit_spirv_image.cpp | |
parent | Merge pull request #9685 from liamwhite/minmax (diff) | |
download | yuzu-2c2e019a44e353921d5fdf3cc6ab4304502eb2bd.tar yuzu-2c2e019a44e353921d5fdf3cc6ab4304502eb2bd.tar.gz yuzu-2c2e019a44e353921d5fdf3cc6ab4304502eb2bd.tar.bz2 yuzu-2c2e019a44e353921d5fdf3cc6ab4304502eb2bd.tar.lz yuzu-2c2e019a44e353921d5fdf3cc6ab4304502eb2bd.tar.xz yuzu-2c2e019a44e353921d5fdf3cc6ab4304502eb2bd.tar.zst yuzu-2c2e019a44e353921d5fdf3cc6ab4304502eb2bd.zip |
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_spirv_image.cpp')
-rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_image.cpp | 6 |
1 files changed, 4 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 c898ce12f..3b969d915 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp @@ -445,11 +445,13 @@ Id EmitImageFetch(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id c TextureImage(ctx, info, index), coords, operands.MaskOptional(), operands.Span()); } -Id EmitImageQueryDimensions(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id lod) { +Id EmitImageQueryDimensions(EmitContext& ctx, IR::Inst* inst, const IR::Value& index, Id lod, + const IR::Value& skip_mips_val) { const auto info{inst->Flags<IR::TextureInstInfo>()}; const Id image{TextureImage(ctx, info, index)}; const Id zero{ctx.u32_zero_value}; - const auto mips{[&] { return ctx.OpImageQueryLevels(ctx.U32[1], image); }}; + const bool skip_mips{skip_mips_val.U1()}; + const auto mips{[&] { return skip_mips ? zero : ctx.OpImageQueryLevels(ctx.U32[1], image); }}; switch (info.type) { case TextureType::Color1D: return ctx.OpCompositeConstruct(ctx.U32[4], ctx.OpImageQuerySizeLod(ctx.U32[1], image, lod), |