diff options
| author | Yong He <yonghe@outlook.com> | 2024-10-09 07:35:10 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-09 22:35:10 +0800 |
| commit | ac6f04c15995061ebe8e0ddf62ecf7eb979afb65 (patch) | |
| tree | f16f0f01f1f8d0e73ecd774a22f87576f440f8e8 /tests/bugs | |
| parent | bea1394ad35680940a0b69b9c67efc43764cc194 (diff) | |
Fix spirv lowering logic around pointer to unsized array. (#5243)
* Fix spirv lowering logic around pointer to unsized array.
* Fix.
---------
Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Diffstat (limited to 'tests/bugs')
| -rw-r--r-- | tests/bugs/gh-3825.slang | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/bugs/gh-3825.slang b/tests/bugs/gh-3825.slang index 1feadb588..c7c325864 100644 --- a/tests/bugs/gh-3825.slang +++ b/tests/bugs/gh-3825.slang @@ -4,7 +4,7 @@ //TEST:SIMPLE(filecheck=CHECK): -entry fragment -stage fragment -emit-spirv-directly -target spirv-assembly -emit-spirv-directly struct Descriptors { uint count; - uint array[]; + uint4 array[]; } struct Context { @@ -17,7 +17,11 @@ struct Context { [shader("fragment")] float4 fragment(): SV_Target { - return float4(float(context.descriptors[0].array[0]), 1., 1., 1.); + return float4(float(context.descriptors->array[0].x), 1., 1., 1.); } -// CHECK: OpDecorate %_ptr_PhysicalStorageBuffer__runtimearr_uint ArrayStride 65535 +// CHECK: OpDecorate %_ptr_PhysicalStorageBuffer_Descriptors_natural ArrayStride 4 +// CHECK: %{{.*}} = OpPtrAccessChain %_ptr_PhysicalStorageBuffer_Descriptors_natural %{{.*}} %int_1 +// CHECK: OpBitcast %ulong +// CHECK: OpIAdd %ulong %{{.*}} %ulong_4 +// CHECK: OpBitcast %_ptr_PhysicalStorageBuffer
\ No newline at end of file |
