But copy_propagation_transform_swizzle() only does something useful when a variable has components from different sources *and* those components aren't all constant. Unless I'm mistaken that is.
The (a) part of copy_propagation_transform_swizzle() also takes care of replacing with a constant when only the used components of the swizzle's load are constants.
A useful case for (a) is: ``` 1: Q 2: indices = @1 3: 1 4: indices.x = @3 5: indices // <-- is not completely constant (indices.y is Q.y) 6: @5.x // <-- we want to replace it with 1.0 ``` or the tests that start failing once you remove it.
On the other hand I am not sure if (b) is important for any application or test. Removing (b) avoids the infinite loops and no test fails after you remove it, so if this MR (reasonably) makes you nervous, I wouldn't mind on just getting rid of (b) as the quick fix, I have the commit ready https://gitlab.winehq.org/fcasas/vkd3d/-/commit/b7436a1b0aeacab99ca244eb986a... .
But I will try to write a proper fix using your and gio's comments.