microsoft / DirectXShaderCompiler

This repo hosts the source for the DirectX Shader Compiler which is based on LLVM/Clang.
Other
3.11k stars 697 forks source link

[SPIR-V] Fix image write to unknown format #6984

Closed Keenuts closed 4 weeks ago

Keenuts commented 1 month ago

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 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