1# Tokens for WebGL 2.0 Shader Language. 2 3# Preprocessor tokens 4"#" 5"#define" 6"#undef" 7"#if" 8"#ifdef" 9"#ifndef" 10"#else" 11"#elif" 12"#endif" 13"#error" 14"#pragma" 15"#extension" 16"#version" 17"#line" 18"defined" 19"#macros" 20"__LINE__" 21"__FILE__" 22"__VERSION__" 23"GL_ES" 24 25 # Fragment shaders only 26"GL_FRAGMENT_PRECISION_HIGH" 27 28# Language tokens 29"(" 30")" 31"+" 32"-" 33"~" 34"!" 35"*" 36"/" 37"%" 38"+" 39"-" 40"<<" 41">>" 42"<" 43">" 44"<=" 45">=" 46"==" 47"!=" 48"+=" 49"-=" 50"*=" 51"/=" 52"%=" 53"<<=" 54">>=" 55";" 56"," 57"." 58"[" 59"]" 60"++" 61"--" 62"&" 63"^" 64"|" 65"&&" 66"||" 67 68# Keywords 69" attribute " 70" const " 71" uniform " 72" varying " 73" break " 74" continue " 75" do " 76" for " 77" while " 78" if " 79" else " 80" in " 81" out " 82" inout " 83" float " 84" int " 85" void " 86" bool " 87" true " 88" false " 89" lowp " 90" mediump " 91" highp " 92" precision " 93" invariant " 94" discard " 95" return" 96 97# Types, include valid examples and partial ones (that are invalid on their own) 98" mat2(" 99" mat2(1.0)" 100" mat2(1.0,2.0,3.0,4.0)" 101" mat3(vec2(1.0, 1.0),1.0,vec2(1.0, 1.0),1.0,vec2(1.0, 1.0),1.0)" 102" mat3(1.0)" 103" mat3(" 104" mat4(" 105" mat4(1.0)" 106" mat4(vec4(1.0),vec4(1.0,2.0,3.0,4.0),vec4(3.3),vec4(4.4))" 107"vec2" 108" vec2(1)" 109" vec3(1)" 110" vec3" 111" vec4(1)" 112" vec4" 113" ivec2(1) " 114" ivec2" 115" ivec3(1)" 116" ivec3" 117" ivec4(1)" 118" ivec4" 119" bvec2(true)" 120" bvec2" 121" bvec3(true)" 122" bvec3" 123" bvec4(true)" 124" bvec4" 125" sampler2D " 126" samplerCube " 127" struct " 128" sampler3D " 129" samplerCube " 130" sampler2DShadow " 131" sampler2DArray " 132" sampler2DArrayShadow " 133" sampler2DMS " 134" samplerCubeShadow " 135" isampler2D " 136" isampler3D " 137" isamplerCube " 138" isampler2DArray " 139" isampler2DMS " 140" usampler2D " 141" usampler3D " 142" usampler2DArray " 143" usampler2DMS " 144" usamplerCube " 145" image2D " 146" image3D " 147" imageCube " 148" image2DArray " 149" iimage2D " 150" iimage3D " 151" iimageCube " 152" iimage2DArray " 153" uimage2D " 154" uimage3D " 155" uimageCube " 156" uimage2DArray " 157" atomic_uint " 158 159# Builtin Variables 160"gl_Position" 161"gl_FragColor" 162"gl_FragData" 163"gl_FrontFacing" 164"gl_PointCoord" 165"gl_MaxDrawBuffers" 166"gl_MaxFragmentUniformVectors" 167"gl_MaxTextureImageUnits" 168"gl_MaxCombinedTextureImageUnits" 169"gl_MaxVertexTextureImageUnits" 170"gl_MaxVaryingVectors" 171"gl_MaxVertexUniformVectors" 172"gl_MaxVertexAttribs" 173"gl_FragCoord.x" 174"gl_FragCoord.y" 175"gl_FragCoord.z" 176"gl_FragData" 177"gl_FragDepth" 178"gl_InstanceID" 179"gl_NumWorkGroups" 180"gl_PointSize" 181"gl_VertexID" 182 183# misc. 184"void main(){" 185 186# Generated calls to builtin functions. 187" pow(1.0,1.0)" 188" fract(1.0)" 189" dFdx(1.0)" 190" step(1.0,1.0)" 191" min(1,1)" 192" min(1.0,1.0)" 193" dot(1.0,1.0)" 194" greaterThanEqual(uvec2(1,2),uvec2(1,2))" 195" asin(1.0)" 196" lessThanEqual(ivec2(1,-2),ivec2(1,-2))" 197" inversesqrt(1.0)" 198" length(1.0)" 199" acosh(1.0)" 200" roundEven(1.0)" 201" greaterThanEqual(ivec2(1,-2),ivec2(1,-2))" 202" greaterThan(uvec2(1,2),uvec2(1,2))" 203" radians(1.0)" 204" asinh(1.0)" 205" uintBitsToFloat(1)" 206" cos(1.0)" 207" ceil(1.0)" 208" equal(uvec2(1,2),uvec2(1,2))" 209" normalize(1.0)" 210" distance(1.0,1.0)" 211" abs(1)" 212" clamp(1.0,1.0,1.0)" 213" tan(1.0)" 214" smoothstep(1.0,1.0,1.0)" 215" isinf(1.0)" 216" not(bvec2(true,false))" 217" degrees(1.0)" 218" mix(1.0,1.0,true)" 219" max(1.0,1.0)" 220" lessThanEqual(uvec2(1,2),uvec2(1,2))" 221" round(1.0)" 222" atan(1.0,1.0)" 223" floatBitsToInt(1.0)" 224" abs(1.0)" 225" fwidth(1.0)" 226" lessThan(ivec2(1,-2),ivec2(1,-2))" 227" intBitsToFloat(1)" 228" mix(1.0,1.0,1.0)" 229" notEqual(uvec2(1,2),uvec2(1,2))" 230" floor(1.0)" 231" refract(1.0,1.0,1.0)" 232" equal(ivec2(1,-2),ivec2(1,-2))" 233" max(1,1)" 234" cosh(1.0)" 235" isnan(1.0)" 236" sign(1)" 237" mod(1.0,1.0)" 238" acos(1.0)" 239" sinh(1.0)" 240" greaterThan(ivec2(1,-2),ivec2(1,-2))" 241" exp2(1.0)" 242" notEqual(bvec2(true,false),bvec2(true,false))" 243" reflect(1.0,1.0)" 244" lessThan(uvec2(1,2),uvec2(1,2))" 245" sqrt(1.0)" 246" sign(1.0)" 247" clamp(1,1,1)" 248" sin(1.0)" 249" atan(1.0)" 250" tanh(1.0)" 251" dFdy(1.0)" 252" notEqual(ivec2(1,-2),ivec2(1,-2))" 253" trunc(1.0)" 254" log2(1.0)" 255" equal(bvec2(true,false),bvec2(true,false))" 256" atanh(1.0)" 257" exp(1.0)" 258" faceforward(1.0,1.0,1.0)" 259" floatBitsToUint(1.0)" 260" log(1.0)" 261