This series is several commits from our in-progress D3D12/DXIL backend. We've been able to use the resulting NIR to generate DXIL that can run real-world kernels that use images, including the full OpenCL 1.2 CTS.
High-level, the series deals with:
- OpenCL images are untyped (void return), while loads/stores are typed. This adds untyped images to the GLSL type system, and adds type information to the deref load/store intrinsics. Note that if the CL code called the
read_imagefunction and passed a sampler, this ends up constructing a
SampledImageand therefore converting the instruction to a
texop, rather than a read/write intrinsic. That means that backends will need to deal with tex ops pointing to images rather than samplers.
- There's already some logic in vtn for dealing with passing images/samplers/sampled images through functions, but some minor tweaks were needed to deal with the fact that the kernel entrypoint wrapper wants to use
inputvariables, and how it ends up passing parameters. My strong preference here is to keep the variables as
input, since it enables us to match variables to kernel argument metadata more easily.
- It adds some new intrinsics to deal with CL-specific format queries. It also handles
ImageSizeLodbeing generated for size queries against CL images.
- Literal samplers (
OpConstantSampler) need to be handled. This series generates
uniformvariables with the sampler properties stored in the variable's data.
It's based on !6396 (merged).