On Tue Oct 17 17:43:13 2023 +0000, Giovanni Mascellani wrote:
After playing a bit with the native compiler it seems that its algorithm for emitting `switch` is a little different:
- The `default` case is always written last; in particular, it is always
written, even if it is not present in the source code (in which case it only has a `break` instruction).
- The other cases are written in the same order they appear in the code
(this is probably less important; moreover, it already happens in your implementation).
- If the `default` case has other labels (as in `case 100: case 101:
default: return 0.0;`), they are dropped. In general we don't care about emitting the same exact code as native, and I doubt the TPF consumers in Wine care about those details, but native drivers might have come to depend on this details, and we want our shaders to be able to run there too, so I would try to have the same behavior.
Alright, I think all of that should be fixed now.