The depth bounds test works (#82); faster defaults; textures are on the card before the character bake; one host copy per placed texture

- The depth bounds test (#82 by Kaivyyy, as is): a pipeline that enables
  it is made from a DEPTH_STENCIL1 stream under its own library name, and
  the title's OMSetDepthBounds reaches the host list. Before, such draws
  passed at every depth. On the test machine (RTX 4070) the first room is
  lit by its lamp for the first time: walls, table, bunks.
- Defaults: what shaders wrote is copied back by a thread of its own
  (stage 2), wide copy-back, card copies from 1 MiB up to 1,024 MB, and
  256 lists in the air. About 230 ms a frame where it was about 400.
  Off: VICTORY_RELAY=0, VICTORY_WIDE_BACK=0, VICTORY_CARD_BUFFERS_MIN_MB=16
  VICTORY_CARD_BUFFERS_MB=512, VICTORY_LATE_WAIT_LISTS=128.
- Textures picked by index are uploaded while loading and before a draw of
  the title's decoration bake, which samples them by index and runs once
  (VICTORY_EARLY_TEXTURES_MS, VICTORY_BAKE_TEXTURES_MS; 0 turns each off).
- Placed textures are keyed without the filler words of their description:
  two views that differed only there each had a host copy
  (VICTORY_PLACED_FILLER=1 keeps the old key).
- VICTORY_TEXTURE_ROOM_PERCENT (90, unchanged) sets how full the card may
  get before textures picked by index wait.

Known: the first room's walls are still missing in some launches, and
shaded areas are too dark (the bounce light has no ray-tracing structure
to trace yet).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
fxcelessandClaude Fable 5.2 committed 2026-11-24 20:22:06 -05:00
1 parent 8f80e08663
commit d8bd2af52e
8 files changed
+761 -76

No files matched your search

+5 -12
View File
@@ -1433,17 +1433,6 @@ extern "system" fn allocate_upload(this: This, size: u64, alignment: u64) -> *mu
/// nothing returned.
extern "system" fn ignored_state(_: This) {}
/// Depth bounds `(min, max)`.
/// shortcut: not set on the host list (no host pipeline of ours enables
/// the test, `pipeline::host`); the first values are logged, so a run
/// shows whether the title uses the test at all.
extern "system" fn depth_bounds(_: This, min: f32, max: f32) {
static SEEN: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(0);
if SEEN.fetch_add(1, std::sync::atomic::Ordering::Relaxed) < 8 {
tracing::info!(min, max, "the title sets depth bounds, which the host is not given");
}
}
/// The title's draw state (decision 0007, step 3), kept for its draws or
/// set on the host list at once. Without a host GPU these do nothing.
#[cfg(windows)]
@@ -1486,6 +1475,9 @@ mod state {
pub(super) extern "system" fn stencil_ref(this: This, reference: u32) {
with_state(this, |list, s| s.set_stencil_ref(list, reference));
}
pub(super) extern "system" fn depth_bounds(this: This, min: f32, max: f32) {
with_state(this, |list, s| s.set_depth_bounds(list, min, max));
}
pub(super) extern "system" fn heaps(this: This, count: u32, heaps: *const This) {
with_state(this, |_, s| s.set_heaps(items(heaps, count)));
}
@@ -1653,6 +1645,7 @@ mod state {
pub(super) use super::ignored_state as index_buffer;
pub(super) use super::ignored_state as scissors;
pub(super) use super::ignored_state as stencil_ref;
pub(super) use super::ignored_state as depth_bounds;
pub(super) use super::ignored_state as targets;
pub(super) use super::ignored_state as topology;
pub(super) use super::ignored_state as vertex_buffers;
@@ -2097,7 +2090,7 @@ const METHODS: [(usize, *const ()); 52] = [
(52, clear_rtv as *const ()), // 0x1a0
(59, execute_indirect as *const ()), // 0x1d8 indirect
(60, copy_memory as *const ()), // 0x1e0
(68, depth_bounds as *const ()), // 0x220 depth bounds
(68, state::depth_bounds as *const ()), // 0x220 depth bounds
(69, write32 as *const ()), // 0x228
(70, write64 as *const ()), // 0x230
(71, wait_value as *const ()), // 0x238, 32 bits