Argument clamps in batches (VICTORY_INDIRECT_BATCH)

One pass clamps the arguments of all indirect executions between two
points where they may change; its jobs are in upload memory that is filled
while the list is recorded. The replayed frame: 2,355 clamps become 980
passes, 86.1 -> 77.7 ms; with VICTORY_INDIRECT_BATCH=2 133 passes,
84.6 -> 75.3 ms.

Replay: --batch-clamps, --only-buffers, --listing; --compare runs turn by
turn.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
localandClaude Opus 5.5 committed 2026-11-24 22:10:47 -06:00
1 parent da89c8a5a9
commit ce3c03a801
9 files changed
+1492 -53

No files matched your search

+12 -1
View File
@@ -742,6 +742,9 @@ extern "system" fn barrier(this: This, count: u32, barriers: *const Barrier) ->
if let Some(list) = host_list(this)
&& !barriers.is_null()
{
if count > 0 {
with_state(this, |_, state| state.synced());
}
// SAFETY: the title passes `count` barriers.
let barriers = unsafe { std::slice::from_raw_parts(barriers, count as usize) };
let mut host: Vec<Barrier> = barriers
@@ -1396,7 +1399,14 @@ extern "system" fn set_pipeline(this: This, pipeline: This) {
/// bottom of the pipe `(flags, control, address, size)`. Host lists order
/// their own work and every submission is waited for, so there is nothing
/// to do.
extern "system" fn sync(_: This, _flags: u32, _control: u32, _address: u64, _size: u64) {}
/// (Arguments may be what earlier shaders wrote from here on:
/// `State::synced`.)
extern "system" fn sync(this: This, _flags: u32, _control: u32, _address: u64, _size: u64) {
#[cfg(windows)]
with_state(this, |_, state| state.synced());
#[cfg(not(windows))]
let _ = this;
}
/// Reset with console flags `(allocator, pipeline, flags)`; the flags only
/// tune the console's command memory.
@@ -1943,6 +1953,7 @@ extern "system" fn barrier_groups(this: This, count: u32, _groups: *const u8) {
&& let Some(list) = host_list(this)
{
use windows::Win32::Graphics::Direct3D12::D3D12_RESOURCE_BARRIER;
with_state(this, |_, state| state.synced());
// SAFETY: the same layout; no resource named.
let barrier = unsafe { std::mem::transmute::<Barrier, D3D12_RESOURCE_BARRIER>(UAV_BARRIER) };
// SAFETY: an open list.