diff options
| author | kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> | 2024-07-01 20:06:58 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-01 20:06:58 -0700 |
| commit | bd01bd3f4b8eecbfb924b8eb4090694e44e8166c (patch) | |
| tree | 8a202bf964ed25d8809250cb46e06baa2d735a7a /tests/compute/byte-address-buffer-array.slang | |
| parent | fff79c311028cc8a5cff310a9c493b23af68eb0c (diff) | |
Fix the type error in kIROp_RWStructuredBufferLoad (#4523)
* Fix the type error in kIROp_RWStructuredBufferLoad
In StructuredBuffer::Load(), we allow any type of integer
as the input. However, when emitting glsl code,
StructuredBuffer::Load(index)
will be translated to the subscript index of the buffer, e.g.
buffer[index], however, glsl doesn't allow 64bit integer as the
subscript.
So the easiest fix is to convert the index to uint when emitting
glsl.
* Add commit
Diffstat (limited to 'tests/compute/byte-address-buffer-array.slang')
| -rw-r--r-- | tests/compute/byte-address-buffer-array.slang | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/compute/byte-address-buffer-array.slang b/tests/compute/byte-address-buffer-array.slang index 1a23821a1..4ac4a612a 100644 --- a/tests/compute/byte-address-buffer-array.slang +++ b/tests/compute/byte-address-buffer-array.slang @@ -26,10 +26,10 @@ void computeMain(uint3 threadId : SV_DispatchThreadID) // CHECK1: {{.*}}[0] = {{.*}}.data_0[0]; // CHECK1: {{.*}}[1] = {{.*}}.data_0[1]; // CHECK1: vec4 {{.*}}[2]; - // CHECK1: unpackStorage_0(buffer_0._data[0], {{.*}}); + // CHECK1: unpackStorage_0(buffer_0._data[uint(0)], {{.*}}); // CHECK1: vec4 {{.*}}[2] = buffer_0._data[0] = packStorage_0({{.*}}); - // CHECK1: vec4 {{.*}} = buffer_2._data[1]; - // CHECK1: vec4 {{.*}} = buffer_2._data[1] = vec4(buffer_1._data[1], buffer_1._data[2], buffer_1._data[3], buffer_1._data[4]); + // CHECK1: vec4 {{.*}} = buffer_2._data[uint(1)]; + // CHECK1: vec4 {{.*}} = buffer_2._data[1] = vec4(buffer_1._data[uint(1)], buffer_1._data[uint(2)], buffer_1._data[uint(3)], buffer_1._data[uint(4)]); // CHECK2: float4 {{.*}}[int(2)] = (buffer_0).Load<float4 [int(2)] >(int(0)); // CHECK2: buffer_0.Store(int(0),{{.*}}); |
