Skip to content

Remaining kernel image support

This series adds support for the remaining two pieces of missing image functionality: samplers declared as constant in the program, and samplers with non-normalized coordinates.

For constant samplers, after talking with @jekstrand and @karolherbst I decided to promote them straight to NIR variables, with constant initializers. From the DXIL POV, that means they look identical to kernel argument samplers. The data in the constant initializer is reflected out to the caller of the compiler. It's also used to inform the non-normalized coordinate lowering pass for constant samplers.

Since D3D samplers all require normalized coordinates, I added per-sampler metadata that can be passed from the runtime to indicate if the sampler being bound needs normalized coordinates or not. If it needs non-normalized coordinates, the texture dimensions are retrieve and used to normalize.

There's also a fix in here for serializing/deserializing NIR which came from SPIR-V with void samplers, as well as a fix for tex serialization on MSVC (with signed enums).

Edited by Jesse Natalie

Merge request reports