Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
ec83690
Stop inferring descriptor slots from GPU fault addresses
EatCodeSleep2 Nov 24, 2026
fd59489
GPU: upload a host-copied texture again once the title writes its memory
powplusplus Nov 24, 2026
084d8d2
Shaders: PSV0 and signatures laid out as the validator expects
powplusplus Nov 24, 2026
2935538
Shaders: mask dwords at data joins, and s_bcnt1's SCC of a mask
permadiego Nov 24, 2026
02ea74c
Loader: fix 4 bounds/overflow bugs in tls.rs and stacks.rs with unit …
geiyiliyabumo Nov 24, 2026
a4a94d7
HLE: fix self-closing XML element body parsing in runtime.rs and add …
geiyiliyabumo Nov 24, 2026
8466edd
HLE: reject null out in QueryApiImpl before lookup and add xgamerunti…
geiyiliyabumo Nov 24, 2026
f4c4bd4
GPU: fix 3 encoding, fallback, and slice-panic bugs in shader_cache.r…
geiyiliyabumo Nov 24, 2026
98b761b
Loader: fix 4 bounds and cleanup bugs in windows.rs with unit tests
geiyiliyabumo Nov 24, 2026
9ffb7a1
Shaders: fix 4 DXIL validator bugs and add synthetic container/valida…
geiyiliyabumo Nov 24, 2026
e3c9dd0
GPU: guard zero/overflowing stride in expand_rects and add primitive.…
geiyiliyabumo Nov 24, 2026
ef0c3e9
GPU: validate null args in create_deserializer to prevent d3d12 AV an…
geiyiliyabumo Nov 24, 2026
649c6e5
GPU: validate input layouts and aligned vertex offsets in pipeline/ho…
geiyiliyabumo Nov 24, 2026
bcce91f
Shaders: fix GFX10 independent a16/g16 gradient dword packing in fiel…
geiyiliyabumo Nov 24, 2026
420189a
Improve shadow buffer allocation diagnostics
chiragmadhuprasad Nov 24, 2026
643fc6d
HLE: avoid misaligned f32 output slice in XApu
divyeshganta Nov 24, 2026
a2e532d
GPU: the copies timing no longer counts the flush before a title copy…
neonbyte1 Nov 24, 2026
13b1beb
Document experimental compatibility findings
chiragmadhuprasad Nov 24, 2026
312ff56
Report bound descriptor tables accurately in DRED breadcrumbs
Nov 24, 2026
591932a
Grow DirectStorage BCPack intermediates as zlib inflates
Nov 24, 2026
b4e4647
GPU: a half exactly halfway between two rounds to the even one, not up
BastienRodz Nov 24, 2026
57d00fd
Shaders: pre-validate DXBC headers before dxil.dll and trim load erro…
geiyiliyabumo Nov 24, 2026
ae0b48e
Shaders: align Lower::image VGPR unpacking with a16/g16 gradient rules
geiyiliyabumo Nov 24, 2026
f8aeeec
GPU: report retained loose shadow memory
chiragmadhuprasad Nov 24, 2026
d76cfdd
GPU: report retained placed texture allocations
chiragmadhuprasad Nov 24, 2026
f3233fc
GPU: count descriptor-held resources for diagnostics
chiragmadhuprasad Nov 24, 2026
e649d5b
GPU: log retained mirror and descriptor cache sizes
chiragmadhuprasad Nov 24, 2026
07b6d16
GPU: account for descriptor resources when heaps are dropped
chiragmadhuprasad Nov 24, 2026
185845d
GPU: tidy retained mirror diagnostic
chiragmadhuprasad Nov 24, 2026
ce8bbaf
GPU: report failed shadow allocations with title addresses
chiragmadhuprasad Nov 24, 2026
4867761
GPU: report registered shadow cache size
chiragmadhuprasad Nov 24, 2026
4b632f1
GPU: specify shadow cache counter types
chiragmadhuprasad Nov 24, 2026
fee820b
GPU: track shadow buffer resource state
chiragmadhuprasad Nov 24, 2026
f8479d3
GPU: track shadow buffer transitions per command list
chiragmadhuprasad Nov 24, 2026
364b5f9
GPU: add shadow buffer state barriers
chiragmadhuprasad Nov 24, 2026
d8b8f9b
GPU: transition shadow buffers before draw and shader use
chiragmadhuprasad Nov 24, 2026
62a3cbc
GPU: track indirect shadow buffer state changes
chiragmadhuprasad Nov 24, 2026
f9afc30
GPU: track indirect argument shadow states
chiragmadhuprasad Nov 24, 2026
92b4e2f
GPU: handle other shader resource kinds in state tracking
chiragmadhuprasad Nov 24, 2026
490b63f
GPU: keep indirect failure path state in sync
chiragmadhuprasad Nov 24, 2026
2d50e8a
Prepare shadow state preludes in submission order
chiragmadhuprasad Nov 24, 2026
1a7ad95
Remove obsolete per-list timing switch
chiragmadhuprasad Nov 24, 2026
a19f38d
Restore GPU timing diagnostics helper
chiragmadhuprasad Nov 24, 2026
c3beb4a
Trace shadow resource state transitions
chiragmadhuprasad Nov 24, 2026
e0cc496
Merge branch 'pr-1238' into devin/correctness-wave-5
Personed Nov 24, 2026
cd2783e
Merge branch 'pr-1236' into devin/correctness-wave-5
Personed Nov 24, 2026
6f50df0
Merge branch 'pr-1220' into devin/correctness-wave-5
Personed Nov 24, 2026
291e228
Merge branch 'pr-1217' into devin/correctness-wave-5
Personed Nov 24, 2026
82f0476
Merge branch 'pr-1214' into devin/correctness-wave-5
Personed Nov 24, 2026
d3d3981
Merge branch 'pr-1209' into devin/correctness-wave-5
Personed Nov 24, 2026
c8d41d7
Merge branch 'pr-1204' into devin/correctness-wave-5
Personed Nov 24, 2026
345cffd
Merge branch 'pr-1202' into devin/correctness-wave-5
Personed Nov 24, 2026
af1dec4
Merge branch 'pr-1201' into devin/correctness-wave-5
Personed Nov 24, 2026
101683e
Merge branch 'pr-1200' into devin/correctness-wave-5
Personed Nov 24, 2026
57b103d
Merge branch 'pr-1199' into devin/correctness-wave-5
Personed Nov 24, 2026
7642152
Merge branch 'pr-1192' into devin/correctness-wave-5
Personed Nov 24, 2026
f94cc2a
Merge branch 'pr-1233' into devin/correctness-wave-5
Personed Nov 24, 2026
2f7f268
Merge branch 'pr-1227' into devin/correctness-wave-5
Personed Nov 24, 2026
1b9556d
Merge branch 'pr-1210' into devin/correctness-wave-5
Personed Nov 24, 2026
9191a78
Merge branch 'pr-1208' into devin/correctness-wave-5
Personed Nov 24, 2026
8ae0421
Merge branch 'pr-1207' into devin/correctness-wave-5
Personed Nov 24, 2026
f5661ef
Merge branch 'pr-1206' into devin/correctness-wave-5
Personed Nov 24, 2026
aa36e03
Merge branch 'pr-1196' into devin/correctness-wave-5
Personed Nov 24, 2026
ed34099
wave-5 fixups: rsrc2/HostShader fields in tests, clippy lints
Personed Nov 24, 2026
358c4b1
Strip UTF-8 BOMs from ported docs
Personed Nov 24, 2026
5cd22b9
Enumerate runs for diagnostics slow-list reporting
Personed Nov 24, 2026
cfdf22f
Align PSV0/signature tests with validator-exact encoding (no name ded…
Personed Nov 24, 2026
51d121b
Keep and drain write-watched test allocations so stale watch state ca…
Personed Nov 24, 2026
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
10 changes: 10 additions & 0 deletions crates/victory-gpu/src/copystat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,16 @@ pub(crate) fn log(frames: f64) {
mb(c[C::TexHashed as usize]),
mb(c[C::TexChanged as usize]),
);
let (registered_count, registered_bytes, loose_count, loose_bytes) =
crate::shadow::cache_stats();
let (placed_count, placed_bytes) = crate::resource::placed_texture_cache_stats();
let kept_slots = crate::descriptor::host::kept_slots();
tracing::info!(
"retained GPU mirrors: {registered_count} registered shadows ({:.1} MiB); {loose_count} loose shadows ({:.1} MiB); {placed_count} placed textures ({:.1} MiB estimated); {kept_slots} descriptor slots holding resources",
registered_bytes as f64 / (1 << 20) as f64,
loose_bytes as f64 / (1 << 20) as f64,
placed_bytes as f64 / (1 << 20) as f64,
);
let ranges = RANGES.lock().unwrap_or_else(|e| e.into_inner()).take();
let mut ranges: Vec<_> = ranges.into_iter().flatten().collect();
ranges.sort_by_key(|&(_, (_, bytes, _, _))| std::cmp::Reverse(bytes));
Expand Down
75 changes: 40 additions & 35 deletions crates/victory-gpu/src/descriptor/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ use windows::Win32::Graphics::Dxgi::Common::*;
use super::{VIEW_TAG, View, view_at};
use crate::host::host;

/// Number of shader-visible descriptor slots retaining a host resource.
#[cfg(feature = "diagnostics")]
static KEPT_SLOTS: std::sync::atomic::AtomicUsize = std::sync::atomic::AtomicUsize::new(0);

#[cfg(feature = "diagnostics")]
pub(crate) fn kept_slots() -> usize {
KEPT_SLOTS.load(std::sync::atomic::Ordering::Relaxed)
}

pub(crate) struct HostHeap {
pub(crate) heap: ID3D12DescriptorHeap,
cpu: usize,
Expand Down Expand Up @@ -87,33 +96,6 @@ pub(crate) fn console_words(view: &View) -> [u32; 8] {
]
}

/// Host heaps' GPU ranges (start, bytes, bytes per slot, sampler), for
/// device-removed reports: a shader indexing a heap past its end faults.
static GPU_RANGES: Mutex<Vec<(u64, u64, u64, bool)>> = Mutex::new(Vec::new());

/// For device-removed reports: where host GPU address `va` lies against
/// the host descriptor heaps.
pub(crate) fn near_heaps(va: u64) -> String {
let ranges = GPU_RANGES.lock().unwrap_or_else(|e| e.into_inner());
let mut text = String::new();
for &(start, bytes, step, sampler) in ranges.iter() {
let kind = if sampler { "sampler" } else { "view" };
let place = if va < start {
format!("{:#x} below", start - va)
} else if va < start + bytes {
format!("inside, slot {}", (va - start) / step)
} else {
format!(
"{:#x} past its end (slot {})",
va - start - bytes,
(va - start) / step
)
};
text.push_str(&format!("; {kind} heap {start:#x}+{bytes:#x}: {place}"));
}
text
}

/// The host's limit for shader-visible view heaps on resource binding
/// tiers 1 and 2; tier 3 hardware may take more.
const PORTABLE_VIEWS: u32 = 1_000_000;
Expand Down Expand Up @@ -188,14 +170,12 @@ impl HostHeap {
)
};
tracing::debug!(count, sampler, "host descriptor heap");
// SAFETY: a live shader-visible heap.
let gpu = unsafe { heap.GetGPUDescriptorHandleForHeapStart().ptr };
GPU_RANGES.lock().unwrap_or_else(|e| e.into_inner()).push((
gpu,
u64::from(count + extra) * u64::from(step),
u64::from(step),
sampler,
));
// DRED identifies matching allocations by name. Descriptor handles
// have their own increment and cannot locate a faulting GPU VA.
crate::host::name(&heap, || {
let kind = if sampler { "sampler" } else { "view" };
format!("{kind} descriptor heap ({} slots)", count + extra)
});
let words = if sampler {
None
} else {
Expand Down Expand Up @@ -285,6 +265,22 @@ impl HostHeap {
}
}

impl Drop for HostHeap {
fn drop(&mut self) {
#[cfg(feature = "diagnostics")]
{
let retained = self
.kept
.get_mut()
.unwrap_or_else(|e| e.into_inner())
.iter()
.filter(|slot| slot.is_some())
.count();
KEPT_SLOTS.fetch_sub(retained, std::sync::atomic::Ordering::Relaxed);
}
}
}

/// A plain point sampler at `at`.
fn null_sampler(at: D3D12_CPU_DESCRIPTOR_HANDLE) {
let Some(host) = host() else { return };
Expand Down Expand Up @@ -435,6 +431,15 @@ impl HostHeap {
fn keep(&self, index: u32, resource: Option<ID3D12Resource>) {
let mut kept = self.kept.lock().unwrap_or_else(|e| e.into_inner());
if let Some(slot) = kept.get_mut(index as usize) {
#[cfg(feature = "diagnostics")]
if slot.is_some() != resource.is_some() {
use std::sync::atomic::Ordering::Relaxed;
if resource.is_some() {
KEPT_SLOTS.fetch_add(1, Relaxed);
} else {
KEPT_SLOTS.fetch_sub(1, Relaxed);
}
}
*slot = resource;
}
}
Expand Down
Loading
Loading