diff --git a/src/back/glsl/keywords.rs b/src/back/glsl/keywords.rs index 5a2836c189..d474c3cd46 100644 --- a/src/back/glsl/keywords.rs +++ b/src/back/glsl/keywords.rs @@ -1,204 +1,360 @@ +// https://dawn.googlesource.com/dawn/+/refs/heads/main/src/tint/lang/wgsl/ast/transform/renamer.cc +// Last sync: https://dawn.googlesource.com/dawn/+/22b4dd2aee27d79d8aed0f39ada7222f20740018/src/tint/lang/wgsl/ast/transform/renamer.cc#39 pub const RESERVED_KEYWORDS: &[&str] = &[ + "abs", + "acos", + "acosh", + "active", + "all", + "any", + "asin", + "asinh", + "asm", + "atan", + "atanh", + "atomicAdd", + "atomicAnd", + "atomicCompSwap", + "atomicCounter", + "atomicCounterDecrement", + "atomicCounterIncrement", + "atomicExchange", + "atomicMax", + "atomicMin", + "atomicOr", + "atomicXor", + "atomic_uint", "attribute", - "const", - "uniform", - "varying", + "barrier", + "bitCount", + "bitfieldExtract", + "bitfieldInsert", + "bitfieldReverse", + "bool", + "break", "buffer", - "shared", - "coherent", - "volatile", - "restrict", - "readonly", - "writeonly", - "atomic_uint", - "layout", + "bvec2", + "bvec3", + "bvec4", + "case", + "cast", + "ceil", "centroid", - "flat", - "smooth", - "noperspective", - "patch", - "sample", - "break", + "clamp", + "class", + "coherent", + "common", + "const", "continue", + "cos", + "cosh", + "cross", + "dFdx", + "dFdy", + "default", + "degrees", + "determinant", + "discard", + "distance", + "dmat2", + "dmat2x2", + "dmat2x3", + "dmat2x4", + "dmat3", + "dmat3x2", + "dmat3x3", + "dmat3x4", + "dmat4", + "dmat4x2", + "dmat4x3", + "dmat4x4", "do", + "dot", + "double", + "dvec2", + "dvec3", + "dvec4", + "else", + "enum", + "equal", + "exp", + "exp2", + "extern", + "external", + "faceforward", + "false", + "filter", + "findLSB", + "findMSB", + "fixed", + "flat", + "float", + "floatBitsToInt", + "floatBitsToUint", + "floor", "for", - "while", - "switch", - "case", - "default", + "fract", + "frexp", + "fvec2", + "fvec3", + "fvec4", + "fwidth", + "gl_BaseInstance", + "gl_BaseVertex", + "gl_ClipDistance", + "gl_DepthRangeParameters", + "gl_DrawID", + "gl_FragCoord", + "gl_FragDepth", + "gl_FrontFacing", + "gl_GlobalInvocationID", + "gl_InstanceID", + "gl_LocalInvocationID", + "gl_LocalInvocationIndex", + "gl_NumSamples", + "gl_NumWorkGroups", + "gl_PerVertex", + "gl_PointCoord", + "gl_PointSize", + "gl_Position", + "gl_PrimitiveID", + "gl_SampleID", + "gl_SampleMask", + "gl_SampleMaskIn", + "gl_SamplePosition", + "gl_VertexID", + "gl_WorkGroupID", + "gl_WorkGroupSize", + "goto", + "greaterThan", + "greaterThanEqual", + "groupMemoryBarrier", + "half", + "highp", + "hvec2", + "hvec3", + "hvec4", "if", - "else", - "subroutine", + "iimage1D", + "iimage1DArray", + "iimage2D", + "iimage2DArray", + "iimage2DMS", + "iimage2DMSArray", + "iimage2DRect", + "iimage3D", + "iimageBuffer", + "iimageCube", + "iimageCubeArray", + "image1D", + "image1DArray", + "image2D", + "image2DArray", + "image2DMS", + "image2DMSArray", + "image2DRect", + "image3D", + "imageBuffer", + "imageCube", + "imageCubeArray", + "imageLoad", + "imageSize", + "imageStore", + "imulExtended", "in", - "out", + "inline", "inout", - "float", - "double", + "input", "int", - "void", - "bool", - "true", - "false", + "intBitsToFloat", + "interface", "invariant", - "precise", - "discard", - "return", + "inverse", + "inversesqrt", + "isampler1D", + "isampler1DArray", + "isampler2D", + "isampler2DArray", + "isampler2DMS", + "isampler2DMSArray", + "isampler2DRect", + "isampler3D", + "isamplerBuffer", + "isamplerCube", + "isamplerCubeArray", + "isinf", + "isnan", + "ivec2", + "ivec3", + "ivec4", + "layout", + "ldexp", + "length", + "lessThan", + "lessThanEqual", + "log", + "log2", + "long", + "lowp", + "main", "mat2", - "mat3", - "mat4", - "dmat2", - "dmat3", - "dmat4", "mat2x2", "mat2x3", "mat2x4", - "dmat2x2", - "dmat2x3", - "dmat2x4", + "mat3", "mat3x2", "mat3x3", "mat3x4", - "dmat3x2", - "dmat3x3", - "dmat3x4", + "mat4", "mat4x2", "mat4x3", "mat4x4", - "dmat4x2", - "dmat4x3", - "dmat4x4", - "vec2", - "vec3", - "vec4", - "ivec2", - "ivec3", - "ivec4", - "bvec2", - "bvec3", - "bvec4", - "dvec2", - "dvec3", - "dvec4", - "uint", - "uvec2", - "uvec3", - "uvec4", - "lowp", + "matrixCompMult", + "max", "mediump", - "highp", + "memoryBarrier", + "memoryBarrierAtomicCounter", + "memoryBarrierBuffer", + "memoryBarrierImage", + "memoryBarrierShared", + "min", + "mix", + "mod", + "modf", + "namespace", + "noinline", + "noperspective", + "normalize", + "not", + "notEqual", + "out", + "outerProduct", + "output", + "packHalf2x16", + "packSnorm2x16", + "packSnorm4x8", + "packUnorm2x16", + "packUnorm4x8", + "partition", + "patch", + "pow", + "precise", "precision", + "public", + "radians", + "readonly", + "reflect", + "refract", + "resource", + "restrict", + "return", + "round", + "roundEven", + "sample", "sampler1D", - "sampler2D", - "sampler3D", - "samplerCube", - "sampler1DShadow", - "sampler2DShadow", - "samplerCubeShadow", "sampler1DArray", - "sampler2DArray", "sampler1DArrayShadow", + "sampler1DShadow", + "sampler2D", + "sampler2DArray", "sampler2DArrayShadow", - "isampler1D", - "isampler2D", - "isampler3D", - "isamplerCube", - "isampler1DArray", - "isampler2DArray", - "usampler1D", - "usampler2D", - "usampler3D", - "usamplerCube", - "usampler1DArray", - "usampler2DArray", + "sampler2DMS", + "sampler2DMSArray", "sampler2DRect", "sampler2DRectShadow", - "isampler2D", - "Rect", - "usampler2DRect", + "sampler2DShadow", + "sampler3D", + "sampler3DRect", "samplerBuffer", - "isamplerBuffer", - "usamplerBuffer", - "sampler2DMS", - "isampler2DMS", - "usampler2DMS", - "sampler2DMSArray", - "isampler2DMSArray", - "usampler2DMSArray", + "samplerCube", "samplerCubeArray", "samplerCubeArrayShadow", - "isamplerCubeArray", - "usamplerCubeArray", - "image1D", - "iimage1D", + "samplerCubeShadow", + "shared", + "short", + "sign", + "sin", + "sinh", + "sizeof", + "smooth", + "smoothstep", + "sqrt", + "static", + "step", + "struct", + "subroutine", + "superp", + "switch", + "tan", + "tanh", + "template", + "texelFetch", + "texelFetchOffset", + "texture", + "textureGather", + "textureGatherOffset", + "textureGrad", + "textureGradOffset", + "textureLod", + "textureLodOffset", + "textureOffset", + "textureProj", + "textureProjGrad", + "textureProjGradOffset", + "textureProjLod", + "textureProjLodOffset", + "textureProjOffset", + "textureSize", + "this", + "transpose", + "true", + "trunc", + "typedef", + "uaddCarry", "uimage1D", - "image2D", - "iimage2D", + "uimage1DArray", "uimage2D", - "image3D", - "iimage3D", - "uimage3D", - "image2DRect", - "iimage2DRect", + "uimage2DArray", + "uimage2DMS", + "uimage2DMSArray", "uimage2DRect", - "imageCube", - "iimageCube", - "uimageCube", - "imageBuffer", - "iimageBuffer", + "uimage3D", "uimageBuffer", - "image1DArray", - "iimage1DArray", - "uimage1DArray", - "image2DArray", - "iimage2DArray", - "uimage2DArray", - "imageCubeArray", - "iimageCubeArray", + "uimageCube", "uimageCubeArray", - "image2DMS", - "iimage2DMS", - "uimage2DMS", - "image2DMSArray", - "iimage2DMSArray", - "uimage2DMSArraystruct", - "common", - "partition", - "active", - "asm", - "class", + "uint", + "uintBitsToFloat", + "umulExtended", + "uniform", "union", - "enum", - "typedef", - "template", - "this", - "resource", - "goto", - "inline", - "noinline", - "public", - "static", - "extern", - "external", - "interface", - "long", - "short", - "half", - "fixed", + "unpackHalf2x16", + "unpackSnorm2x16", + "unpackSnorm4x8", + "unpackUnorm2x16", + "unpackUnorm4x8", "unsigned", - "superp", - "input", - "output", - "hvec2", - "hvec3", - "hvec4", - "fvec2", - "fvec3", - "fvec4", - "sampler3DRect", - "filter", - "sizeof", - "cast", - "namespace", + "usampler1D", + "usampler1DArray", + "usampler2D", + "usampler2DArray", + "usampler2DMS", + "usampler2DMSArray", + "usampler2DRect", + "usampler3D", + "usamplerBuffer", + "usamplerCube", + "usamplerCubeArray", "using", - "main", + "usubBorrow", + "uvec2", + "uvec3", + "uvec4", + "varying", + "vec2", + "vec3", + "vec4", + "void", + "volatile", + "while", + "writeonly", ];