Merge local/replay: frame recorder and replayer
Co-Authored-By: Claude Opus 5.5 <[email protected]> # Conflicts: # apps/victory/src/main.rs
This commit is contained in:
commit
eb50022824
20 files changed
+12602
-7
No files matched your search
@@ -602,6 +602,9 @@ fn create() -> windows::core::Result<Host> {
|
||||
D3D12CreateDevice(None, D3D_FEATURE_LEVEL_12_0, &mut device)?;
|
||||
}
|
||||
let device = device.ok_or_else(windows::core::Error::empty)?;
|
||||
// Before anything is made with it (`VICTORY_RECORD`).
|
||||
#[cfg(feature = "diagnostics")]
|
||||
crate::replay::record::from_env(&device);
|
||||
// `VICTORY_D3D12_BACKGROUND=0`: the runtime's background work (the
|
||||
// driver compiling shaders again on the "D3D Background Thread"s,
|
||||
// for minutes after pipelines were made or loaded) is switched off.
|
||||
@@ -1295,8 +1298,21 @@ fn timing() -> bool {
|
||||
}
|
||||
|
||||
/// Names a host object for the device-removed report, which names the
|
||||
/// allocations a page fault hit (only with device-removed data on).
|
||||
/// allocations a page fault hit (only with device-removed data on), or for
|
||||
/// the frame recorder (`VICTORY_RECORD`).
|
||||
pub(crate) fn name(object: &impl Interface, text: impl FnOnce() -> String) {
|
||||
#[cfg(feature = "diagnostics")]
|
||||
if crate::replay::record::on() {
|
||||
let text = text();
|
||||
crate::replay::record::name(object, &text);
|
||||
if dred_on()
|
||||
&& let Ok(object) = object.cast::<ID3D12Object>()
|
||||
{
|
||||
// SAFETY: a plain call on a live object.
|
||||
let _ = unsafe { object.SetName(&windows::core::HSTRING::from(text)) };
|
||||
}
|
||||
return;
|
||||
}
|
||||
if dred_on()
|
||||
&& let Ok(object) = object.cast::<ID3D12Object>()
|
||||
{
|
||||
@@ -3153,6 +3169,8 @@ impl Host {
|
||||
},
|
||||
..Default::default()
|
||||
})?;
|
||||
#[cfg(feature = "diagnostics")]
|
||||
name(&pso, || crate::replay::play::COMPARE.into());
|
||||
Ok(CardWork {
|
||||
sync: vec![list()?],
|
||||
check: vec![list()?],
|
||||
@@ -6398,6 +6416,8 @@ impl Host {
|
||||
if let Some((buffer, footprint)) = capture {
|
||||
crate::capture::save_read_back(frame, &buffer, &footprint);
|
||||
}
|
||||
#[cfg(feature = "diagnostics")]
|
||||
crate::replay::record::present(texture, state);
|
||||
let _ = p.swap_chain.Present(0, DXGI_PRESENT(0));
|
||||
p.meter.frame(p.hwnd);
|
||||
#[cfg(feature = "diagnostics")]
|
||||
|
||||
Reference in new issue
Block a user