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