diff options
| author | Yong He <yonghe@outlook.com> | 2023-08-21 17:07:34 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-21 17:07:34 -0700 |
| commit | bd6dbaf7c3ea720b4ed39904fe08878f9dcbd947 (patch) | |
| tree | 9e8c436e0888d192c462f75e4655a63b51f41648 /tests/slang-extension | |
| parent | f94b2f7a328a898c5e3dc1389d08e0b7ce6e092e (diff) | |
Compile append and consume structured buffers to glsl. (#3142)
* Compile append and consume structured buffers to glsl.
* Fix.
* Update CI config.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/slang-extension')
| -rw-r--r-- | tests/slang-extension/atomic-float-byte-address-buffer-cross.slang.glsl | 54 |
1 files changed, 42 insertions, 12 deletions
diff --git a/tests/slang-extension/atomic-float-byte-address-buffer-cross.slang.glsl b/tests/slang-extension/atomic-float-byte-address-buffer-cross.slang.glsl index 4fb647199..330e76d11 100644 --- a/tests/slang-extension/atomic-float-byte-address-buffer-cross.slang.glsl +++ b/tests/slang-extension/atomic-float-byte-address-buffer-cross.slang.glsl @@ -2,34 +2,64 @@ #extension GL_EXT_shader_atomic_float : require layout(row_major) uniform; layout(row_major) buffer; -layout(std430, binding = 1) buffer _S1 { + +#line 11 "tests/slang-extension/atomic-float-byte-address-buffer-cross.slang" +layout(std430, binding = 1) buffer StructuredBuffer_float_t_0 { float _data[]; } anotherBuffer_0; -layout(std430, binding = 0) buffer _S2 { + +#line 11 +layout(std430, binding = 0) buffer StructuredBuffer_float_t_1 { float _data[]; -} _S3; -void RWByteAddressBuffer_InterlockedAddF32_0(uint _S4, float _S5, out float _S6) +} outputBuffer_0; + +#line 1264 "core.meta.slang" +void RWByteAddressBuffer_InterlockedAddF32_0(uint _S1, float _S2, out float _S3) { - float _S7 = (atomicAdd((((_S3)._data[(_S4 / 4U)])), (_S5))); - _S6 = _S7; + +#line 391 "hlsl.meta.slang" + float _S4 = (atomicAdd((outputBuffer_0._data[_S1 / 4U]), (_S2))); + +#line 391 + _S3 = _S4; return; } -void RWByteAddressBuffer_InterlockedAddF32_1(uint _S8, float _S9) + +#line 392 +void RWByteAddressBuffer_InterlockedAddF32_1(uint _S5, float _S6) { - float _S10 = (atomicAdd((((_S3)._data[(_S8 / 4U)])), (_S9))); + +#line 406 + float _S7 = (atomicAdd((outputBuffer_0._data[_S5 / 4U]), (_S6))); return; } + +#line 14 "tests/slang-extension/atomic-float-byte-address-buffer-cross.slang" layout(local_size_x = 16, local_size_y = 1, local_size_z = 1) in; void main() { + +#line 16 uint tid_0 = gl_GlobalInvocationID.x; - uint _S11 = tid_0 >> 2; - int idx_0 = int(tid_0 & 3U ^ _S11); - float delta_0 = ((anotherBuffer_0)._data[(uint(idx_0 & 3))]); + uint _S8 = tid_0 >> 2; + +#line 17 + int idx_0 = int(tid_0 & 3U ^ _S8); + + float delta_0 = anotherBuffer_0._data[uint(idx_0 & 3)]; + float previousValue_0 = 0.0; + +#line 21 RWByteAddressBuffer_InterlockedAddF32_0(uint(idx_0 << 2), 1.0, previousValue_0); - RWByteAddressBuffer_InterlockedAddF32_1(uint(int(_S11) << 2), delta_0); + +#line 21 + RWByteAddressBuffer_InterlockedAddF32_1(uint(int(_S8) << 2), delta_0); + +#line 27 return; } + + |
