diff --git a/core/kyty/graphics/shader/recompiler/backend/spirv/spirvEmitterImage.cpp b/core/kyty/graphics/shader/recompiler/backend/spirv/spirvEmitterImage.cpp index 9d4a6568cf..411040cf7a 100644 --- a/core/kyty/graphics/shader/recompiler/backend/spirv/spirvEmitterImage.cpp +++ b/core/kyty/graphics/shader/recompiler/backend/spirv/spirvEmitterImage.cpp @@ -1140,6 +1140,11 @@ void EmitImage(ValueEmitContext& ctx, const IR::Inst& inst) { ctx.Fail(inst, "uses depth comparison with a 3D image"); return; } + if (op == IR::ValueOpcode::ImageGatherRaw && + (volume(mem.resource) || std::ranges::any_of(indirect_images, volume))) { + ctx.Fail(inst, "gathers from a 3D image"); + return; + } if (op == IR::ValueOpcode::ImageGatherRaw) { uint32_t component_or_dref; if (dref) { diff --git a/core/libs/prx/libSceAgcDriver/KytyShim/tests/RecompilerRobustness.cpp b/core/libs/prx/libSceAgcDriver/KytyShim/tests/RecompilerRobustness.cpp index ec9201f7d7..605f0d23f0 100644 --- a/core/libs/prx/libSceAgcDriver/KytyShim/tests/RecompilerRobustness.cpp +++ b/core/libs/prx/libSceAgcDriver/KytyShim/tests/RecompilerRobustness.cpp @@ -32,6 +32,9 @@ const std::vector Cases = { {"lds-umin-in-a-vertex-shader", 0x03, 0x00, {0xd8070000u, 0x00000100u, 0xbf810000u}}, {"image-get-lod-in-a-pixel-shader", 0x04, 0x00, {0xf1800108u, 0x00400400u, 0xf8000801u, 0x00000004u, 0xbf810000u}}, + {"image-gather-from-a-2d-image", 0x01, 0x00, + {0xf35a218du, 0x7e000281u, 0x80000100u, 0xbf960001u, 0xbefe04c0u, + 0xea6f72eau, 0xbf8c0000u, 0xbf810000u}, true}, {"null-export-in-a-compute-shader", 0x00, 0x00, {0xf8000891u, 0x03020100u, 0xbf810000u}}, {"disabled-parameter-export-in-a-compute-shader", 0x00, 0x00, @@ -61,6 +64,9 @@ const std::vector Refusals = { "not valid in a compute shader"}, {"depth-compare-sample-on-a-3d-image", 0x04, 0x00, {0xf0a00110u, 0x00400400u, 0xf8000801u, 0x00000004u, 0xbf810000u}, "depth comparison with a 3D image"}, + {"image-gather-from-a-3d-image", 0x01, 0x00, + {0xf35a2195u, 0x7e000281u, 0x80000100u, 0xbf960001u, 0xbefe04c0u, + 0xea6f72eau, 0xbf8c0000u, 0xbf810000u}, "gathers from a 3D image"}, {"depth-compare-sample-on-a-multisampled-image", 0x04, 0x00, {0xf0a00130u, 0x00400400u, 0xf8000801u, 0x00000004u, 0xbf810000u}, "samples a multisampled image"}, {"sample-on-a-multisampled-image", 0x04, 0x00, {0xf0800130u, 0x00400400u, 0xf8000801u, 0x00000004u, 0xbf810000u}, diff --git a/docs/dev/debt/changes/fix-kyty-image-gather-dimensions.md b/docs/dev/debt/changes/fix-kyty-image-gather-dimensions.md new file mode 100644 index 0000000000..b6500e0720 --- /dev/null +++ b/docs/dev/debt/changes/fix-kyty-image-gather-dimensions.md @@ -0,0 +1,5 @@ +# kyty + +## add Functional + +- [IMAGE_GATHER on a 3D image](../../../core/kyty/graphics/shader/recompiler/backend/spirv/spirvEmitterImage.cpp) is refused because Vulkan does not permit `OpImageGather` with a 3D image. The console operation is not measured, so there is no validated alternative lowering. Closes when: its semantics are measured and a valid lowering is tested.