Skip to content

Commit

Permalink
[WGSL] Add missing constant functions
Browse files Browse the repository at this point in the history
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
tadeuzagallo committed Oct 24, 2023
1 parent 1c4271c commit 06afe2c
Show file tree
Hide file tree
Showing 5 changed files with 633 additions and 256 deletions.
Loading

0 comments on commit 06afe2c

Please sign in to comment.