Mostly complete kernel image support
This series adds support for:
- Declaring samplers in CLC and using
read_image[fiu](image, sampler, coords)
. - Calling
write_image[fiu](image, coords, value)
. This requires support for declaring non-buffer UAVs in DXIL. - Querying image dimensions. All variations of this function are collapsed by clang to the same SPIR-V op, so we just need to handle it in its
tex
and image intrinsic forms. The SPIRV-to-DXIL converter has a bug where it can producetex
ops with derefs to images instead of samplers, which is fixed here. - Querying image format properties. I've added new NIR intrinsics for these, which are lowered into loading kernel inputs.
- Support for typed buffers in the DXIL backend, needed for
texture1d_buffer_t
in OpenCL.
All of the new tests are compile-only, as I'm still planning to go for full end-to-end tests with the CLOn12 runtime rather than adding image support to this test harness. Preliminary end-to-end tests are now passing on top of this series.
I'm happy to split this into more, smaller MRs as necessary, but each individual series was small enough that lumping them seemed fine.
This series does not yet support:
- Constant samplers declared in kernels.
- Sampling with non-uniform addressing, which needs lowering to divide by the image dimensions.
Edited by Jesse Natalie