Skip to content

Draft: dzn: Lower shadow txb/txd to txl

DXIL does not currently have shadow bias/gradient sampling instructions. Right now we just emit a regular sample, but the shader fails to validate because we pass a handle to a comparison sampler. If instead, we lower these instructions to txl, we do have a shader model 6.7 instruction for that. However, the lowering produces a calculateLOD instruction that also references a comparison sampler, which still fails validation. But, at least the code in the shader is more or less doing the right thing.

The second-last patch allows us to use the "experimental shader models" feature, which bypasses the shader signing requirement. That allows us to run this shader without signing it to validate that it works. The final patch shows this fixing a large set of CTS fails; however, this patch should not be merged, because it'd give us a blind spot for other places where we're unintentionally producing shaders that don't validate.

Merge request reports