Recording: a lock a descriptor slot, a thread's own answers about buffers, tables left as they are when nothing changed

Timeline waits-1 (dorm, 78 ms): the title's render thread stands 20 to 30 ms
a frame at one recording job and the rest at others; recording is the
critical path, and our list calls are 95 % of it. Profile waits-1, the five
recording threads: 21 % contended locks, 11 % HostHeap::keep, 17 % readable,
7 % the look-up of buffers, 8 % clocks and counters of ours.

VICTORY_QUICK_FIND=0 and VICTORY_READY_ONCE=0 go back; counters of the
diagnostics by thread, a coarse clock for what is noted per texture and slot.
VICTORY_AB=<s>,<switches> turns switches on and off while the title runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
localandClaude Opus 5.5 committed 2026-11-25 08:14:21 -06:00
1 parent 336f613986
commit a1bdba4cf9
9 files changed
+405 -61

No files matched your search

+17 -1
View File
@@ -1175,6 +1175,9 @@ pub(crate) struct HostTexture {
pub(crate) grown: std::sync::atomic::AtomicBool,
/// What the last submitted upload put in it.
pub(crate) holds: std::sync::Arc<Holds>,
/// The texture's flags (asked once: the runtime takes 100 ns to say, and
/// every texture of every draw is asked about).
flags: u32,
}
/// What a host copy was filled with last: the first level of it and the
@@ -1625,7 +1628,10 @@ fn hosted(this: This, make: bool) -> Option<Made> {
// are made before the next submission runs.
crate::descriptor::texture_made(this as usize);
}
r.host.used.store(crate::host::moment(), Relaxed);
let now = crate::host::moment();
if r.host.used.load(Relaxed) != now {
r.host.used.store(now, Relaxed);
}
made.clone()
}
@@ -2266,9 +2272,15 @@ fn host_bytes(texture: &windows::Win32::Graphics::Direct3D12::ID3D12Resource) ->
#[cfg(windows)]
impl HostTexture {
pub(crate) fn flags(&self) -> u32 {
self.flags
}
fn new(texture: windows::Win32::Graphics::Direct3D12::ID3D12Resource, state: u32) -> HostTexture {
use std::sync::atomic::Ordering::Relaxed;
let bytes = host_bytes(&texture);
// SAFETY: a live texture.
let flags = unsafe { texture.GetDesc() }.Flags.0 as u32;
HOST_TEXTURES[0].fetch_add(1, Relaxed);
HOST_TEXTURES[1].fetch_add(bytes, Relaxed);
HostTexture {
@@ -2281,6 +2293,7 @@ impl HostTexture {
serial: SERIAL.fetch_add(1, Relaxed) + 1,
grown: Default::default(),
holds: Default::default(),
flags,
}
}
@@ -2292,6 +2305,8 @@ impl HostTexture {
tiled: crate::tiles::Tiled,
) -> HostTexture {
HOST_TEXTURES[0].fetch_add(1, std::sync::atomic::Ordering::Relaxed);
// SAFETY: a live texture.
let flags = unsafe { texture.GetDesc() }.Flags.0 as u32;
HostTexture {
texture,
state: std::sync::atomic::AtomicU32::new(state),
@@ -2302,6 +2317,7 @@ impl HostTexture {
serial: SERIAL.fetch_add(1, std::sync::atomic::Ordering::Relaxed) + 1,
grown: Default::default(),
holds: Default::default(),
flags,
}
}
}