Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/leonida-gpu/src/draw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2574,7 +2574,7 @@ impl State {
let draws: u32 = census.1.values().sum();
if draws > 0 {
let mut rects: Vec<([i32; 4], u32)> = census.1.iter().map(|(r, n)| (*r, *n)).collect();
rects.sort_unstable_by(|a, b| b.1.cmp(&a.1));
rects.sort_unstable_by_key(|r| std::cmp::Reverse(r.1));
let scissors: Vec<String> = rects
.iter()
.take(5)
Expand Down
4 changes: 2 additions & 2 deletions crates/leonida-gpu/src/fpsbox.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ pub(crate) fn draw(host: &crate::host::Host, list: &ID3D12GraphicsCommandList, b
made.clear();
}
let key = (tenths, format.0, scale);
if !made.contains_key(&key) {
if let std::collections::hash_map::Entry::Vacant(e) = made.entry(key) {
let (w, h, lit) = bitmap(&text(tenths), scale);
let pitch = (w as usize * bytes).next_multiple_of(D3D12_TEXTURE_DATA_PITCH_ALIGNMENT as usize);
let Some((buffer, data)) = host.shared_buffer((pitch * h as usize) as u64) else {
Expand All @@ -185,7 +185,7 @@ pub(crate) fn draw(host: &crate::host::Host, list: &ID3D12GraphicsCommandList, b
pixel(format, lit[y * w as usize + x], &mut out[at..at + bytes]);
}
}
made.insert(key, Made { buffer, width: w, height: h, pitch: pitch as u32 });
e.insert(Made { buffer, width: w, height: h, pitch: pitch as u32 });
}
let Some(m) = made.get(&key) else {
return;
Expand Down
1 change: 1 addition & 0 deletions crates/leonida-gpu/src/indirect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2450,6 +2450,7 @@ void work() {
heap_pairs: [[Option<ID3D12DescriptorHeap>; 2]; 2],
tables: [D3D12_GPU_DESCRIPTOR_HANDLE; 2],
targets: [D3D12_CPU_DESCRIPTOR_HANDLE; 2],
#[allow(dead_code)] // TODO C-2: pending upstream VIctory 4ab20fc
depth_written: D3D12_CPU_DESCRIPTOR_HANDLE,
depth_tested: D3D12_CPU_DESCRIPTOR_HANDLE,
stamps: ID3D12QueryHeap,
Expand Down
2 changes: 1 addition & 1 deletion crates/leonida-gpu/src/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ fn send_joined(joined: &mut Joined) {
let sent = JOINED[1].fetch_add(1, Ordering::Relaxed) + 1;
JOINED[2].fetch_add(order.len() as u64, Ordering::Relaxed);
JOINED[3].fetch_add(joined.signals.len() as u64, Ordering::Relaxed);
if sent % 2048 == 0 {
if sent.is_multiple_of(2048) {
let n: Vec<u64> = JOINED.iter().map(|n| n.swap(0, Ordering::Relaxed)).collect();
tracing::info!(
"parts joined (LEONIDA_JOIN_PARTS=1): {} parts went to the host in {} submissions ({:.1} parts, {:.1} lists each), {} signals delivered behind them, {} waits passed for a write of a part not sent yet",
Expand Down
2 changes: 2 additions & 0 deletions crates/leonida-gpu/src/resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2550,10 +2550,12 @@ static PLACED_TWINS: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64

/// See [`PLACED_TWINS`].
#[cfg(windows)]
#[allow(dead_code)] // read by the copystat memory log (diagnostics builds)
pub(crate) fn placed_filler_twins() -> u64 {
PLACED_TWINS.load(std::sync::atomic::Ordering::Relaxed)
}


/// The bytes of title memory a texture with the resource description
/// `desc` (as words) takes where the title placed it; `None` for a buffer
/// and for a description without a size.
Expand Down
4 changes: 2 additions & 2 deletions crates/leonida-gpu/src/shadow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2800,7 +2800,7 @@ impl Shadow {
}
OWN_WRITES[1].fetch_add(bytes.len() as u64, Ordering::Relaxed);
let n = OWN_WRITES[0].fetch_add(1, Ordering::Relaxed) + 1;
if n % 16384 == 0 {
if n.is_multiple_of(16384) {
tracing::info!(
"what shaders wrote, stored through views of our own (LEONIDA_BACK_OWN_VIEW=1), since the start: {n} stretches {} MB, {} pages noted current for the copy that wrote them (not copied in again), {} stretches written the old way; with LEONIDA_BACK_OWN_CHECK=1: {} stores the title's address did not show, {} pages noted current whose CPU side differs from title memory, {} of those with the guard clean",
OWN_WRITES[1].load(Ordering::Relaxed) >> 20,
Expand Down Expand Up @@ -3322,7 +3322,7 @@ impl Shadow {
COPY_CHANGED[1].fetch_add(sent as u64, Ordering::Relaxed);
COPY_CHANGED[2].fetch_add(stretches.len() as u64, Ordering::Relaxed);
let calls = COPY_CHANGED[3].fetch_add(1, Ordering::Relaxed) + 1;
if calls % 65536 == 0 {
if calls.is_multiple_of(65536) {
tracing::info!(
"copies in the card's memory, refreshed by what differs (LEONIDA_COPY_CHANGED=1), since the start: {calls} refreshes read {} MB of title memory the title had written to; {} MB of it differed from the copy and went on to the card, in {} stretches",
COPY_CHANGED[0].load(Ordering::Relaxed) >> 20,
Expand Down
Loading