Shaders: PSV0 says a pixel shader runs per sample when an input does

The pipeline state validation part left PSInfo.SampleFrequency at 0.
DXC sets it when a pixel input is interpolated per sample (modes 6 and
7, which our lowering gives to PERSP_SAMPLE and LINEAR_SAMPLE
barycentrics) or is SV_SampleIndex, and the validator compares the
whole runtime info with what it derives from the module.

The flag is now set for such pixel shaders.
This commit is contained in:
Duff committed 2026-11-24 03:46:04 +01:00
1 parent d2a4bae1f4
commit 404d7fd9bd
2 files changed
+85

No files matched your search

@@ -161,6 +161,15 @@ pub(crate) fn psv(p: &Psv) -> Vec<u8> {
u32s(&mut out, &[48]);
let mut info = [0u8; 48];
info[0] = u8::from(p.flag);
if p.stage == 0 {
// PSInfo.SampleFrequency: an input interpolated per sample, or the
// sample index.
info[1] = u8::from(
p.inputs
.iter()
.any(|e| matches!(e.interp, 6 | 7) || e.kind == 12),
);
}
let (min, max) = p.wave_size.map_or((0, u32::MAX), |n| (n, n));
info[16..20].copy_from_slice(&min.to_le_bytes());
info[20..24].copy_from_slice(&max.to_le_bytes());