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