yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
9866ad91
16.5.0
1#version 450 2 3vec4 undeclared_errors ( vec4 f4 ) 4{ 5vec4 result ; 6gl_SubgroupSize ; // ERROR, extension not enabled (basic) 7gl_SubgroupInvocationID ; // ERROR, extension not enabled (basic) 8subgroupBarrier () ; // ERROR, extension not enabled (basic) 9subgroupMemoryBarrier () ; // ERROR, extension not enabled (basic) 10subgroupMemoryBarrierBuffer () ; // ERROR, extension not enabled (basic) 11subgroupMemoryBarrierImage () ; // ERROR, extension not enabled (basic) 12subgroupElect () ; // ERROR, extension not enabled (basic) 13gl_NumSubgroups ; // ERROR, extension not enabled (basic) 14gl_SubgroupID ; // ERROR, extension not enabled (basic) 15subgroupMemoryBarrierShared () ; // ERROR, extension not enabled (basic) 16 17subgroupAll ( true ) ; // ERROR extension not enabled (vote) 18subgroupAny ( false ) ; // ERROR extension not enabled (vote) 19subgroupAllEqual ( f4 ) ; // ERROR extension not enabled (vote) 20 21gl_SubgroupEqMask ; // ERROR extension not enabled (ballot) 22gl_SubgroupGeMask ; // ERROR extension not enabled (ballot) 23gl_SubgroupGtMask ; // ERROR extension not enabled (ballot) 24gl_SubgroupLeMask ; // ERROR extension not enabled (ballot) 25gl_SubgroupLtMask ; // ERROR extension not enabled (ballot) 26subgroupBroadcast ( f4 , 0 ) ; // ERROR extension not enabled (ballot) 27subgroupBroadcastFirst ( f4 ) ; // ERROR extension not enabled (ballot) 28uvec4 ballot = subgroupBallot ( false ) ; // ERROR extension not enabled (ballot) 29subgroupInverseBallot ( uvec4 ( 0x1 )) ; // ERROR extension not enabled (ballot) 30subgroupBallotBitExtract ( ballot , 0 ) ; // ERROR extension not enabled (ballot) 31subgroupBallotBitCount ( ballot ) ; // ERROR extension not enabled (ballot) 32subgroupBallotInclusiveBitCount ( ballot ) ; // ERROR extension not enabled (ballot) 33subgroupBallotExclusiveBitCount ( ballot ) ; // ERROR extension not enabled (ballot) 34subgroupBallotFindLSB ( ballot ) ; // ERROR extension not enabled (ballot) 35subgroupBallotFindMSB ( ballot ) ; // ERROR extension not enabled (ballot) 36 37subgroupShuffle ( f4 , 0 ) ; // ERROR extension not enabled (shuffle) 38subgroupShuffleXor ( f4 , 0x1 ) ; // ERROR extension not enabled (shuffle) 39subgroupShuffleUp ( f4 , 1 ) ; // ERROR extension not enabled (shuffle_relative) 40subgroupShuffleDown ( f4 , 1 ) ; // ERROR extension not enabled (shuffle_relative) 41 42result = subgroupAdd ( f4 ) ; // ERROR, extension not enabled (arith) 43subgroupMul ( f4 ) ; // ERROR, extension not enabled (arith) 44subgroupMin ( f4 ) ; // ERROR, extension not enabled (arith) 45subgroupMax ( f4 ) ; // ERROR, extension not enabled (arith) 46subgroupAnd ( ballot ) ; // ERROR, extension not enabled (arith) 47subgroupOr ( ballot ) ; // ERROR, extension not enabled (arith) 48subgroupXor ( ballot ) ; // ERROR, extension not enabled (arith) 49subgroupInclusiveAdd ( f4 ) ; // ERROR, extension not enabled (arith) 50subgroupInclusiveMul ( f4 ) ; // ERROR, extension not enabled (arith) 51subgroupInclusiveMin ( f4 ) ; // ERROR, extension not enabled (arith) 52subgroupInclusiveMax ( f4 ) ; // ERROR, extension not enabled (arith) 53subgroupInclusiveAnd ( ballot ) ; // ERROR, extension not enabled (arith) 54subgroupInclusiveOr ( ballot ) ; // ERROR, extension not enabled (arith) 55subgroupInclusiveXor ( ballot ) ; // ERROR, extension not enabled (arith) 56subgroupExclusiveAdd ( f4 ) ; // ERROR, extension not enabled (arith) 57subgroupExclusiveMul ( f4 ) ; // ERROR, extension not enabled (arith) 58subgroupExclusiveMin ( f4 ) ; // ERROR, extension not enabled (arith) 59subgroupExclusiveMax ( f4 ) ; // ERROR, extension not enabled (arith) 60subgroupExclusiveAnd ( ballot ) ; // ERROR, extension not enabled (arith) 61subgroupExclusiveOr ( ballot ) ; // ERROR, extension not enabled (arith) 62subgroupExclusiveXor ( ballot ) ; // ERROR, extension not enabled (arith) 63 64subgroupClusteredAdd ( f4 , 2 ) ; // ERROR, extension not enabled (clustered) 65subgroupClusteredMul ( f4 , 2 ) ; // ERROR, extension not enabled (clustered) 66subgroupClusteredMin ( f4 , 2 ) ; // ERROR, extension not enabled (clustered) 67subgroupClusteredMax ( f4 , 2 ) ; // ERROR, extension not enabled (clustered) 68subgroupClusteredAnd ( ballot , 2 ) ; // ERROR, extension not enabled (clustered) 69subgroupClusteredOr ( ballot , 2 ) ; // ERROR, extension not enabled (clustered) 70subgroupClusteredXor ( ballot , 2 ) ; // ERROR, extension not enabled (clustered) 71 72subgroupQuadBroadcast ( f4 , 0 ) ; // ERROR, extension not enabled (quad) 73subgroupQuadSwapHorizontal ( f4 ) ; // ERROR, extension not enabled (quad) 74subgroupQuadSwapVertical ( f4 ) ; // ERROR, extension not enabled (quad) 75subgroupQuadSwapDiagonal ( f4 ) ; // ERROR, extension not enabled (quad) 76 77uvec4 parti = subgroupPartitionNV ( f4 ) ; // ERROR, extension not enabled (partitioned) 78subgroupPartitionedAddNV ( f4 , parti ) ; // ERROR, extension not enabled (partitioned) 79subgroupPartitionedMulNV ( f4 , parti ) ; // ERROR, extension not enabled (partitioned) 80subgroupPartitionedMinNV ( f4 , parti ) ; // ERROR, extension not enabled (partitioned) 81subgroupPartitionedMaxNV ( f4 , parti ) ; // ERROR, extension not enabled (partitioned) 82subgroupPartitionedAndNV ( ballot , parti ) ; // ERROR, extension not enabled (partitioned) 83subgroupPartitionedOrNV ( ballot , parti ) ; // ERROR, extension not enabled (partitioned) 84subgroupPartitionedXorNV ( ballot , parti ) ; // ERROR, extension not enabled (partitioned) 85subgroupPartitionedInclusiveAddNV ( f4 , parti ) ; // ERROR, extension not enabled (partitioned) 86subgroupPartitionedInclusiveMulNV ( f4 , parti ) ; // ERROR, extension not enabled (partitioned) 87subgroupPartitionedInclusiveMinNV ( f4 , parti ) ; // ERROR, extension not enabled (partitioned) 88subgroupPartitionedInclusiveMaxNV ( f4 , parti ) ; // ERROR, extension not enabled (partitioned) 89subgroupPartitionedInclusiveAndNV ( ballot , parti ) ; // ERROR, extension not enabled (partitioned) 90subgroupPartitionedInclusiveOrNV ( ballot , parti ) ; // ERROR, extension not enabled (partitioned) 91subgroupPartitionedInclusiveXorNV ( ballot , parti ) ; // ERROR, extension not enabled (partitioned) 92subgroupPartitionedExclusiveAddNV ( f4 , parti ) ; // ERROR, extension not enabled (partitioned) 93subgroupPartitionedExclusiveMulNV ( f4 , parti ) ; // ERROR, extension not enabled (partitioned) 94subgroupPartitionedExclusiveMinNV ( f4 , parti ) ; // ERROR, extension not enabled (partitioned) 95subgroupPartitionedExclusiveMaxNV ( f4 , parti ) ; // ERROR, extension not enabled (partitioned) 96subgroupPartitionedExclusiveAndNV ( ballot , parti ) ; // ERROR, extension not enabled (partitioned) 97subgroupPartitionedExclusiveOrNV ( ballot , parti ) ; // ERROR, extension not enabled (partitioned) 98subgroupPartitionedExclusiveXorNV ( ballot , parti ) ; // ERROR, extension not enabled (partitioned) 99 100return result ; 101} 102 103#extension GL_KHR_shader_subgroup_basic : enable 104 105layout ( local_size_x = 8 , local_size_y = 8 , local_size_z = 1 ) in ; 106 107layout ( binding = 0 ) buffer Buffer 108{ 109int a [] ; 110} data ; 111 112void main () 113{ 114data . a [ gl_SubgroupSize ] = 1 ; 115data . a [ gl_SubgroupInvocationID ] = 1 ; 116data . a [ gl_NumSubgroups ] = 1 ; 117data . a [ gl_SubgroupID ] = ( subgroupElect ()) ? 1 : 0 ; 118subgroupBarrier () ; 119subgroupMemoryBarrier () ; 120subgroupMemoryBarrierBuffer () ; 121subgroupMemoryBarrierShared () ; 122subgroupMemoryBarrierImage () ; 123} 124 125#extension GL_KHR_shader_subgroup_ballot : enable 126void ballot_works ( vec4 f4 ) { 127gl_SubgroupEqMask ; 128gl_SubgroupGeMask ; 129gl_SubgroupGtMask ; 130gl_SubgroupLeMask ; 131gl_SubgroupLtMask ; 132subgroupBroadcast ( f4 , 0 ) ; 133subgroupBroadcastFirst ( f4 ) ; 134uvec4 ballot = subgroupBallot ( false ) ; 135subgroupInverseBallot ( uvec4 ( 0x1 )) ; 136subgroupBallotBitExtract ( ballot , 0 ) ; 137subgroupBallotBitCount ( ballot ) ; 138subgroupBallotInclusiveBitCount ( ballot ) ; 139subgroupBallotExclusiveBitCount ( ballot ) ; 140subgroupBallotFindLSB ( ballot ) ; 141subgroupBallotFindMSB ( ballot ) ; 142} 143 144#extension GL_KHR_shader_subgroup_vote : enable 145void vote_works ( vec4 f4 ) 146{ 147subgroupAll ( true ) ; 148subgroupAny ( false ) ; 149subgroupAllEqual ( f4 ) ; 150} 151 152#extension GL_KHR_shader_subgroup_shuffle : enable 153#extension GL_KHR_shader_subgroup_shuffle_relative : enable 154void shuffle_works ( vec4 f4 ) 155{ 156subgroupShuffle ( f4 , 0 ) ; 157subgroupShuffleXor ( f4 , 0x1 ) ; 158subgroupShuffleUp ( f4 , 1 ) ; 159subgroupShuffleDown ( f4 , 1 ) ; 160} 161 162#extension GL_KHR_shader_subgroup_arithmetic : enable 163void arith_works ( vec4 f4 ) 164{ 165uvec4 ballot ; 166subgroupAdd ( f4 ) ; 167subgroupMul ( f4 ) ; 168subgroupMin ( f4 ) ; 169subgroupMax ( f4 ) ; 170subgroupAnd ( ballot ) ; 171subgroupOr ( ballot ) ; 172subgroupXor ( ballot ) ; 173subgroupInclusiveAdd ( f4 ) ; 174subgroupInclusiveMul ( f4 ) ; 175subgroupInclusiveMin ( f4 ) ; 176subgroupInclusiveMax ( f4 ) ; 177subgroupInclusiveAnd ( ballot ) ; 178subgroupInclusiveOr ( ballot ) ; 179subgroupInclusiveXor ( ballot ) ; 180subgroupExclusiveAdd ( f4 ) ; 181subgroupExclusiveMul ( f4 ) ; 182subgroupExclusiveMin ( f4 ) ; 183subgroupExclusiveMax ( f4 ) ; 184subgroupExclusiveAnd ( ballot ) ; 185subgroupExclusiveOr ( ballot ) ; 186subgroupExclusiveXor ( ballot ) ; 187} 188 189#extension GL_KHR_shader_subgroup_clustered : enable 190void clustered_works ( vec4 f4 ) 191{ 192uvec4 ballot = uvec4 ( 0x55 , 0 , 0 , 0 ) ; 193subgroupClusteredAdd ( f4 , 2 ) ; 194subgroupClusteredMul ( f4 , 2 ) ; 195subgroupClusteredMin ( f4 , 2 ) ; 196subgroupClusteredMax ( f4 , 2 ) ; 197subgroupClusteredAnd ( ballot , 2 ) ; 198subgroupClusteredOr ( ballot , 2 ) ; 199subgroupClusteredXor ( ballot , 2 ) ; 200} 201 202#extension GL_KHR_shader_subgroup_quad : enable 203void quad_works ( vec4 f4 ) 204{ 205subgroupQuadBroadcast ( f4 , 0 ) ; 206subgroupQuadSwapHorizontal ( f4 ) ; 207subgroupQuadSwapVertical ( f4 ) ; 208subgroupQuadSwapDiagonal ( f4 ) ; 209} 210 211#extension GL_NV_shader_subgroup_partitioned : enable 212void partitioned_works ( vec4 f4 ) 213{ 214uvec4 parti = subgroupPartitionNV ( f4 ) ; 215uvec4 ballot = uvec4 ( 0x55 , 0 , 0 , 0 ) ; 216subgroupPartitionedAddNV ( f4 , parti ) ; 217subgroupPartitionedMulNV ( f4 , parti ) ; 218subgroupPartitionedMinNV ( f4 , parti ) ; 219subgroupPartitionedMaxNV ( f4 , parti ) ; 220subgroupPartitionedAndNV ( ballot , parti ) ; 221subgroupPartitionedOrNV ( ballot , parti ) ; 222subgroupPartitionedXorNV ( ballot , parti ) ; 223subgroupPartitionedInclusiveAddNV ( f4 , parti ) ; 224subgroupPartitionedInclusiveMulNV ( f4 , parti ) ; 225subgroupPartitionedInclusiveMinNV ( f4 , parti ) ; 226subgroupPartitionedInclusiveMaxNV ( f4 , parti ) ; 227subgroupPartitionedInclusiveAndNV ( ballot , parti ) ; 228subgroupPartitionedInclusiveOrNV ( ballot , parti ) ; 229subgroupPartitionedInclusiveXorNV ( ballot , parti ) ; 230subgroupPartitionedExclusiveAddNV ( f4 , parti ) ; 231subgroupPartitionedExclusiveMulNV ( f4 , parti ) ; 232subgroupPartitionedExclusiveMinNV ( f4 , parti ) ; 233subgroupPartitionedExclusiveMaxNV ( f4 , parti ) ; 234subgroupPartitionedExclusiveAndNV ( ballot , parti ) ; 235subgroupPartitionedExclusiveOrNV ( ballot , parti ) ; 236subgroupPartitionedExclusiveXorNV ( ballot , parti ) ; 237} 238 239// tests for NV_shader_sm_builtins 240void sm_builtins_err () 241{ 242gl_WarpsPerSMNV ; // ERROR, no extension 243gl_SMCountNV ; // ERROR, no extension 244gl_WarpIDNV ; // ERROR, no extension 245gl_SMIDNV ; // ERROR, no extension 246} 247 248#ifdef GL_NV_shader_sm_builtins 249#extension GL_NV_shader_sm_builtins : enable 250#endif 251 252void sm_builtins () 253{ 254gl_WarpsPerSMNV ; 255gl_SMCountNV ; 256gl_WarpIDNV ; 257gl_SMIDNV ; 258}