Home | History | Annotate | Download | only in sksl
      1 STRINGIFY(
      2 
      3 // defines built-in functions supported by SkiaSL
      4 
      5 $genType radians($genType degrees);
      6 $genType sin($genType angle);
      7 $genType cos($genType angle);
      8 $genType tan($genType angle);
      9 $genType asin($genType x);
     10 $genType acos($genType x);
     11 $genType atan($genType y, $genType x);
     12 $genType atan($genType y_over_x);
     13 $genType sinh($genType x);
     14 $genType cosh($genType x);
     15 $genType tanh($genType x);
     16 $genType asinh($genType x);
     17 $genType acosh($genType x);
     18 $genType atanh($genType x);
     19 $genType pow($genType x, $genType y);
     20 $genType exp($genType x);
     21 $genType log($genType x);
     22 $genType exp2($genType x);
     23 $genType log2($genType x);
     24 $genType sqrt($genType x);
     25 //$genDType sqrt($genDType x);
     26 $genType inversesqrt($genType x);
     27 //$genDType inversesqrt($genDType x);
     28 $genType abs($genType x);
     29 $genIType abs($genIType x);
     30 //$genDType abs($genDType x);
     31 $genType sign($genType x);
     32 $genIType sign($genIType x);
     33 //$genDType sign($genDType x);
     34 $genType floor($genType x);
     35 //$genDType floor($genDType x);
     36 $genType trunc($genType x);
     37 //$genDType trunc($genDType x);
     38 $genType round($genType x);
     39 //$genDType round($genDType x);
     40 $genType roundEven($genType x);
     41 //$genDType roundEven($genDType x);
     42 $genType ceil($genType x);
     43 //$genDType ceil($genDType x);
     44 $genType fract($genType x);
     45 //$genDType fract($genDType x);
     46 $genType mod($genType x, float y);
     47 $genType mod($genType x, $genType y);
     48 //$genDType mod($genDType x, double y);
     49 //$genDType mod($genDType x, $genDType y);
     50 $genType modf($genType x, out $genType i);
     51 //$genDType modf($genDType x, out $genDType i);
     52 $genType min($genType x, $genType y);
     53 $genType min($genType x, float y);
     54 //$genDType min($genDType x, $genDType y);
     55 //$genDType min($genDType x, double y);
     56 $genIType min($genIType x, $genIType y);
     57 $genIType min($genIType x, int y);
     58 //$genUType min($genUType x, $genUType y);
     59 //$genUType min($genUType x, uint y);
     60 $genType max($genType x, $genType y);
     61 $genType max($genType x, float y);
     62 //$genDType max($genDType x, $genDType y);
     63 //$genDType max($genDType x, double y);
     64 $genIType max($genIType x, $genIType y);
     65 $genIType max($genIType x, int y);
     66 //$genUType max($genUType x, $genUType y);
     67 //$genUType max($genUType x, uint y);
     68 $genType clamp($genType x, $genType minVal, $genType maxVal);
     69 $genType clamp($genType x, float minVal, float maxVal);
     70 //$genDType clamp($genDType x, $genDType minVal, $genDType maxVal);
     71 //$genDType clamp($genDType x, double minVal, double maxVal);
     72 $genIType clamp($genIType x, $genIType minVal, $genIType maxVal);
     73 $genIType clamp($genIType x, int minVal, int maxVal);
     74 //$genUType clamp($genUType x, $genUType minVal, $genUType maxVal);
     75 //$genUType clamp($genUType x, uint minVal, uint maxVal);
     76 $genType mix($genType x, $genType y, $genType a);
     77 $genType mix($genType x, $genType y, float a);
     78 //$genDType mix($genDType x, $genDType y, $genDType a);
     79 //$genDType mix($genDType x, $genDType y, double a);
     80 $genType mix($genType x, $genType y, $genBType a);
     81 //$genDType mix($genDType x, $genDType y, $genBType a);
     82 $genIType mix($genIType x, $genIType y, $genBType a);
     83 //$genUType mix($genUType x, $genUType y, $genBType a);
     84 $genBType mix($genBType x, $genBType y, $genBType a);
     85 $genType step($genType edge, $genType x);
     86 $genType step(float edge, $genType x);
     87 //$genDType step($genDType edge, $genDType x);
     88 //$genDType step(double edge, $genDType x);
     89 $genType smoothstep($genType edge0, $genType edge1, $genType x);
     90 $genType smoothstep(float edge0, float edge1, $genType x);
     91 //$genDType smoothstep($genDType edge0, $genDType edge1, $genDType x);
     92 //$genDType smoothstep(double edge0, double edge1, $genDType x);
     93 $genBType isnan($genType x);
     94 $genBType isnan($genDType x);
     95 $genBType isinf($genType x);
     96 $genBType isinf($genDType x);
     97 $genIType floatBitsToInt($genType value);
     98 //$genUType floatBitsToUint($genType value);
     99 $genType intBitsTofloat($genIType value);
    100 $genType uintBitsTofloat($genUType value);
    101 $genType fma($genType a, $genType b, $genType c);
    102 $genHType fma($genHType a, $genHType b, $genHType c);
    103 $genDType fma($genDType a, $genDType b, $genDType c);
    104 //$genDType fma($genDType a, $genDType b, $genDType c);
    105 $genType frexp($genType x, out $genIType exp);
    106 //$genDType frexp($genDType x, out $genIType exp);
    107 $genType ldexp($genType x, in $genIType exp);
    108 //$genDType ldexp($genDType x, in $genIType exp);
    109 uint packUnorm2x16(float2 v);
    110 uint packSnorm2x16(float2 v);
    111 uint packUnorm4x8(float4 v);
    112 uint packSnorm4x8(float4 v);
    113 float2 unpackUnorm2x16(uint p);
    114 float2 unpackSnorm2x16(uint p);
    115 float4 unpackUnorm4x8(uint p);
    116 float4 unpackSnorm4x8(uint p);
    117 //double packDouble2x32(uint2 v);
    118 uint2 unpackDouble2x32(double v);
    119 uint packHalf2x16(float2 v);
    120 float2 unpackHalf2x16(uint v);
    121 float length($genType x);
    122 half length($genHType x);
    123 double length($genDType x);
    124 float distance($genType p0, $genType p1);
    125 half distance($genHType p0, $genHType p1);
    126 double distance($genDType p0, $genDType p1);
    127 float dot($genType x, $genType y);
    128 half dot($genHType x, $genHType y);
    129 double dot($genDType x, $genDType y);
    130 float3 cross(float3 x, float3 y);
    131 half3 cross(half3 x, half3 y);
    132 double3 cross(double3 x, double3 y);
    133 $genType normalize($genType x);
    134 $genHType normalize($genHType x);
    135 $genDType normalize($genDType x);
    136 float4 ftransform();
    137 $genType faceforward($genType N, $genType I, $genType Nref);
    138 $genHType faceforward($genHType N, $genHType I, $genHType Nref);
    139 $genDType faceforward($genDType N, $genDType I, $genDType Nref);
    140 $genType reflect($genType I, $genType N);
    141 $genHType reflect($genHType I, $genHType N);
    142 $genDType reflect($genDType I, $genDType N);
    143 $genType refract($genType I, $genType N, float eta);
    144 $genHType refract($genHType I, $genHType N, float eta);
    145 $genDType refract($genDType I, $genDType N, float eta);
    146 $mat matrixCompMult($mat x, $mat y);
    147 float2x2 outerProduct(float2 c, float2 r);
    148 float3x3 outerProduct(float3 c, float3 r);
    149 float4x3 outerProduct(float4 c, float4 r);
    150 float2x3 outerProduct(float3 c, float2 r);
    151 float3x2 outerProduct(float2 c, float3 r);
    152 float2x4 outerProduct(float4 c, float2 r);
    153 float4x2 outerProduct(float2 c, float4 r);
    154 float3x4 outerProduct(float4 c, float3 r);
    155 float4x3 outerProduct(float3 c, float4 r);
    156 float2x2 transpose(float2x2 m);
    157 float3x3 transpose(float3x3 m);
    158 float4x4 transpose(float4x4 m);
    159 float2x3 transpose(float3x2 m);
    160 float3x2 transpose(float2x3 m);
    161 float2x4 transpose(float4x2 m);
    162 float4x2 transpose(float2x4 m);
    163 float3x4 transpose(float4x3 m);
    164 float4x3 transpose(float3x4 m);
    165 float determinant(float2x2 m);
    166 float determinant(float3x3 m);
    167 float determinant(float4x4 m);
    168 float2x2 inverse(float2x2 m);
    169 float3x3 inverse(float3x3 m);
    170 float4x4 inverse(float4x4 m);
    171 $bvec lessThan($vec x, $vec y);
    172 $bvec lessThan($hvec x, $hvec y);
    173 $bvec lessThan($dvec x, $dvec y);
    174 $bvec lessThan($ivec x, $ivec y);
    175 $bvec lessThan($svec x, $svec y);
    176 $bvec lessThan($usvec x, $usvec y);
    177 $bvec lessThan($uvec x, $uvec y);
    178 $bvec lessThanEqual($vec x, $vec y);
    179 $bvec lessThanEqual($hvec x, $hvec y);
    180 $bvec lessThanEqual($dvec x, $dvec y);
    181 $bvec lessThanEqual($ivec x, $ivec y);
    182 $bvec lessThanEqual($uvec x, $uvec y);
    183 $bvec lessThanEqual($svec x, $svec y);
    184 $bvec lessThanEqual($usvec x, $usvec y);
    185 $bvec greaterThan($vec x, $vec y);
    186 $bvec greaterThan($hvec x, $hvec y);
    187 $bvec greaterThan($dvec x, $dvec y);
    188 $bvec greaterThan($ivec x, $ivec y);
    189 $bvec greaterThan($uvec x, $uvec y);
    190 $bvec greaterThan($svec x, $svec y);
    191 $bvec greaterThan($usvec x, $usvec y);
    192 $bvec greaterThanEqual($vec x, $vec y);
    193 $bvec greaterThanEqual($hvec x, $hvec y);
    194 $bvec greaterThanEqual($dvec x, $dvec y);
    195 $bvec greaterThanEqual($ivec x, $ivec y);
    196 $bvec greaterThanEqual($uvec x, $uvec y);
    197 $bvec greaterThanEqual($svec x, $svec y);
    198 $bvec greaterThanEqual($usvec x, $usvec y);
    199 $bvec equal($vec x, $vec y);
    200 $bvec equal($hvec x, $hvec y);
    201 $bvec equal($dvec x, $dvec y);
    202 $bvec equal($ivec x, $ivec y);
    203 $bvec equal($uvec x, $uvec y);
    204 $bvec equal($svec x, $svec y);
    205 $bvec equal($usvec x, $usvec y);
    206 $bvec equal($bvec x, $bvec y);
    207 $bvec notEqual($vec x, $vec y);
    208 $bvec notEqual($hvec x, $hvec y);
    209 $bvec notEqual($dvec x, $dvec y);
    210 $bvec notEqual($ivec x, $ivec y);
    211 $bvec notEqual($uvec x, $uvec y);
    212 $bvec notEqual($svec x, $svec y);
    213 $bvec notEqual($usvec x, $usvec y);
    214 $bvec notEqual($bvec x, $bvec y);
    215 bool any($bvec x);
    216 bool all($bvec x);
    217 $bvec not($bvec x);
    218 
    219 $genIType bitCount($genIType value);
    220 $genIType bitCount($genUType value);
    221 $genIType findLSB($genIType value);
    222 $genIType findLSB($genUType value);
    223 $genIType findMSB($genIType value);
    224 $genIType findMSB($genUType value);
    225 
    226 /*
    227 //$genUType uaddCarry($genUType x, $genUType y, out $genUType carry);
    228 //$genUType usubBorrow($genUType x, $genUType y, out $genUType borrow);
    229 void umulExtended($genUType x, $genUType y, out $genUType msb, out $genUType lsb);
    230 void imulExtended($genIType x, $genIType y, out $genIType msb, out $genIType lsb);
    231 $genIType bitfieldExtract($genIType value, int offset, int bits);
    232 //$genUType bitfieldExtract($genUType value, int offset, int bits);
    233 $genIType bitfieldInsert($genIType base, $genIType insert, int offset, int bits);
    234 //$genUType bitfieldInsert($genUType base, $genUType insert, int offset, int bits);
    235 $genIType bitfieldReverse($genIType value);
    236 //$genUType bitfieldReverse($genUType value);
    237 int textureSize($gsampler1D sampler, int lod);
    238 int2 textureSize($gsampler2D sampler, int lod);
    239 int3 textureSize($gsampler3D sampler, int lod);
    240 int2 textureSize($gsamplerCube sampler, int lod);
    241 int textureSize(sampler1DShadow sampler, int lod);
    242 int2 textureSize(sampler2DShadow sampler, int lod);
    243 int2 textureSize(samplerCubeShadow sampler, int lod);
    244 int3 textureSize($gsamplerCubeArray sampler, int lod);
    245 int3 textureSize(samplerCubeArrayShadow sampler, int lod);
    246 */
    247 int2 textureSize($gsampler2DRect sampler);
    248 /*
    249 int2 textureSize(sampler2DRectShadow sampler);
    250 int2 textureSize($gsampler1DArray sampler, int lod);
    251 int3 textureSize($gsampler2DArray sampler, int lod);
    252 int2 textureSize(sampler1DArrayShadow sampler, int lod);
    253 int3 textureSize(sampler2DArrayShadow sampler, int lod);
    254 int textureSize($gsamplerBuffer sampler);
    255 int2 textureSize($gsampler2DMS sampler);
    256 int3 textureSize($gsampler2DMSArray sampler);
    257 float2 textureQueryLod($gsampler1D sampler, float P);
    258 float2 textureQueryLod($gsampler2D sampler, float2 P);
    259 float2 textureQueryLod($gsampler3D sampler, float3 P);
    260 float2 textureQueryLod($gsamplerCube sampler, float3 P);
    261 float2 textureQueryLod($gsampler1DArray sampler, float P);
    262 float2 textureQueryLod($gsampler2DArray sampler, float2 P);
    263 float2 textureQueryLod($gsamplerCubeArray sampler, float3 P);
    264 float2 textureQueryLod(sampler1DShadow sampler, float P);
    265 float2 textureQueryLod(sampler2DShadow sampler, float2 P);
    266 float2 textureQueryLod(samplerCubeShadow sampler, float3 P);
    267 float2 textureQueryLod(sampler1DArrayShadow sampler, float P);
    268 float2 textureQueryLod(sampler2DArrayShadow sampler, float2 P);
    269 float2 textureQueryLod(samplerCubeArrayShadow sampler, float3 P);
    270 int textureQueryLevels($gsampler1D sampler);
    271 int textureQueryLevels($gsampler2D sampler);
    272 int textureQueryLevels($gsampler3D sampler);
    273 int textureQueryLevels($gsamplerCube sampler);
    274 int textureQueryLevels($gsampler1DArray sampler);
    275 int textureQueryLevels($gsampler2DArray sampler);
    276 int textureQueryLevels($gsamplerCubeArray sampler);
    277 int textureQueryLevels(sampler1DShadow sampler);
    278 int textureQueryLevels(sampler2DShadow sampler);
    279 int textureQueryLevels(samplerCubeShadow sampler);
    280 int textureQueryLevels(sampler1DArrayShadow sampler);
    281 int textureQueryLevels(sampler2DArrayShadow sampler);
    282 int textureQueryLevels(samplerCubeArrayShadow sampler);
    283 */
    284 
    285 half4 texture($gsampler1D sampler, float P);
    286 half4 texture($gsampler1D sampler, float P, float bias);
    287 half4 texture($gsampler2D sampler, float2 P);
    288 // The above currently only expand to handle the float/fixed case. So we also declare this integer
    289 // version of texture().
    290 int4 texture(isampler2D sampler, float2 P);
    291 half4 texture(samplerExternalOES sampler, float2 P, float bias);
    292 half4 texture(samplerExternalOES sampler, float2 P);
    293 
    294 /*
    295 $gfloat4 texture($gsampler2D sampler, float2 P, float bias);
    296 $gfloat4 texture($gsampler3D sampler, float3 P);
    297 $gfloat4 texture($gsampler3D sampler, float3 P, float bias);
    298 $gfloat4 texture($gsamplerCube sampler, float3 P);
    299 $gfloat4 texture($gsamplerCube sampler, float3 P, float bias);
    300 float texture(sampler1DShadow sampler, float3 P);
    301 float texture(sampler1DShadow sampler, float3 P, float bias);
    302 float texture(sampler2DShadow sampler, float3 P);
    303 float texture(sampler2DShadow sampler, float3 P, float bias);
    304 float texture(samplerCubeShadow sampler, float4 P);
    305 float texture(samplerCubeShadow sampler, float4 P, float bias);
    306 $gfloat4 texture($gsampler1DArray sampler, float2 P);
    307 $gfloat4 texture($gsampler1DArray sampler, float2 P, float bias);
    308 $gfloat4 texture($gsampler2DArray sampler, float3 P);
    309 $gfloat4 texture($gsampler2DArray sampler, float3 P, float bias);
    310 $gfloat4 texture($gsamplerCubeArray sampler, float4 P);
    311 $gfloat4 texture($gsamplerCubeArray sampler, float4 P, float bias);
    312 float texture(sampler1DArrayShadow sampler, float3 P);
    313 float texture(sampler1DArrayShadow sampler, float3 P, float bias);
    314 float texture(sampler2DArrayShadow sampler, float4 P);
    315 */
    316 
    317 half4 texture($gsampler2DRect sampler, float2 P);
    318 half4 texture($gsampler2DRect sampler, float3 P);
    319 
    320 /*
    321 float texture(sampler2DRectShadow sampler, float3 P);
    322 float texture($gsamplerCubeArrayShadow sampler, float4 P, float compare);
    323 */
    324 
    325 // Currently we do not support the generic types of loading subpassInput so we have some explicit
    326 // versions that we currently use
    327 float4 subpassLoad(subpassInput subpass);
    328 float4 subpassLoad(subpassInputMS subpass, int sample);
    329 /*
    330 $gfloat4subpassLoad(gsubpassInput subpass);
    331 $gfloat4subpassLoad(gsubpassInputMS subpass, int sample);
    332 */
    333 )
    334 
    335 // split into multiple chunks, as MSVC++ complains if a single string is too long
    336 
    337 STRINGIFY(
    338 
    339 half4 texture($gsampler1D sampler, float2 P);
    340 half4 texture($gsampler1D sampler, float2 P, float bias);
    341 half4 texture($gsampler2D sampler, float3 P);
    342 half4 texture($gsampler2D sampler, float3 P, float bias);
    343 /*
    344 $gfloat4 textureProj($gsampler3D sampler, float4 P);
    345 $gfloat4 textureProj($gsampler3D sampler, float4 P, float bias);
    346 float textureProj(sampler1DShadow sampler, float4 P);
    347 float textureProj(sampler1DShadow sampler, float4 P, float bias);
    348 float textureProj(sampler2DShadow sampler, float4 P);
    349 float textureProj(sampler2DShadow sampler, float4 P, float bias);
    350 $gfloat4 textureProj($gsampler2DRect sampler, float4 P);
    351 float textureProj(sampler2DRectShadow sampler, float4 P);
    352 $gfloat4 textureLod($gsampler1D sampler, float P, float lod);
    353 $gfloat4 textureLod($gsampler2D sampler, float2 P, float lod);
    354 $gfloat4 textureLod($gsampler3D sampler, float3 P, float lod);
    355 $gfloat4 textureLod($gsamplerCube sampler, float3 P, float lod);
    356 float textureLod(sampler1DShadow sampler, float3 P, float lod);
    357 float textureLod(sampler2DShadow sampler, float3 P, float lod);
    358 $gfloat4 textureLod($gsampler1DArray sampler, float2 P, float lod);
    359 $gfloat4 textureLod($gsampler2DArray sampler, float3 P, float lod);
    360 float textureLod(sampler1DArrayShadow sampler, float3 P, float lod);
    361 $gfloat4 textureLod($gsamplerCubeArray sampler, float4 P, float lod);
    362 $gfloat4 textureOffset($gsampler1D sampler, float P, int offset);
    363 $gfloat4 textureOffset($gsampler1D sampler, float P, int offset, float bias);
    364 $gfloat4 textureOffset($gsampler2D sampler, float2 P, int2 offset);
    365 $gfloat4 textureOffset($gsampler2D sampler, float2 P, int2 offset, float bias);
    366 $gfloat4 textureOffset($gsampler3D sampler, float3 P, int3 offset);
    367 $gfloat4 textureOffset($gsampler3D sampler, float3 P, int3 offset, float bias);
    368 $gfloat4 textureOffset($gsampler2DRect sampler, float2 P, int2 offset);
    369 float textureOffset(sampler2DRectShadow sampler, float3 P, int2 offset);
    370 float textureOffset(sampler1DShadow sampler, float3 P, int offset);
    371 float textureOffset(sampler1DShadow sampler, float3 P, int offset, float bias);
    372 float textureOffset(sampler2DShadow sampler, float3 P, int2 offset);
    373 float textureOffset(sampler2DShadow sampler, float3 P, int2 offset, float bias);
    374 $gfloat4 textureOffset($gsampler1DArray sampler, float2 P, int offset);
    375 $gfloat4 textureOffset($gsampler1DArray sampler, float2 P, int offset, float bias);
    376 $gfloat4 textureOffset($gsampler2DArray sampler, float3 P, int2 offset);
    377 $gfloat4 textureOffset($gsampler2DArray sampler, float3 P, int2 offset, float bias);
    378 float textureOffset(sampler1DArrayShadow sampler, float3 P, int offset);
    379 float textureOffset(sampler1DArrayShadow sampler, float3 P, int offset, float bias);
    380 float textureOffset(sampler2DArrayShadow sampler, float4 P, int2 offset);
    381 */
    382 float4 texelFetch(samplerBuffer sampler, int P);
    383 
    384 $gfloat4 texelFetch($gsampler1D sampler, int P, int lod);
    385 $gfloat4 texelFetch($gsampler2D sampler, int2 P, int lod);
    386 $gfloat4 texelFetch($gsampler2DRect sampler, int2 P);
    387 /*
    388 $gfloat4 texelFetch($gsampler3D sampler, int3 P, int lod);
    389 $gfloat4 texelFetch($gsampler1DArray sampler, int2 P, int lod);
    390 $gfloat4 texelFetch($gsampler2DArray sampler, int3 P, int lod);
    391 $gfloat4 texelFetch($gsampler2DMS sampler, int2 P, int sample);
    392 $gfloat4 texelFetch($gsampler2DMSArray sampler, int3 P, int sample);
    393 $gfloat4 texelFetchOffset($gsampler1D sampler, int P, int lod, int offset);
    394 $gfloat4 texelFetchOffset($gsampler2D sampler, int2 P, int lod, int2 offset);
    395 $gfloat4 texelFetchOffset($gsampler3D sampler, int3 P, int lod, int3 offset);
    396 $gfloat4 texelFetchOffset($gsampler2DRect sampler, int2 P, int2 offset);
    397 $gfloat4 texelFetchOffset($gsampler1DArray sampler, int2 P, int lod, int offset);
    398 $gfloat4 texelFetchOffset($gsampler2DArray sampler, int3 P, int lod, int2 offset);
    399 $gfloat4 textureProjOffset($gsampler1D sampler, float2 P, int offset);
    400 $gfloat4 textureProjOffset($gsampler1D sampler, float2 P, int offset, float bias);
    401 $gfloat4 textureProjOffset($gsampler1D sampler, float4 P, int offset);
    402 $gfloat4 textureProjOffset($gsampler1D sampler, float4 P, int offset, float bias);
    403 $gfloat4 textureProjOffset($gsampler2D sampler, float3 P, int2 offset);
    404 $gfloat4 textureProjOffset($gsampler2D sampler, float3 P, int2 offset, float bias);
    405 $gfloat4 textureProjOffset($gsampler2D sampler, float4 P, int2 offset);
    406 $gfloat4 textureProjOffset($gsampler2D sampler, float4 P, int2 offset, float bias);
    407 $gfloat4 textureProjOffset($gsampler3D sampler, float4 P, int3 offset);
    408 $gfloat4 textureProjOffset($gsampler3D sampler, float4 P, int3 offset, float bias);
    409 $gfloat4 textureProjOffset($gsampler2DRect sampler, float3 P, int2 offset);
    410 $gfloat4 textureProjOffset($gsampler2DRect sampler, float4 P, int2 offset);
    411 float textureProjOffset(sampler2DRectShadow sampler, float4 P, int2 offset);
    412 float textureProjOffset(sampler1DShadow sampler, float4 P, int offset);
    413 float textureProjOffset(sampler1DShadow sampler, float4 P, int offset, float bias);
    414 float textureProjOffset(sampler2DShadow sampler, float4 P, int2 offset);
    415 float textureProjOffset(sampler2DShadow sampler, float4 P, int2 offset, float bias);
    416 $gfloat4 textureLodOffset($gsampler1D sampler, float P, float lod, int offset);
    417 $gfloat4 textureLodOffset($gsampler2D sampler, float2 P, float lod, int2 offset);
    418 $gfloat4 textureLodOffset($gsampler3D sampler, float3 P, float lod, int3 offset);
    419 float textureLodOffset(sampler1DShadow sampler, float3 P, float lod, int offset);
    420 float textureLodOffset(sampler2DShadow sampler, float3 P, float lod, int2 offset);
    421 $gfloat4 textureLodOffset($gsampler1DArray sampler, float2 P, float lod, int offset);
    422 $gfloat4 textureLodOffset($gsampler2DArray sampler, float3 P, float lod, int2 offset);
    423 float textureLodOffset(sampler1DArrayShadow sampler, float3 P, float lod, int offset);
    424 $gfloat4 textureProjLod($gsampler1D sampler, float2 P, float lod);
    425 $gfloat4 textureProjLod($gsampler1D sampler, float4 P, float lod);
    426 $gfloat4 textureProjLod($gsampler2D sampler, float3 P, float lod);
    427 $gfloat4 textureProjLod($gsampler2D sampler, float4 P, float lod);
    428 $gfloat4 textureProjLod($gsampler3D sampler, float4 P, float lod);
    429 float textureProjLod(sampler1DShadow sampler, float4 P, float lod);
    430 float textureProjLod(sampler2DShadow sampler, float4 P, float lod);
    431 $gfloat4 textureProjLodOffset($gsampler1D sampler, float2 P, float lod, int offset);
    432 $gfloat4 textureProjLodOffset($gsampler1D sampler, float4 P, float lod, int offset);
    433 $gfloat4 textureProjLodOffset($gsampler2D sampler, float3 P, float lod, int2 offset);
    434 $gfloat4 textureProjLodOffset($gsampler2D sampler, float4 P, float lod, int2 offset);
    435 $gfloat4 textureProjLodOffset($gsampler3D sampler, float4 P, float lod, int3 offset);
    436 float textureProjLodOffset(sampler1DShadow sampler, float4 P, float lod, int offset);
    437 float textureProjLodOffset(sampler2DShadow sampler, float4 P, float lod, int2 offset);
    438 $gfloat4 textureGrad($gsampler1D sampler, float P, float dPdx, float dPdy);
    439 $gfloat4 textureGrad($gsampler2D sampler, float2 P, float2 dPdx, float2 dPdy);
    440 $gfloat4 textureGrad($gsampler3D sampler, float3 P, float3 dPdx, float3 dPdy);
    441 $gfloat4 textureGrad($gsamplerCube sampler, float3 P, float3 dPdx, float3 dPdy);
    442 $gfloat4 textureGrad($gsampler2DRect sampler, float2 P, float2 dPdx, float2 dPdy);
    443 float textureGrad(sampler2DRectShadow sampler, float3 P, float2 dPdx, float2 dPdy);
    444 float textureGrad(sampler1DShadow sampler, float3 P, float dPdx, float dPdy);
    445 float textureGrad(sampler2DShadow sampler, float3 P, float2 dPdx, float2 dPdy);
    446 float textureGrad(samplerCubeShadow sampler, float4 P, float3 dPdx, float3 dPdy);
    447 $gfloat4 textureGrad($gsampler1DArray sampler, float2 P, float dPdx, float dPdy);
    448 $gfloat4 textureGrad($gsampler2DArray sampler, float3 P, float2 dPdx, float2 dPdy);
    449 float textureGrad(sampler1DArrayShadow sampler, float3 P, float dPdx, float dPdy);
    450 float textureGrad(sampler2DArrayShadow sampler, float4 P, float2 dPdx, float2 dPdy);
    451 $gfloat4 textureGrad($gsamplerCubeArray sampler, float4 P, float3 dPdx, float3 dPdy);
    452 $gfloat4 textureGradOffset($gsampler1D sampler, float P, float dPdx, float dPdy, int offset);
    453 $gfloat4 textureGradOffset($gsampler2D sampler, float2 P, float2 dPdx, float2 dPdy, int2 offset);
    454 $gfloat4 textureGradOffset($gsampler3D sampler, float3 P, float3 dPdx, float3 dPdy, int3 offset);
    455 $gfloat4 textureGradOffset($gsampler2DRect sampler, float2 P, float2 dPdx, float2 dPdy, int2 offset);
    456 float textureGradOffset(sampler2DRectShadow sampler, float3 P, float2 dPdx, float2 dPdy, int2 offset);
    457 float textureGradOffset(sampler1DShadow sampler, float3 P, float dPdx, float dPdy, int offset );
    458 float textureGradOffset(sampler2DShadow sampler, float3 P, float2 dPdx, float2 dPdy, int2 offset);
    459 $gfloat4 textureGradOffset($gsampler1DArray sampler, float2 P, float dPdx, float dPdy, int offset);
    460 $gfloat4 textureGradOffset($gsampler2DArray sampler, float3 P, float2 dPdx, float2 dPdy, int2 offset);
    461 float textureGradOffset(sampler1DArrayShadow sampler, float3 P, float dPdx, float dPdy, int offset);
    462 float textureGradOffset(sampler2DArrayShadow sampler, float4 P, float2 dPdx, float2 dPdy, int2 offset);
    463 $gfloat4 textureProjGrad($gsampler1D sampler, float2 P, float dPdx, float dPdy);
    464 $gfloat4 textureProjGrad($gsampler1D sampler, float4 P, float dPdx, float dPdy);
    465 $gfloat4 textureProjGrad($gsampler2D sampler, float3 P, float2 dPdx, float2 dPdy);
    466 $gfloat4 textureProjGrad($gsampler2D sampler, float4 P, float2 dPdx, float2 dPdy);
    467 $gfloat4 textureProjGrad($gsampler3D sampler, float4 P, float3 dPdx, float3 dPdy);
    468 $gfloat4 textureProjGrad($gsampler2DRect sampler, float3 P, float2 dPdx, float2 dPdy);
    469 $gfloat4 textureProjGrad($gsampler2DRect sampler, float4 P, float2 dPdx, float2 dPdy);
    470 float textureProjGrad(sampler2DRectShadow sampler, float4 P, float2 dPdx, float2 dPdy);
    471 float textureProjGrad(sampler1DShadow sampler, float4 P, float dPdx, float dPdy);
    472 float textureProjGrad(sampler2DShadow sampler, float4 P, float2 dPdx, float2 dPdy);
    473 $gfloat4 textureProjGradOffset($gsampler1D sampler, float2 P, float dPdx, float dPdy, int offset);
    474 $gfloat4 textureProjGradOffset($gsampler1D sampler, float4 P, float dPdx, float dPdy, int offset);
    475 $gfloat4 textureProjGradOffset($gsampler2D sampler, float3 P, float2 dPdx, float2 dPdy, int2 offset);
    476 $gfloat4 textureProjGradOffset($gsampler2D sampler, float4 P, float2 dPdx, float2 dPdy, int2 offset);
    477 $gfloat4 textureProjGradOffset($gsampler2DRect sampler, float3 P, float2 dPdx, float2 dPdy, int2 offset);
    478 $gfloat4 textureProjGradOffset($gsampler2DRect sampler, float4 P, float2 dPdx, float2 dPdy, int2 offset);
    479 float textureProjGradOffset(sampler2DRectShadow sampler, float4 P, float2 dPdx, float2 dPdy, int2 offset);
    480 $gfloat4 textureProjGradOffset($gsampler3D sampler, float4 P, float3 dPdx, float3 dPdy, int3 offset);
    481 float textureProjGradOffset(sampler1DShadow sampler, float4 P, float dPdx, float dPdy, int offset);
    482 float textureProjGradOffset(sampler2DShadow sampler, float4 P, float2 dPdx, float2 dPdy, int2 offset);
    483 $gfloat4 textureGather($gsampler2D sampler, float2 P);
    484 $gfloat4 textureGather($gsampler2D sampler, float2 P, int comp);
    485 $gfloat4 textureGather($gsampler2DArray sampler, float3 P);
    486 $gfloat4 textureGather($gsampler2DArray sampler, float3 P, int comp);
    487 $gfloat4 textureGather($gsamplerCube sampler, float3 P);
    488 $gfloat4 textureGather($gsamplerCube sampler, float3 P, int comp);
    489 $gfloat4 textureGather($gsamplerCubeArray sampler, float4 P);
    490 $gfloat4 textureGather($gsamplerCubeArray sampler, float4 P, int comp);
    491 $gfloat4 textureGather($gsampler2DRect sampler, float2 P);
    492 $gfloat4 textureGather($gsampler2DRect sampler, float2 P, int comp);
    493 float4 textureGather(sampler2DShadow sampler, float2 P, float refZ);
    494 float4 textureGather(sampler2DArrayShadow sampler, float3 P, float refZ);
    495 float4 textureGather(samplerCubeShadow sampler, float3 P, float refZ);
    496 float4 textureGather(samplerCubeArrayShadow sampler, float4 P, float refZ);
    497 float4 textureGather(sampler2DRectShadow sampler, float2 P, float refZ);
    498 $gfloat4 textureGatherOffset($gsampler2D sampler, float2 P, int2 offset);
    499 $gfloat4 textureGatherOffset($gsampler2D sampler, float2 P, int2 offset, int comp);
    500 $gfloat4 textureGatherOffset($gsampler2DArray sampler, float3 P, int2 offset);
    501 $gfloat4 textureGatherOffset($gsampler2DArray sampler, float3 P, int2 offset, int comp);
    502 $gfloat4 textureGatherOffset($gsampler2DRect sampler, float2 P, int2 offset);
    503 $gfloat4 textureGatherOffset($gsampler2DRect sampler, float2 P, int2 offset, int comp);
    504 float4 textureGatherOffset(sampler2DShadow sampler, float2 P, float refZ, int2 offset);
    505 float4 textureGatherOffset(sampler2DArrayShadow sampler, float3 P, float refZ, int2 offset);
    506 float4 textureGatherOffset(sampler2DRectShadow sampler, float2 P, float refZ, int2 offset);
    507 $gfloat4 textureGatherOffsets($gsampler2D sampler, float2 P, int2 offsets[4]);
    508 $gfloat4 textureGatherOffsets($gsampler2D sampler, float2 P, int2 offsets[4], int comp);
    509 $gfloat4 textureGatherOffsets($gsampler2DArray sampler, float3 P, int2 offsets[4]);
    510 $gfloat4 textureGatherOffsets($gsampler2DArray sampler, float3 P, int2 offsets[4], int comp);
    511 $gfloat4 textureGatherOffsets($gsampler2DRect sampler, float2 P, int2 offsets[4]);
    512 $gfloat4 textureGatherOffsets($gsampler2DRect sampler, float2 P, int2 offsets[4], int comp);
    513 float4 textureGatherOffsets(sampler2DShadow sampler, float2 P, float refZ, int2 offsets[4]);
    514 float4 textureGatherOffsets(sampler2DArrayShadow sampler, float3 P, float refZ, int2 offsets[4]);
    515 float4 textureGatherOffsets(sampler2DRectShadow sampler, float2 P, float refZ, int2 offsets[4]);
    516 uint atomicCounterIncrement(atomic_uint c);
    517 uint atomicCounter(atomic_uint c);
    518 uint atomicAdd(inout uint mem, uint data);
    519 int atomicAdd(inout int mem, int data);
    520 uint atomicMin(inout uint mem, uint data);
    521 int atomicMin(inout int mem, int data);
    522 uint atomicMax(inout uint mem, uint data);
    523 int atomicMax(inout int mem, int data);
    524 uint atomicAnd(inout uint mem, uint data);
    525 int atomicAnd(inout int mem, int data);
    526 uint atomicOr(inout uint mem, uint data);
    527 int atomicOr(inout int mem, int data);
    528 uint atomicXor(inout uint mem, uint data);
    529 int atomicXor(inout int mem, int data);
    530 uint atomicExchange(inout uint mem, uint data);
    531 int atomicExchange(inout int mem, int data);
    532 uint atomicCompSwap(inout uint mem, uint compare, uint data);
    533 int atomicCompSwap(inout int mem, int compare, int data);
    534 */
    535 // section 8.12 Additional Image Functions will go here if and when we add
    536 // support for them
    537 float4 imageLoad(image2D image, int2 P);
    538 int4 imageLoad(iimage2D image, int2 P);
    539 $genType dFdx($genType p);
    540 $genType dFdy($genType p);
    541 float interpolateAtSample(float interpolant, int sample);
    542 float2 interpolateAtSample(float2 interpolant, int sample);
    543 float3 interpolateAtSample(float3 interpolant, int sample);
    544 float4 interpolateAtSample(float4 interpolant, int sample);
    545 float interpolateAtOffset(float interpolant, float2 offset);
    546 float2 interpolateAtOffset(float2 interpolant, float2 offset);
    547 float3 interpolateAtOffset(float3 interpolant, float2 offset);
    548 float4 interpolateAtOffset(float4 interpolant, float2 offset);
    549 
    550 /*
    551 $genType fwidth($genType p);
    552 $genType fwidthCoarse($genType p);
    553 $genType fwidthFine($genType p);
    554 void barrier();
    555 void memoryBarrier();
    556 void memoryBarrierAtomicCounter();
    557 void memoryBarrierBuffer();
    558 void memoryBarrierShared();
    559 void memoryBarrierImage();
    560 void groupMemoryBarrier();
    561 */
    562 
    563 )
    564