Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WGSL] Add missing constant functions
https://bugs.webkit.org/show_bug.cgi?id=263554 rdar://117371037 Reviewed by Mike Wyrzykowski. Finish implementing constant functions for (nearly) all type declarations. This just leaves functions that operate on matrices and functions that return structs (e.g. modf), which are both currently unsupported. * Source/WebGPU/WGSL/ConstantFunctions.h: (WGSL::constantUnaryOperation): (WGSL::constantBinaryOperation): (WGSL::constantTernaryOperation): (WGSL::constantConstructor): (WGSL::constantVector): (WGSL::constantMatrix): (WGSL::constantAdd): (WGSL::constantMinus): (WGSL::constantMultiply): (WGSL::BINARY_OPERATION): (WGSL::UNARY_OPERATION): (WGSL::constantBitwiseOr): (WGSL::constantBitwiseAnd): (WGSL::constantVec2): (WGSL::constantVec3): (WGSL::constantVec4): (WGSL::constantAll): (WGSL::constantAny): (WGSL::constantSelect): (WGSL::TERNARY_OPERATION): (WGSL::constantCross): (WGSL::constantDeterminant): (WGSL::constantDistance): (WGSL::constantDot): (WGSL::constantLength): (WGSL::constantFaceForward): (WGSL::constantFma): (WGSL::constantFract): (WGSL::constantFrexp): (WGSL::constantInsertBits): (WGSL::constantInverseSqrt): (WGSL::constantLdexp): (WGSL::constantModf): (WGSL::constantNormalize): (WGSL::constantQuantizeToF16): (WGSL::constantReflect): (WGSL::constantRefract): (WGSL::constantTranspose): (WGSL::constantPow): Deleted. (WGSL::constantDivide): Deleted. (WGSL::constantEqual): Deleted. (WGSL::constantNotEqual): Deleted. (WGSL::constantLt): Deleted. (WGSL::constantLtEq): Deleted. (WGSL::constantGt): Deleted. (WGSL::constantGtEq): Deleted. (WGSL::constantNot): Deleted. (WGSL::constantOr): Deleted. (WGSL::constantAnd): Deleted. (WGSL::constantBitwiseNot): Deleted. (WGSL::constantBitwiseXor): Deleted. (WGSL::constantBitwiseShiftLeft): Deleted. (WGSL::constantBitwiseShiftRight): Deleted. (WGSL::constantBool): Deleted. (WGSL::constantI32): Deleted. (WGSL::constantU32): Deleted. (WGSL::constantF32): Deleted. * Source/WebGPU/WGSL/ConstantValue.h: (WGSL::ConstantValue::isVector const): (WGSL::ConstantValue::toVector const): * Source/WebGPU/WGSL/TypeDeclarations.rb: * Source/WebGPU/WGSL/generator/main.rb: Canonical link: https://commits.webkit.org/269721@main
- Loading branch information