yum-mirror/glslang
git clone https://git.yummers.dev/yum-mirror/glslang
714e58b2
16.4.0
1float VertexShaderFunctionS ( float inF0 , float inF1 , float inF2 , uint inU0 , uint inU1 ) 2{ 3all ( inF0 ) ; 4abs ( inF0 ) ; 5acos ( inF0 ) ; 6any ( inF0 ) ; 7asin ( inF0 ) ; 8asint ( inF0 ) ; 9asuint ( inF0 ) ; 10asfloat ( inU0 ) ; 11// asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics 12atan ( inF0 ) ; 13atan2 ( inF0 , inF1 ) ; 14ceil ( inF0 ) ; 15clamp ( inF0 , inF1 , inF2 ) ; 16cos ( inF0 ) ; 17cosh ( inF0 ) ; 18countbits ( 7 ) ; 19degrees ( inF0 ) ; 20// EvaluateAttributeAtCentroid(inF0); 21// EvaluateAttributeAtSample(inF0, 0); 22// TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); 23exp ( inF0 ) ; 24exp2 ( inF0 ) ; 25firstbithigh ( 7 ) ; 26firstbitlow ( 7 ) ; 27floor ( inF0 ) ; 28// TODO: fma(inD0, inD1, inD2); 29fmod ( inF0 , inF1 ) ; 30frac ( inF0 ) ; 31isinf ( inF0 ) ; 32isnan ( inF0 ) ; 33ldexp ( inF0 , inF1 ) ; 34lerp ( inF0 , inF1 , inF2 ) ; 35log ( inF0 ) ; 36log10 ( inF0 ) ; 37log2 ( inF0 ) ; 38max ( inF0 , inF1 ) ; 39min ( inF0 , inF1 ) ; 40// TODO: mul(inF0, inF1); 41pow ( inF0 , inF1 ) ; 42radians ( inF0 ) ; 43reversebits ( 2 ) ; 44round ( inF0 ) ; 45rsqrt ( inF0 ) ; 46saturate ( inF0 ) ; 47sign ( inF0 ) ; 48sin ( inF0 ) ; 49sincos ( inF0 , inF1 , inF2 ) ; 50sinh ( inF0 ) ; 51smoothstep ( inF0 , inF1 , inF2 ) ; 52sqrt ( inF0 ) ; 53step ( inF0 , inF1 ) ; 54tan ( inF0 ) ; 55tanh ( inF0 ) ; 56// TODO: sampler intrinsics, when we can declare the types. 57trunc ( inF0 ) ; 58 59return 0.0 ; 60} 61 62float1 VertexShaderFunction1 ( float1 inF0 , float1 inF1 , float1 inF2 ) 63{ 64// TODO: ... add when float1 prototypes are generated 65return 0.0 ; 66} 67 68float2 VertexShaderFunction2 ( float2 inF0 , float2 inF1 , float2 inF2 , uint2 inU0 , uint2 inU1 ) 69{ 70all ( inF0 ) ; 71abs ( inF0 ) ; 72acos ( inF0 ) ; 73any ( inF0 ) ; 74asin ( inF0 ) ; 75asint ( inF0 ) ; 76asuint ( inF0 ) ; 77asfloat ( inU0 ) ; 78// asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics 79atan ( inF0 ) ; 80atan2 ( inF0 , inF1 ) ; 81ceil ( inF0 ) ; 82clamp ( inF0 , inF1 , inF2 ) ; 83cos ( inF0 ) ; 84cosh ( inF0 ) ; 85countbits ( int2 ( 7 , 3 )) ; 86degrees ( inF0 ) ; 87distance ( inF0 , inF1 ) ; 88dot ( inF0 , inF1 ) ; 89// EvaluateAttributeAtCentroid(inF0); 90// EvaluateAttributeAtSample(inF0, 0); 91// TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); 92exp ( inF0 ) ; 93exp2 ( inF0 ) ; 94faceforward ( inF0 , inF1 , inF2 ) ; 95firstbithigh ( 7 ) ; 96firstbitlow ( 7 ) ; 97floor ( inF0 ) ; 98// TODO: fma(inD0, inD1, inD2); 99fmod ( inF0 , inF1 ) ; 100frac ( inF0 ) ; 101isinf ( inF0 ) ; 102isnan ( inF0 ) ; 103ldexp ( inF0 , inF1 ) ; 104lerp ( inF0 , inF1 , inF2 ) ; 105length ( inF0 ) ; 106log ( inF0 ) ; 107log10 ( inF0 ) ; 108log2 ( inF0 ) ; 109max ( inF0 , inF1 ) ; 110min ( inF0 , inF1 ) ; 111// TODO: mul(inF0, inF1); 112normalize ( inF0 ) ; 113pow ( inF0 , inF1 ) ; 114radians ( inF0 ) ; 115reflect ( inF0 , inF1 ) ; 116refract ( inF0 , inF1 , 2.0 ) ; 117reversebits ( int2 ( 1 , 2 )) ; 118round ( inF0 ) ; 119rsqrt ( inF0 ) ; 120saturate ( inF0 ) ; 121sign ( inF0 ) ; 122sin ( inF0 ) ; 123sincos ( inF0 , inF1 , inF2 ) ; 124sinh ( inF0 ) ; 125smoothstep ( inF0 , inF1 , inF2 ) ; 126sqrt ( inF0 ) ; 127step ( inF0 , inF1 ) ; 128tan ( inF0 ) ; 129tanh ( inF0 ) ; 130// TODO: sampler intrinsics, when we can declare the types. 131trunc ( inF0 ) ; 132 133// TODO: ... add when float1 prototypes are generated 134return float2 ( 1 , 2 ) ; 135} 136 137float3 VertexShaderFunction3 ( float3 inF0 , float3 inF1 , float3 inF2 , uint3 inU0 , uint3 inU1 ) 138{ 139all ( inF0 ) ; 140abs ( inF0 ) ; 141acos ( inF0 ) ; 142any ( inF0 ) ; 143asin ( inF0 ) ; 144asint ( inF0 ) ; 145asuint ( inF0 ) ; 146asfloat ( inU0 ) ; 147// asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics 148atan ( inF0 ) ; 149atan2 ( inF0 , inF1 ) ; 150ceil ( inF0 ) ; 151clamp ( inF0 , inF1 , inF2 ) ; 152cos ( inF0 ) ; 153cosh ( inF0 ) ; 154countbits ( int3 ( 7 , 3 , 5 )) ; 155cross ( inF0 , inF1 ) ; 156degrees ( inF0 ) ; 157distance ( inF0 , inF1 ) ; 158dot ( inF0 , inF1 ) ; 159// EvaluateAttributeAtCentroid(inF0); 160// EvaluateAttributeAtSample(inF0, 0); 161// TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); 162exp ( inF0 ) ; 163exp2 ( inF0 ) ; 164faceforward ( inF0 , inF1 , inF2 ) ; 165firstbithigh ( 7 ) ; 166firstbitlow ( 7 ) ; 167floor ( inF0 ) ; 168// TODO: fma(inD0, inD1, inD2); 169fmod ( inF0 , inF1 ) ; 170frac ( inF0 ) ; 171isinf ( inF0 ) ; 172isnan ( inF0 ) ; 173ldexp ( inF0 , inF1 ) ; 174lerp ( inF0 , inF1 , inF2 ) ; 175length ( inF0 ) ; 176log ( inF0 ) ; 177log10 ( inF0 ) ; 178log2 ( inF0 ) ; 179max ( inF0 , inF1 ) ; 180min ( inF0 , inF1 ) ; 181// TODO: mul(inF0, inF1); 182normalize ( inF0 ) ; 183pow ( inF0 , inF1 ) ; 184radians ( inF0 ) ; 185reflect ( inF0 , inF1 ) ; 186refract ( inF0 , inF1 , 2.0 ) ; 187reversebits ( int3 ( 1 , 2 , 3 )) ; 188round ( inF0 ) ; 189rsqrt ( inF0 ) ; 190saturate ( inF0 ) ; 191sign ( inF0 ) ; 192sin ( inF0 ) ; 193sincos ( inF0 , inF1 , inF2 ) ; 194sinh ( inF0 ) ; 195smoothstep ( inF0 , inF1 , inF2 ) ; 196sqrt ( inF0 ) ; 197step ( inF0 , inF1 ) ; 198tan ( inF0 ) ; 199tanh ( inF0 ) ; 200// TODO: sampler intrinsics, when we can declare the types. 201trunc ( inF0 ) ; 202 203// TODO: ... add when float1 prototypes are generated 204return float3 ( 1 , 2 , 3 ) ; 205} 206 207float4 VertexShaderFunction4 ( float4 inF0 , float4 inF1 , float4 inF2 , uint4 inU0 , uint4 inU1 ) 208{ 209all ( inF0 ) ; 210abs ( inF0 ) ; 211acos ( inF0 ) ; 212any ( inF0 ) ; 213asin ( inF0 ) ; 214asint ( inF0 ) ; 215asuint ( inF0 ) ; 216asfloat ( inU0 ) ; 217// asdouble(inU0, inU1); // TODO: enable when HLSL parser used for intrinsics 218atan ( inF0 ) ; 219atan2 ( inF0 , inF1 ) ; 220ceil ( inF0 ) ; 221clamp ( inF0 , inF1 , inF2 ) ; 222cos ( inF0 ) ; 223cosh ( inF0 ) ; 224countbits ( int4 ( 7 , 3 , 5 , 2 )) ; 225degrees ( inF0 ) ; 226distance ( inF0 , inF1 ) ; 227dot ( inF0 , inF1 ) ; 228dst ( inF0 , inF1 ) ; 229// EvaluateAttributeAtCentroid(inF0); 230// EvaluateAttributeAtSample(inF0, 0); 231// TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); 232exp ( inF0 ) ; 233exp2 ( inF0 ) ; 234faceforward ( inF0 , inF1 , inF2 ) ; 235firstbithigh ( 7 ) ; 236firstbitlow ( 7 ) ; 237floor ( inF0 ) ; 238// TODO: fma(inD0, inD1, inD2); 239fmod ( inF0 , inF1 ) ; 240frac ( inF0 ) ; 241isinf ( inF0 ) ; 242isnan ( inF0 ) ; 243ldexp ( inF0 , inF1 ) ; 244lerp ( inF0 , inF1 , inF2 ) ; 245length ( inF0 ) ; 246log ( inF0 ) ; 247log10 ( inF0 ) ; 248log2 ( inF0 ) ; 249max ( inF0 , inF1 ) ; 250min ( inF0 , inF1 ) ; 251// TODO: mul(inF0, inF1); 252normalize ( inF0 ) ; 253pow ( inF0 , inF1 ) ; 254radians ( inF0 ) ; 255reflect ( inF0 , inF1 ) ; 256refract ( inF0 , inF1 , 2.0 ) ; 257reversebits ( int4 ( 1 , 2 , 3 , 4 )) ; 258round ( inF0 ) ; 259rsqrt ( inF0 ) ; 260saturate ( inF0 ) ; 261sign ( inF0 ) ; 262sin ( inF0 ) ; 263sincos ( inF0 , inF1 , inF2 ) ; 264sinh ( inF0 ) ; 265smoothstep ( inF0 , inF1 , inF2 ) ; 266sqrt ( inF0 ) ; 267step ( inF0 , inF1 ) ; 268tan ( inF0 ) ; 269tanh ( inF0 ) ; 270// TODO: sampler intrinsics, when we can declare the types. 271trunc ( inF0 ) ; 272 273// TODO: ... add when float1 prototypes are generated 274return float4 ( 1 , 2 , 3 , 4 ) ; 275} 276 277// TODO: for mats: 278// asfloat(inU0); \ 279// asint(inF0); \ 280// asuint(inF0); \ 281 282// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. 283#define MATFNS () \ 284all ( inF0 ) ; \ 285abs ( inF0 ) ; \ 286acos ( inF0 ) ; \ 287any ( inF0 ) ; \ 288asin ( inF0 ) ; \ 289atan ( inF0 ) ; \ 290atan2 ( inF0 , inF1 ) ; \ 291ceil ( inF0 ) ; \ 292clamp ( inF0 , inF1 , inF2 ) ; \ 293cos ( inF0 ) ; \ 294cosh ( inF0 ) ; \ 295degrees ( inF0 ) ; \ 296determinant ( inF0 ) ; \ 297exp ( inF0 ) ; \ 298exp2 ( inF0 ) ; \ 299firstbithigh ( 7 ) ; \ 300firstbitlow ( 7 ) ; \ 301floor ( inF0 ) ; \ 302fmod ( inF0 , inF1 ) ; \ 303frac ( inF0 ) ; \ 304ldexp ( inF0 , inF1 ) ; \ 305lerp ( inF0 , inF1 , inF2 ) ; \ 306log ( inF0 ) ; \ 307log10 ( inF0 ) ; \ 308log2 ( inF0 ) ; \ 309max ( inF0 , inF1 ) ; \ 310min ( inF0 , inF1 ) ; \ 311pow ( inF0 , inF1 ) ; \ 312radians ( inF0 ) ; \ 313round ( inF0 ) ; \ 314rsqrt ( inF0 ) ; \ 315saturate ( inF0 ) ; \ 316sign ( inF0 ) ; \ 317sin ( inF0 ) ; \ 318sincos ( inF0 , inF1 , inF2 ) ; \ 319sinh ( inF0 ) ; \ 320smoothstep ( inF0 , inF1 , inF2 ) ; \ 321sqrt ( inF0 ) ; \ 322step ( inF0 , inF1 ) ; \ 323tan ( inF0 ) ; \ 324tanh ( inF0 ) ; \ 325transpose ( inF0 ) ; \ 326trunc ( inF0 ) ; 327 328// TODO: turn on non-square matrix tests when protos are available. 329 330float2x2 VertexShaderFunction2x2 ( float2x2 inF0 , float2x2 inF1 , float2x2 inF2 ) 331{ 332// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. 333MATFNS () ; 334 335// TODO: ... add when float1 prototypes are generated 336return float2x2 ( 2 , 2 , 2 , 2 ) ; 337} 338 339float3x3 VertexShaderFunction3x3 ( float3x3 inF0 , float3x3 inF1 , float3x3 inF2 ) 340{ 341// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. 342MATFNS () ; 343 344// TODO: ... add when float1 prototypes are generated 345return float3x3 ( 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 , 3 ) ; 346} 347 348float4x4 VertexShaderFunction4x4 ( float4x4 inF0 , float4x4 inF1 , float4x4 inF2 ) 349{ 350// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. 351MATFNS () ; 352 353// TODO: ... add when float1 prototypes are generated 354return float4x4 ( 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 ) ; 355} 356 357#define TESTGENMUL ( ST , VT , MT ) \ 358ST r0 = mul ( inF0 , inF1 ) ; \ 359VT r1 = mul ( inFV0 , inF0 ) ; \ 360VT r2 = mul ( inF0 , inFV0 ) ; \ 361ST r3 = mul ( inFV0 , inFV1 ) ; \ 362VT r4 = mul ( inFM0 , inFV0 ) ; \ 363VT r5 = mul ( inFV0 , inFM0 ) ; \ 364MT r6 = mul ( inFM0 , inF0 ) ; \ 365MT r7 = mul ( inF0 , inFM0 ) ; \ 366MT r8 = mul ( inFM0 , inFM1 ) ; 367 368 369void TestGenMul2 ( float inF0 , float inF1 , 370float2 inFV0 , float2 inFV1 , 371float2x2 inFM0 , float2x2 inFM1 ) 372{ 373TESTGENMUL ( float , float2 , float2x2 ) ; 374} 375 376void TestGenMul3 ( float inF0 , float inF1 , 377float3 inFV0 , float3 inFV1 , 378float3x3 inFM0 , float3x3 inFM1 ) 379{ 380TESTGENMUL ( float , float3 , float3x3 ) ; 381} 382 383void TestGenMul4 ( float inF0 , float inF1 , 384float4 inFV0 , float4 inFV1 , 385float4x4 inFM0 , float4x4 inFM1 ) 386{ 387TESTGENMUL ( float , float4 , float4x4 ) ; 388} 389 390// Test some non-square mats 391void TestGenMulNxM ( float inF0 , float inF1 , 392float2 inFV2 , float3 inFV3 , 393float2x3 inFM2x3 , float3x2 inFM3x2 , 394float3x3 inFM3x3 , float3x4 inFM3x4 , 395float2x4 inFM2x4 ) 396{ 397float r00 = mul ( inF0 , inF1 ) ; // S=S*S 398float2 r01 = mul ( inFV2 , inF0 ) ; // V=V*S 399float3 r02 = mul ( inFV3 , inF0 ) ; // V=V*S 400float2 r03 = mul ( inF0 , inFV2 ) ; // V=S*V 401float3 r04 = mul ( inF0 , inFV3 ) ; // V=S*V 402float r05 = mul ( inFV2 , inFV2 ) ; // S=V*V 403float r06 = mul ( inFV3 , inFV3 ) ; // S=V*V 404float3 r07 = mul ( inFV2 , inFM2x3 ) ; // V=V*M (return V dim is Mcols) 405float2 r08 = mul ( inFV3 , inFM3x2 ) ; // V=V*M (return V dim is Mcols) 406float2 r09 = mul ( inFM2x3 , inFV3 ) ; // V=M*V (return V dim is Mrows) 407float3 r10 = mul ( inFM3x2 , inFV2 ) ; // V=M*V (return V dim is Mrows) 408float2x3 r11 = mul ( inFM2x3 , inF0 ) ; 409float3x2 r12 = mul ( inFM3x2 , inF0 ) ; 410float2x2 r13 = mul ( inFM2x3 , inFM3x2 ) ; 411float2x3 r14 = mul ( inFM2x3 , inFM3x3 ) ; 412float2x4 r15 = mul ( inFM2x3 , inFM3x4 ) ; 413float3x4 r16 = mul ( inFM3x2 , inFM2x4 ) ; 414}