From 77fca6df627e283d75bee4773e293306f136b489 Mon Sep 17 00:00:00 2001 From: John Stiles <71952488+johnstiles-google@users.noreply.github.com> Date: Mon, 24 Jan 2022 12:58:05 -0500 Subject: [PATCH] Add more words to SkSL dictionary. (#7176) --- projects/skia/sksl.dict | 492 ++++++++++++++++++++++++++-------------- 1 file changed, 318 insertions(+), 174 deletions(-) diff --git a/projects/skia/sksl.dict b/projects/skia/sksl.dict index ceef8f072..d6b3cc1a6 100644 --- a/projects/skia/sksl.dict +++ b/projects/skia/sksl.dict @@ -1,99 +1,99 @@ -# Adapted from sksl.lex and SkSLBuiltinTypes.cpp +# Adapted from sksl.lex, SkSLBuiltinTypes.cpp, SkSLIntrinsicList.h, and sksl module files # positive float literals -"0.1" -"1.2" -"2.3" +" 0.1" +" 1.2" +" 2.3" # negative float literals -"-3.4" -"-4.5" -"-5.6" +" -3.4" +" -4.5" +" -5.6" # exponential float literals -"1e2" -"2e3" -"-3e4" -"-4e5" +" 1e2" +" 2e3" +" -3e4" +" -4e5" # positive int literals -"0" -"1" -"2" +" 0" +" 1" +" 2" # unsigned int literals -"3u" -"4u" +" 3u" +" 4u" # negative int literals -"-5" -"-6" +" -5" +" -6" # hexadecimal prefix -"0x" +" 0x" # bad octal -"08" +" 08" # unsigned bad octal -"09u" +" 09u" # keywords -"true " -"false " -"if " -"@if " -"else " -"for " -"while " -"do " -"switch " -"@switch " -"case " -"default " -"break " -"continue " -"discard " -"return " -"in " -"out " -"inout " -"uniform " -"const " -"flat " -"noperspective " -"inline " -"noinline " -"sk_has_side_effects " -"struct " -"layout " -"location " -"offset " -"binding " -"index " -"set " -"builtin " -"input_attachment_index " -"origin_upper_left " -"blend_support_all_equations " -"push_constant " -"color " -"highp " -"mediump " -"lowp " -"$es3 " -"main " -"#extension " -"disable " -"require " -"enable " -"warn " +" true" +" false" +" if (" +" @if (" +" else" +" for (" +" while (" +" do {" +" switch (" +" @switch (" +" case" +" default:" +" break;" +" continue;" +" discard;" +" return" +" in" +" out" +" inout" +" uniform" +" const" +" flat" +" noperspective" +" inline" +" noinline" +" sk_has_side_effects" +" struct" +" layout (" +" location=" +" offset=" +" binding=" +" index=" +" set=" +" builtin" +" input_attachment_index" +" origin_upper_left" +" blend_support_all_equations" +" push_constant" +" color" +" highp" +" mediump" +" lowp" +" $es3" +" main(" +" #extension" +" : disable" +" : require" +" : enable" +" : warn" # reserved words are all treated the same, and always invalidate the whole # program, so we only include a handful of them in the dictionary -"attribute " -"varying " -"precision " +" attribute" +" varying" +" precision" #"invariant " #"asm " #"class " @@ -203,113 +203,257 @@ "^=" "&=" ";" -"->" "//" "/*" "*/" # types -"void " -"float " -"float2 " -"float3 " -"float4 " -"vec2 " -"vec3 " -"vec4 " -"half " -"half2 " -"half3 " -"half4 " -"int " -"int2 " -"int3 " -"int4 " -"uint " -"uint2 " -"uint3 " -"uint4 " -"short " -"short2 " -"short3 " -"short4 " -"ushort " -"ushort2 " -"ushort3 " -"ushort4 " -"bool " -"bool2 " -"bool3 " -"bool4 " -"$floatLiteral " -"$intLiteral " -"float2x2 " -"float3x2 " -"float4x2 " -"float2x3 " -"float3x3 " -"float4x3 " -"float2x4 " -"float3x4 " -"float4x4 " -"half2x2 " -"half3x2 " -"half4x2 " -"half2x3 " -"half3x3 " -"half4x3 " -"half2x4 " -"half3x4 " -"half4x4 " -"mat2 " -"mat3 " -"mat4 " -"mat2x2 " -"mat3x2 " -"mat4x2 " -"mat2x3 " -"mat3x3 " -"mat4x3 " -"mat2x4 " -"mat3x4 " -"mat4x4 " -"colorFilter " -"shader " -"blender " +" void" +" float" +" float2" +" float3" +" float4" +" vec2" +" vec3" +" vec4" +" half" +" half2" +" half3" +" half4" +" int" +" int2" +" int3" +" int4" +" uint" +" uint2" +" uint3" +" uint4" +" short" +" short2" +" short3" +" short4" +" ushort" +" ushort2" +" ushort3" +" ushort4" +" bool" +" bool2" +" bool3" +" bool4" +" $floatLiteral" +" $intLiteral" +" float2x2" +" float3x2" +" float4x2" +" float2x3" +" float3x3" +" float4x3" +" float2x4" +" float3x4" +" float4x4" +" half2x2" +" half3x2" +" half4x2" +" half2x3" +" half3x3" +" half4x3" +" half2x4" +" half3x4" +" half4x4" +" mat2" +" mat3" +" mat4" +" mat2x2" +" mat3x2" +" mat4x2" +" mat2x3" +" mat3x3" +" mat4x3" +" mat2x4" +" mat3x4" +" mat4x4" +" colorFilter" +" shader" +" blender" # types that aren't accepted in a runtime effect; skip most of them -"texture2D " -"sampler2D " -"sampler " -#"texture1D " -#"texture3D " -#"textureExternalOES " -#"texture2DRect " -#"itexture2D " -#"sampler1D " -#"sampler3D " -#"samplerExternalOES " -#"sampler2DRect " -#"isampler2D " -#"subpassInput " -#"subpassInputMS " -#"subpassInputMS " +" texture2D" +" sampler2D" +" sampler" +#" texture1D" +#" texture3D" +#" textureExternalOES" +#" texture2DRect" +#" itexture2D" +#" sampler1D" +#" sampler3D" +#" samplerExternalOES" +#" sampler2DRect" +#" isampler2D" +#" subpassInput" +#" subpassInputMS" +#" subpassInputMS" # generic types shouldn't be accepted; skip most of them -"$genType" -"$sk_Caps" -#"$genHType" -#"$genIType" -#"$genUType" -#"$genBType" -#"$mat" -#"$hmat" -#"$squareMat" -#"$squareHMat" -#"$vec" -#"$hvec" -#"$ivec" -#"$uvec" -#"$svec" -#"$usvec" -#"$bvec" +" $genType" +" $sk_Caps" +#" $genHType" +#" $genIType" +#" $genUType" +#" $genBType" +#" $mat" +#" $hmat" +#" $squareMat" +#" $squareHMat" +#" $vec" +#" $hvec" +#" $ivec" +#" $uvec" +#" $svec" +#" $usvec" +#" $bvec" + +# sksl_frag +" sk_FragCoord" +" sk_Clockwise" +" sk_FragColor" +" sk_LastFragColor" +" sk_SecondaryFragColor" + +# sksl_gpu +" blend_clear(" +" blend_src(" +" blend_dst(" +" blend_src_over(" +" blend_dst_over(" +" blend_src_in(" +" blend_dst_in(" +" blend_src_out(" +" blend_dst_out(" +" blend_src_atop(" +" blend_dst_atop(" +" blend_xor(" +" blend_plus(" +" blend_modulate(" +" blend_screen(" +" blend_overlay(" +" blend_darken(" +" blend_lighten(" +" blend_color_dodge(" +" blend_color_burn(" +" blend_hard_light(" +" blend_soft_light(" +" blend_difference(" +" blend_exclusion(" +" blend_multiply(" +" blend_hue(" +" blend_saturation(" +" blend_color(" +" blend_luminosity(" +" unpremul(" +" proj(" +" cross_length_2d(" + +# sksl_public +".eval(" + +# sksl_vert +" sk_PerVertex" +" sk_VertexID" +" sk_InstanceID" + +# SkSLIntrinsicList +" abs(" +" acosh(" +" acos(" +" all(" +" any(" +" asinh(" +" asin(" +" atanh(" +" atan(" +" bitCount(" +" ceil(" +" clamp(" +" cosh(" +" cos(" +" cross(" +" degrees(" +" determinant(" +" dFdx(" +" dFdy(" +" distance(" +" dot(" +" equal(" +" eval(" +" exp2(" +" exp(" +" faceforward(" +" findLSB(" +" findMSB(" +" floatBitsToInt(" +" floatBitsToUint(" +" floor(" +" fma(" +" fract(" +" frexp(" +" fwidth(" +" greaterThanEqual(" +" greaterThan(" +" intBitsToFloat(" +" inversesqrt(" +" inverse(" +" isinf(" +" isnan(" +" ldexp(" +" length(" +" lessThanEqual(" +" lessThan(" +" log2(" +" log(" +" makeSampler2D(" +" matrixCompMult(" +" matrixInverse(" +" max(" +" min(" +" mix(" +" modf(" +" mod(" +" normalize(" +" notEqual(" +" not (" +" outerProduct(" +" packDouble2x32(" +" packHalf2x16(" +" packSnorm2x16(" +" packSnorm4x8(" +" packUnorm2x16(" +" packUnorm4x8(" +" pow(" +" radians(" +" reflect(" +" refract(" +" roundEven(" +" round(" +" sample(" +" saturate(" +" sign(" +" sinh(" +" sin(" +" smoothstep(" +" sqrt(" +" step(" +" subpassLoad(" +" tanh(" +" tan(" +" transpose(" +" trunc(" +" uintBitsToFloat(" +" unpackDouble2x32(" +" unpackHalf2x16(" +" unpackSnorm2x16(" +" unpackSnorm4x8(" +" unpackUnorm2x16(" +" unpackUnorm4x8(" +" toLinearSrgb(" +" fromLinearSrgb("