diff options
| author | 2024-02-15 18:40:36 -0500 | |
|---|---|---|
| committer | 2024-02-15 18:49:23 -0500 | |
| commit | 462ea921e3bd1288671139353a883053aeeb9a79 (patch) | |
| tree | ec3bb58ae4a4ef1ddef1dc9a75380634ef96d9af /src | |
| parent | Revert "shader_recompiler: use only ConstOffset for OpImageFetch" (diff) | |
| download | yuzu-462ea921e3bd1288671139353a883053aeeb9a79.tar.gz yuzu-462ea921e3bd1288671139353a883053aeeb9a79.tar.xz yuzu-462ea921e3bd1288671139353a883053aeeb9a79.zip | |
shader_recompiler: fix non-const offset for arrayed image types
Diffstat (limited to '')
| -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 | |||
| 321 | Id result_type{}; | 321 | Id result_type{}; |
| 322 | switch (info.type) { | 322 | switch (info.type) { |
| 323 | case TextureType::Buffer: | 323 | case TextureType::Buffer: |
| 324 | case TextureType::Color1D: | 324 | case TextureType::Color1D: { |
| 325 | case TextureType::ColorArray1D: { | ||
| 326 | result_type = ctx.U32[1]; | 325 | result_type = ctx.U32[1]; |
| 327 | break; | 326 | break; |
| 328 | } | 327 | } |
| 328 | case TextureType::ColorArray1D: | ||
| 329 | offset = ctx.OpCompositeConstruct(ctx.U32[2], offset, ctx.u32_zero_value); | ||
| 330 | [[fallthrough]]; | ||
| 329 | case TextureType::Color2D: | 331 | case TextureType::Color2D: |
| 330 | case TextureType::Color2DRect: | 332 | case TextureType::Color2DRect: { |
| 331 | case TextureType::ColorArray2D: { | ||
| 332 | result_type = ctx.U32[2]; | 333 | result_type = ctx.U32[2]; |
| 333 | break; | 334 | break; |
| 334 | } | 335 | } |
| 336 | case TextureType::ColorArray2D: | ||
| 337 | offset = ctx.OpCompositeConstruct(ctx.U32[3], ctx.OpCompositeExtract(ctx.U32[1], coords, 0), | ||
| 338 | ctx.OpCompositeExtract(ctx.U32[1], coords, 1), | ||
| 339 | ctx.u32_zero_value); | ||
| 340 | [[fallthrough]]; | ||
| 335 | case TextureType::Color3D: { | 341 | case TextureType::Color3D: { |
| 336 | result_type = ctx.U32[3]; | 342 | result_type = ctx.U32[3]; |
| 337 | break; | 343 | break; |