yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
bd6dbaf7c
master
1#version 450 2#extension GL_EXT_shader_atomic_float : require 3layout (row_major )uniform ; 4layout (row_major )buffer ; 5 6#line 11 "tests/slang-extension/atomic-float-byte-address-buffer-cross.slang" 7layout (std430 ,binding = 1 )buffer StructuredBuffer_float_t_0 { 8float _data []; 9}anotherBuffer_0 ; 10 11#line 11 12layout (std430 ,binding = 0 )buffer StructuredBuffer_float_t_1 { 13float _data []; 14}outputBuffer_0 ; 15 16#line 1264 "core.meta.slang" 17void RWByteAddressBuffer_InterlockedAddF32_0 (uint _S1 ,float _S2 ,out float _S3 ) 18{ 19 20#line 391 "hlsl.meta.slang" 21float _S4 = (atomicAdd ((outputBuffer_0 ._data [_S1 /4U ]), (_S2 ))); 22 23#line 391 24_S3 = _S4 ; 25return ; 26} 27 28 29#line 392 30void RWByteAddressBuffer_InterlockedAddF32_1 (uint _S5 ,float _S6 ) 31{ 32 33#line 406 34float _S7 = (atomicAdd ((outputBuffer_0 ._data [_S5 /4U ]), (_S6 ))); 35return ; 36} 37 38 39#line 14 "tests/slang-extension/atomic-float-byte-address-buffer-cross.slang" 40layout (local_size_x = 16 ,local_size_y = 1 ,local_size_z = 1 )in ; 41void main () 42{ 43 44#line 16 45uint tid_0 = gl_GlobalInvocationID .x ; 46uint _S8 = tid_0 >>2 ; 47 48#line 17 49int idx_0 = int (tid_0 & 3U ^_S8 ); 50 51float delta_0 = anotherBuffer_0 ._data [uint (idx_0 & 3 )]; 52 53float previousValue_0 = 0.0 ; 54 55#line 21 56RWByteAddressBuffer_InterlockedAddF32_0 (uint (idx_0 <<2 ),1.0 ,previousValue_0 ); 57 58#line 21 59RWByteAddressBuffer_InterlockedAddF32_1 (uint (int (_S8 ) <<2 ),delta_0 ); 60 61#line 27 62return ; 63} 64 65