src/compiler/translator/tree_ops/wgsl

Branch


Log

Author Commit Date CI Message
Matthew Denton 7b14dd73 2025-08-19T15:57:34 WGSL: RewriteMixedTypeMathExprs RewriteMixedTypeMathExprs: Some mixed-type arithmetic is legal in GLSL but not WGSL. Generate code to perform the arithmetic as specified in GLSL. Example: uvec2 x; uint y; x &= y; Is transformed into: x &= uvec(y); Also, mat2 x; int y; x += y; Is transformed into: x += mat2(float(y), float(y), float(y), float(y)) Bug: angleproject:42267100 Change-Id: I4a0ec1d9806b3331b4b1feff6fbe7c0f212f8120 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6862843 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Matthew Denton cfe2c8fe 2025-06-25T13:25:01 WGSL: RewriteMultielementSwizzle WGSL doesn't support assignments to multi-element swizzles. This is used in a lot of shader tests, so temporarily work around this with an AST traverser that splits these assignments into multiple assignments that only assign to single element swizzles. One special case is multiplication-by-a-matrix assignment: vec.xy *= mat; is converted to vec.x = (vec.xy * mat).x; vec.y = (vec.xy * mat).y; Bug: angleproject:392542001 Change-Id: I3f393039aae13eb3f2c5dc5e553f68eb03b6316d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6847280 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org>