mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-13 02:41:28 +00:00
This transform converts compound assignment statements into regular assignments, hoisting LHS expressions and converting for-loops and else-if statements if necessary. The vector-component case needs particular care, as we cannot take the address of a vector component. We need to capture a pointer to the whole vector and also the component index expression: // Before vector_array[foo()][bar()] *= 2.0; // After: let _vec = &vector_array[foo()]; let _idx = bar(); (*_vec)[_idx] = (*_vec)[_idx] * 2.0; Bug: tint:1325 Change-Id: I8b9b31fc9ac4b3697f954100ceb4be24d063bca6 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/85282 Reviewed-by: Antonio Maiorano <amaiorano@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>