Shaders: VICTORY_WAVE_WHY=1 tells a translation's LDS past the host's 32 KiB

A console program may use up to 64 KiB of LDS a group; a D3D12 group has 32 KiB.
When the program's own LDS and the dwords the translation adds past it (the
halves' exchange, wave_base's counter, the console waves' meetings) do not fit,
the refusal said only "LDS for the console waves' meetings past the host's 32 KiB",
and other forms said nothing until the driver refused the pipeline.

With VICTORY_WAVE_WHY=1, a WAVE64-LDS line now gives the total, the program's own
dwords and what the translation added, e.g. for
vfx_triangleClip:CS_CollectTriangles_Meshlets (#6b82bc7d22016cb5):

  WAVE64-LDS 8369 dwords of the host's 8192: the program's own 8192, the translation's 177 ...

Output only; no translation changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FsQtBz4aDhUTip3jBagKEX
(cherry picked from commit c4b034ab4e09573e0188b4c77c87b277938c9f7b)
This commit is contained in:
fromrivertothesea authored and trustno1-coder committed 2026-11-27 17:29:35 -08:00
1 parent a12e0ae254
commit 4e533e79ee
1 file changed
+15
+15
View File
@@ -2708,6 +2708,21 @@ impl<'a> Lower<'a> {
let p = self.x.p;
// A host group has 32 KiB of LDS (D3D12): the program's LDS with the meetings' and
// exchanges' dwords past it must fit (`CS_CollectTriangles_Meshlets` uses all 32 KiB).
if self.s.lds_dwords > HOST_LDS_DWORDS && std::env::var_os("VICTORY_WAVE_WHY").is_some() {
// (the program's own LDS, then what the translation adds past it)
let own = match &self.x.native.io {
StageIo::Cs(cs) => cs.lds_bytes() / 4,
_ => 0,
};
eprintln!(
"WAVE64-LDS {} dwords of the host's {HOST_LDS_DWORDS}: the program's own {own}, the translation's {} (exchange {:?}, counter {:?}, meetings {:?})",
self.s.lds_dwords,
self.s.lds_dwords.saturating_sub(own),
self.exchange.as_ref().map(|e| e.0),
self.halves.or(self.ticket),
self.pairs,
);
}
if self.pairs.is_some() && self.s.lds_dwords > HOST_LDS_DWORDS {
return Err(unsupported(0, "LDS for the console waves' meetings past the host's 32 KiB"));
}