diff options
author | Liam <byteslice@airmail.cc> | 2024-02-16 00:40:36 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2024-02-16 00:49:23 +0100 |
commit | 462ea921e3bd1288671139353a883053aeeb9a79 (patch) | |
tree | ec3bb58ae4a4ef1ddef1dc9a75380634ef96d9af /src/shader_recompiler/backend | |
parent | Revert "shader_recompiler: use only ConstOffset for OpImageFetch" (diff) | |
download | yuzu-462ea921e3bd1288671139353a883053aeeb9a79.tar yuzu-462ea921e3bd1288671139353a883053aeeb9a79.tar.gz yuzu-462ea921e3bd1288671139353a883053aeeb9a79.tar.bz2 yuzu-462ea921e3bd1288671139353a883053aeeb9a79.tar.lz yuzu-462ea921e3bd1288671139353a883053aeeb9a79.tar.xz yuzu-462ea921e3bd1288671139353a883053aeeb9a79.tar.zst yuzu-462ea921e3bd1288671139353a883053aeeb9a79.zip |
Diffstat (limited to 'src/shader_recompiler/backend')
-rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_image.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp index 64a4e0e55..945cdb42b 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_image.cpp @@ -321,17 +321,23 @@ void AddOffsetToCoordinates(EmitContext& ctx, const IR::TextureInstInfo& info, I Id result_type{}; switch (info.type) { case TextureType::Buffer: - case TextureType::Color1D: - case TextureType::ColorArray1D: { + case TextureType::Color1D: { result_type = ctx.U32[1]; break; } + case TextureType::ColorArray1D: + offset = ctx.OpCompositeConstruct(ctx.U32[2], offset, ctx.u32_zero_value); + [[fallthrough]]; case TextureType::Color2D: - case TextureType::Color2DRect: - case TextureType::ColorArray2D: { + case TextureType::Color2DRect: { result_type = ctx.U32[2]; break; } + case TextureType::ColorArray2D: + offset = ctx.OpCompositeConstruct(ctx.U32[3], ctx.OpCompositeExtract(ctx.U32[1], coords, 0), + ctx.OpCompositeExtract(ctx.U32[1], coords, 1), + ctx.u32_zero_value); + [[fallthrough]]; case TextureType::Color3D: { result_type = ctx.U32[3]; break; |