yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
adcc7e81
16.5.0
1struct MyStruct { 2uint a ; 3uint b ; 4uint c ; 5} ; 6 7struct MyStructs { 8uint count ; 9MyStruct data [] ; 10} ; 11 12StructuredBuffer < MyStructs > sb ; 13StructuredBuffer < MyStruct > o ; 14 15groupshared MyStruct s [ 128 ] ; 16static const MyStruct deflt = { 1u , 2u , 3u } ; 17 18[ numthreads ( 128 , 1 , 1 )] 19void main ( uint id : SV_GroupIndex ) 20{ 21s [ 0 ] = deflt ; 22uint count = sb . Load ( 0 ) . count ; 23MyStruct ms = id > count ? s [ id - count ] : sb . Load ( 0 ) . data [ id ] ; 24 25InterlockedAdd ( o [ 0 ] . a , ms . a ) ; 26InterlockedAdd ( o [ 0 ] . b , ms . b ) ; 27InterlockedAdd ( o [ 0 ] . c , ms . c ) ; 28}