diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/metal/texture-store-vector.slang | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/metal/texture-store-vector.slang b/tests/metal/texture-store-vector.slang new file mode 100644 index 000000000..0f63b7ce3 --- /dev/null +++ b/tests/metal/texture-store-vector.slang @@ -0,0 +1,16 @@ +//TEST:SIMPLE(filecheck=CHECK): -target metal + +// Test that we can compile texture store operations with 2-component vectors +// without segfaulting. This reproduces the issue where legalizeImageStoreValue +// would crash when trying to expand a float2 to float4 for Metal texture writes. + +RWTexture2D<float2> output; + +[shader("compute")] +[numthreads(32, 32, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + // This should expand float2(1,2) to float4(1,2,0,0) + // CHECK: {{.*}}float4(1.0, 2.0, + output.Store(dispatchThreadID.xy, float2(1, 2)); +}
\ No newline at end of file |
