By default, texture format is guessed from the type. But the vk::image_format attribute can be added to specify it.
The unknown value was used to convey no format selected, and require the guess to happen.
This made selecting unknown as value impossible.
Once the optional added, we have a new issue:
The format setup relied on the legalizer.
load/stores are done using the default format, then we fix it, then we use the legalizer to propagate the format fix to all users.
The capability visitor is running before the legalizer, meaning it can look at a non-fixed load, which still carries the old type.
The way to solve this is to remove this logic, and move the capability addition/deletion to the capability_trimming pass, run after legalization.
By default, texture format is guessed from the type. But the
vk::image_format
attribute can be added to specify it. Theunknown
value was used to conveyno format selected
, and require the guess to happen. This made selectingunknown
as value impossible.Once the optional added, we have a new issue:
The capability visitor is running before the legalizer, meaning it can look at a non-fixed load, which still carries the old type. The way to solve this is to remove this logic, and move the capability addition/deletion to the capability_trimming pass, run after legalization.
Fixes #6981