yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
9866ad91
16.6.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, only defined in compute 14gl_SubgroupID ; // ERROR, only defined in compute 15subgroupMemoryBarrierShared () ; // ERROR, only defined in compute 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 104layout ( points ) in ; 105layout ( points , max_vertices = 1 ) out ; 106layout ( set = 0 , binding = 0 , std430 ) buffer Output 107{ 108uvec4 result [] ; 109} ; 110 111void main ( void ) 112{ 113result [ gl_PrimitiveIDIn ] = uvec4 ( gl_SubgroupSize , gl_SubgroupInvocationID , 0 , 0 ) ; 114subgroupBarrier () ; 115subgroupMemoryBarrier () ; 116subgroupMemoryBarrierBuffer () ; 117subgroupMemoryBarrierImage () ; 118subgroupElect () ; 119} 120 121#extension GL_KHR_shader_subgroup_ballot : enable 122void ballot_works ( vec4 f4 ) { 123gl_SubgroupEqMask ; 124gl_SubgroupGeMask ; 125gl_SubgroupGtMask ; 126gl_SubgroupLeMask ; 127gl_SubgroupLtMask ; 128subgroupBroadcast ( f4 , 0 ) ; 129subgroupBroadcastFirst ( f4 ) ; 130uvec4 ballot = subgroupBallot ( false ) ; 131subgroupInverseBallot ( uvec4 ( 0x1 )) ; 132subgroupBallotBitExtract ( ballot , 0 ) ; 133subgroupBallotBitCount ( ballot ) ; 134subgroupBallotInclusiveBitCount ( ballot ) ; 135subgroupBallotExclusiveBitCount ( ballot ) ; 136subgroupBallotFindLSB ( ballot ) ; 137subgroupBallotFindMSB ( ballot ) ; 138} 139 140#extension GL_KHR_shader_subgroup_vote : enable 141void vote_works ( vec4 f4 ) 142{ 143subgroupAll ( true ) ; 144subgroupAny ( false ) ; 145subgroupAllEqual ( f4 ) ; 146} 147 148#extension GL_KHR_shader_subgroup_shuffle : enable 149#extension GL_KHR_shader_subgroup_shuffle_relative : enable 150void shuffle_works ( vec4 f4 ) 151{ 152subgroupShuffle ( f4 , 0 ) ; 153subgroupShuffleXor ( f4 , 0x1 ) ; 154subgroupShuffleUp ( f4 , 1 ) ; 155subgroupShuffleDown ( f4 , 1 ) ; 156} 157 158#extension GL_KHR_shader_subgroup_arithmetic : enable 159void arith_works ( vec4 f4 ) 160{ 161uvec4 ballot ; 162subgroupAdd ( f4 ) ; 163subgroupMul ( f4 ) ; 164subgroupMin ( f4 ) ; 165subgroupMax ( f4 ) ; 166subgroupAnd ( ballot ) ; 167subgroupOr ( ballot ) ; 168subgroupXor ( ballot ) ; 169subgroupInclusiveAdd ( f4 ) ; 170subgroupInclusiveMul ( f4 ) ; 171subgroupInclusiveMin ( f4 ) ; 172subgroupInclusiveMax ( f4 ) ; 173subgroupInclusiveAnd ( ballot ) ; 174subgroupInclusiveOr ( ballot ) ; 175subgroupInclusiveXor ( ballot ) ; 176subgroupExclusiveAdd ( f4 ) ; 177subgroupExclusiveMul ( f4 ) ; 178subgroupExclusiveMin ( f4 ) ; 179subgroupExclusiveMax ( f4 ) ; 180subgroupExclusiveAnd ( ballot ) ; 181subgroupExclusiveOr ( ballot ) ; 182subgroupExclusiveXor ( ballot ) ; 183} 184 185#extension GL_KHR_shader_subgroup_clustered : enable 186void clustered_works ( vec4 f4 ) 187{ 188uvec4 ballot = uvec4 ( 0x55 , 0 , 0 , 0 ) ; 189subgroupClusteredAdd ( f4 , 2 ) ; 190subgroupClusteredMul ( f4 , 2 ) ; 191subgroupClusteredMin ( f4 , 2 ) ; 192subgroupClusteredMax ( f4 , 2 ) ; 193subgroupClusteredAnd ( ballot , 2 ) ; 194subgroupClusteredOr ( ballot , 2 ) ; 195subgroupClusteredXor ( ballot , 2 ) ; 196} 197 198#extension GL_KHR_shader_subgroup_quad : enable 199void quad_works ( vec4 f4 ) 200{ 201subgroupQuadBroadcast ( f4 , 0 ) ; 202subgroupQuadSwapHorizontal ( f4 ) ; 203subgroupQuadSwapVertical ( f4 ) ; 204subgroupQuadSwapDiagonal ( f4 ) ; 205} 206 207#extension GL_NV_shader_subgroup_partitioned : enable 208void partitioned_works ( vec4 f4 ) 209{ 210uvec4 parti = subgroupPartitionNV ( f4 ) ; 211uvec4 ballot = uvec4 ( 0x55 , 0 , 0 , 0 ) ; 212subgroupPartitionedAddNV ( f4 , parti ) ; 213subgroupPartitionedMulNV ( f4 , parti ) ; 214subgroupPartitionedMinNV ( f4 , parti ) ; 215subgroupPartitionedMaxNV ( f4 , parti ) ; 216subgroupPartitionedAndNV ( ballot , parti ) ; 217subgroupPartitionedOrNV ( ballot , parti ) ; 218subgroupPartitionedXorNV ( ballot , parti ) ; 219subgroupPartitionedInclusiveAddNV ( f4 , parti ) ; 220subgroupPartitionedInclusiveMulNV ( f4 , parti ) ; 221subgroupPartitionedInclusiveMinNV ( f4 , parti ) ; 222subgroupPartitionedInclusiveMaxNV ( f4 , parti ) ; 223subgroupPartitionedInclusiveAndNV ( ballot , parti ) ; 224subgroupPartitionedInclusiveOrNV ( ballot , parti ) ; 225subgroupPartitionedInclusiveXorNV ( ballot , parti ) ; 226subgroupPartitionedExclusiveAddNV ( f4 , parti ) ; 227subgroupPartitionedExclusiveMulNV ( f4 , parti ) ; 228subgroupPartitionedExclusiveMinNV ( f4 , parti ) ; 229subgroupPartitionedExclusiveMaxNV ( f4 , parti ) ; 230subgroupPartitionedExclusiveAndNV ( ballot , parti ) ; 231subgroupPartitionedExclusiveOrNV ( ballot , parti ) ; 232subgroupPartitionedExclusiveXorNV ( ballot , parti ) ; 233} 234 235// tests for NV_shader_sm_builtins 236void sm_builtins_err () 237{ 238gl_WarpsPerSMNV ; // ERROR, no extension 239gl_SMCountNV ; // ERROR, no extension 240gl_WarpIDNV ; // ERROR, no extension 241gl_SMIDNV ; // ERROR, no extension 242} 243 244#ifdef GL_NV_shader_sm_builtins 245#extension GL_NV_shader_sm_builtins : enable 246#endif 247 248void sm_builtins () 249{ 250gl_WarpsPerSMNV ; 251gl_SMCountNV ; 252gl_WarpIDNV ; 253gl_SMIDNV ; 254}