Streaming, copy queue, texture pools and a shader cache that survives rebuilds

Textures and staging cut from 64 MB blocks; a kept view per page section and
page lists read again until the title has filled them in; the GPU side told
when streamed bytes land; results fetched over the copy queue
(VICTORY_RELAY_COPY=1); the write-watch journal behind a reader-writer lock;
the shader cache keyed by the translator's sources and `victory shaders`;
helper lanes as in upstream 1733 (VICTORY_HELPER_OWN).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
localandClaude Opus 5.5 committed 2026-11-24 18:55:40 -06:00
1 parent 7f166af4f3
commit 9fea7434cd
20 files changed
+1629 -232

No files matched your search

+36 -1
View File
@@ -1016,6 +1016,12 @@ fn own_bits_on() -> bool {
*ON.get_or_init(|| std::env::var_os("VICTORY_WAVE_OWN_BITS").is_none_or(|v| v != "0"))
}
/// What the translator was told of the host, for a cache's key: the widest
/// wave and the view heap's limit.
pub fn host_settings() -> [u32; 2] {
[host_max_wave(), super::shader::view_heap_limit()]
}
pub(super) fn host_max_wave() -> u32 {
#[cfg(test)]
if let Some(lanes) = TEST_HOST_WAVE.get() {
@@ -4203,7 +4209,30 @@ impl<'a> Lower<'a> {
/// `x` in the first lane of this host wave where `guard` holds, and whether it has such a
/// lane: the console reads the first lane of EXEC, and a lane that got here with EXEC clear
/// (a guard, not a branch) is not one. With none, `x` of the wave's first lane here.
///
/// A helper lane of a pixel shader takes its own value: the console's whole-quad mode has
/// helper lanes in EXEC, so a waterfall loop serves them too, and the host's wave operations
/// leave them out. Once only helper lanes are left in such a loop none of them ever matched:
/// they ran to the iteration limit, and left with no sample for their quad's derivatives,
/// along every triangle's edges (upstream #908, the fix of #1733 for this tree's form).
fn first_lane(&mut self, x: V, guard: Option<V>) -> (V, V) {
let (first, any) = self.first_live_lane(x, guard);
if !self.s.pixel || !super::helper_own() {
return (first, any);
}
let helper = self.helper_lane();
let c = self.cur;
let yes = self.s.m.bool(true);
(self.s.m.select(c, helper, x, first), self.s.m.select(c, helper, yes, any))
}
/// Whether this lane of a pixel shader is a helper lane.
fn helper_lane(&mut self) -> V {
let i1t = self.s.t.i1;
self.s.op(self.cur, "isHelperLane.i1", Attr::ReadOnly, i1t, 221, &[])
}
fn first_live_lane(&mut self, x: V, guard: Option<V>) -> (V, V) {
let c = self.cur;
let i32t = self.s.t.i32;
self.s.flags |= flags::WAVE_OPS;
@@ -5823,7 +5852,13 @@ impl<'a> Lower<'a> {
if per_lane {
self.s.flags |= flags::WAVE_OPS;
let i32t = self.s.t.i32;
d = self.s.op(c, "waveReadLaneFirst.i32", Attr::NoUnwind, i32t, 118, &[d]);
let first = self.s.op(c, "waveReadLaneFirst.i32", Attr::NoUnwind, i32t, 118, &[d]);
d = if self.s.pixel && super::helper_own() {
let helper = self.helper_lane();
self.s.m.select(c, helper, d, first)
} else {
first
};
}
addr = self.s.m.bin(c, Bin::Add, addr, d);
}