RTX 5070 Ti: menus at 30 fps, then TDR (DEVICE_HUNG); DRED output + 1M shader-visible heap cap on NVIDIA #16

Closed
opened 2026-11-26 03:46:38 +00:00 by github-bot · 8 comments
Owner

@⁠MaurycyBartczak on GitHub · 2026-11-23 23:02 UTC · original

Setup

GPU NVIDIA GeForce RTX 5070 Ti (16 GB), driver 621.24 (32.0.16.2124)
CPU / RAM Ryzen 7 9800X3D, 64 GB
OS Windows 11 Pro 26H2 (10.0.26300)
VIctory 015d45b, built with the pinned toolchain (--locked); cargo test --workspace 220 passed, 0 failed
Title Xbox Series 1.0.2.1 (build unknown (b99f876b…), same as #5)

victory.exe run <...>\game_scarlett_master.exe --execute. As far as I know this is the first NVIDIA report that reaches the menus: the title boots, shows its first screens at 30 fps, then the GPU hangs.

What happens

Two runs, same result:

  1. Release build: menus at 30 fps, device removed after about 2 min (0x887A0006). The System log shows nvlddmkm events 153 and 13 at the same second.
  2. Diagnostics build (--profile diag --features diagnostics) with VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1: device removed after about 45 s. The debug layer reports DXGI_ERROR_DEVICE_HUNG (TDR), not an invalid command.

Both times the last warning before the hang is a slow host submission (529 ms / 516 ms, 4 lists) with the same pipeline set, including compute 052a2316a03b9ba1 and the pairs vertex d166c341988178de / pixel e370f602fa0db9b2, vertex 0602c2384acbb3b2 / pixel a78d088fa55aa495, vertex 571fe570756bc393 / pixel 02c6cf86ca283ce1, vertex 58d926085fca4999 / pixel edc1cad8ffb79bc9, vertex 6719e1bc1f82443a / pixel a1f23b1756077215, vertex d5b1bcfe40fd84b2 / pixel fb0b42420f99e5e7, vertex dfafaf385b2f94e8 / pixel 06295fb1d1aefb78.

DRED (diagnostics build):

host GPU device removed after a submission of 4 lists;
a list stopped at command 50 of 96 (op 4), commands 49..56 between its barriers:
  command 50 (op 4): no marker; command 52 (op 4): no marker; command 54 (op 4): no marker; command 55 (op 8): no marker;
a list stopped at command 0 of 2 (op 46);
list 2 of 4, of its 26: indexed draws (2934, 3369, 3801, 4560, 1242 indices) [vertex d166c341988178de, pixel e370f602fa0db9b2],
  then draw 6x1 [vertex 0602c2384acbb3b2, pixel a78d088fa55aa495] (Srv 3840x2160 f28)

Possibly NVIDIA-specific (from the same diagnostics log)

  • Shader-visible view heap capped: host view heap capped at 1000000 error=0x80070057 count=1245184, and the debug layer: CreateDescriptorHeap: NumDescriptors 1310720, but the limit for shader visible view heaps is 1000000. NVIDIA's driver caps at 1M; AMD allows more, so this would not show on the RX 6700 XT. If the title (or the translated shaders) index past 1,000,000, reads would hit outside the heap — a plausible cause of a hang.
  • Formats NVIDIA does not support for these uses: CreateCommittedResource with ALLOW_UNORDERED_ACCESS on B5G5R5A1_UNORM and ALLOW_RENDER_TARGET on B4G4R4A4_UNORM fail; no host texture for two 2560x1440 targets (formats 86 and 115). view the host does not allow unordered=true format=53 flags=2.
  • Also logged once each: method not implemented object="device" slots 0x218 and 0x1c8; a host DLL outside the host policy: refused dll="rpcrt4.dll"; buffer view not on an element of its host copy offset=4453008 element=32.

Full diagnostics log available on request (~400 lines, engine/driver messages only).

AI-assisted (Claude Code); no game files attached.

**@⁠MaurycyBartczak** on GitHub · 2026-11-23 23:02 UTC · [original](https://github.com/Marvisak/VIctory/issues/16) ## Setup | | | |---|---| | GPU | NVIDIA GeForce RTX 5070 Ti (16 GB), driver 621.24 (32.0.16.2124) | | CPU / RAM | Ryzen 7 9800X3D, 64 GB | | OS | Windows 11 Pro 26H2 (10.0.26300) | | VIctory | `015d45b`, built with the pinned toolchain (`--locked`); `cargo test --workspace` 220 passed, 0 failed | | Title | Xbox Series 1.0.2.1 (`build unknown (b99f876b…)`, same as #5) | `victory.exe run <...>\game_scarlett_master.exe --execute`. As far as I know this is the first NVIDIA report that reaches the menus: the title boots, shows its first screens at 30 fps, then the GPU hangs. ## What happens Two runs, same result: 1. Release build: menus at 30 fps, device removed after about 2 min (`0x887A0006`). The System log shows nvlddmkm events 153 and 13 at the same second. 2. Diagnostics build (`--profile diag --features diagnostics`) with `VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1`: device removed after about 45 s. The debug layer reports `DXGI_ERROR_DEVICE_HUNG` (TDR), not an invalid command. Both times the last warning before the hang is a `slow host submission` (529 ms / 516 ms, 4 lists) with the same pipeline set, including `compute 052a2316a03b9ba1` and the pairs `vertex d166c341988178de / pixel e370f602fa0db9b2`, `vertex 0602c2384acbb3b2 / pixel a78d088fa55aa495`, `vertex 571fe570756bc393 / pixel 02c6cf86ca283ce1`, `vertex 58d926085fca4999 / pixel edc1cad8ffb79bc9`, `vertex 6719e1bc1f82443a / pixel a1f23b1756077215`, `vertex d5b1bcfe40fd84b2 / pixel fb0b42420f99e5e7`, `vertex dfafaf385b2f94e8 / pixel 06295fb1d1aefb78`. DRED (diagnostics build): ``` host GPU device removed after a submission of 4 lists; a list stopped at command 50 of 96 (op 4), commands 49..56 between its barriers: command 50 (op 4): no marker; command 52 (op 4): no marker; command 54 (op 4): no marker; command 55 (op 8): no marker; a list stopped at command 0 of 2 (op 46); list 2 of 4, of its 26: indexed draws (2934, 3369, 3801, 4560, 1242 indices) [vertex d166c341988178de, pixel e370f602fa0db9b2], then draw 6x1 [vertex 0602c2384acbb3b2, pixel a78d088fa55aa495] (Srv 3840x2160 f28) ``` ## Possibly NVIDIA-specific (from the same diagnostics log) - **Shader-visible view heap capped:** `host view heap capped at 1000000 error=0x80070057 count=1245184`, and the debug layer: `CreateDescriptorHeap: NumDescriptors 1310720, but the limit for shader visible view heaps is 1000000`. NVIDIA's driver caps at 1M; AMD allows more, so this would not show on the RX 6700 XT. If the title (or the translated shaders) index past 1,000,000, reads would hit outside the heap — a plausible cause of a hang. - **Formats NVIDIA does not support for these uses:** `CreateCommittedResource` with `ALLOW_UNORDERED_ACCESS` on `B5G5R5A1_UNORM` and `ALLOW_RENDER_TARGET` on `B4G4R4A4_UNORM` fail; `no host texture` for two 2560x1440 targets (formats 86 and 115). `view the host does not allow unordered=true format=53 flags=2`. - Also logged once each: `method not implemented object="device"` slots `0x218` and `0x1c8`; `a host DLL outside the host policy: refused dll="rpcrt4.dll"`; `buffer view not on an element of its host copy offset=4453008 element=32`. Full diagnostics log available on request (~400 lines, engine/driver messages only). AI-assisted (Claude Code); no game files attached.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:46:38 +00:00
Author
Owner

@⁠FIocker on GitHub · 2026-11-23 23:09 UTC · original

Same hang here on an RTX 5080 (driver 621.1), and I think it is the two refused textures you listed. With the patch below the title no longer hangs at the menus here.

Why. NVIDIA's D3D12 driver has no TYPED_UNORDERED_ACCESS_VIEW support for B5G5R5A1_UNORM (86) and no RENDER_TARGET support for B4G4R4A4_UNORM (115); the title creates both at 2560x1440 (flags 0x5 and 0x1). With no host texture, the descriptors that name them point at nothing, and draw::State::set_targets skips the slot with continue, so every render target after a missing one moves down a slot. The DRED trail then stops on the same 6-vertex quad as yours (vertex 0602c2384acbb3b2 / pixel a78d088fa55aa495, sampling the 3840x2160 R8G8B8A8 target). WARP, which accepts both formats, runs past that point. None of the shaders in that submission has a backward branch, DRED has no page fault and the debug layer reports nothing, as in your log.

Fix (in the patch):

  • resource::host_texture: when CreateCommittedResource fails, ask CheckFeatureSupport(FORMAT_SUPPORT) which of the RT/UAV uses the format lacks, and create the texture again without them (logged once per format and flags). Nothing changes for textures the host accepts.
  • draw.rs: a render-target slot whose texture is missing or has no render-target use binds a null RTV (writes discarded) instead of being skipped, so later targets keep their slots.
  • list.rs: ClearRenderTargetView on such a texture is skipped. Views of it are already refused by fits, and legal_for already drops the RT state bit.

Result on the RTX 5080 (release and diag builds, no input): first-boot screens and menus at 30 fps for about 2.5 min, loading-screen artwork renders, then the title loads into the world (about 500 draws per frame, mesh pipelines, 0.1-0.2 fps). It runs there until the device is lost on the first world mesh pass, which looks like the README's AMD world failure, not this one. Black frames still alternate with drawn ones in the menus.

On the 1,000,000 shader-visible heap cap you mention: I see the same host view heap capped line and have not ruled it out for the world failure yet.

cargo test --workspace passes with the patch (214 passed, 0 failed). It needs nothing else from my branch.

Patch (git format-patch, against e8f3b1c)
diff --git a/crates/victory-gpu/src/draw.rs b/crates/victory-gpu/src/draw.rs
index e7a3ec4..56e89ea 100644
--- a/crates/victory-gpu/src/draw.rs
+++ b/crates/victory-gpu/src/draw.rs
@@ -245,15 +245,21 @@ impl State {
         };
         self.targets.clear();
         let mut rtvs = Vec::new();
+        // A slot whose texture the host lacks (or could not make a render
+        // target) takes a null view, so the targets after it keep their slots.
         for &h in handles {
             let Some(record) = crate::descriptor::rtv_record(h) else {
                 once!(
                     handle = format_args!("{h:#x}"),
                     "render target without a recorded view"
                 );
+                rtvs.push(host.null_rtv());
                 continue;
             };
-            let Some(texture) = crate::resource::host_resource(record.resource) else {
+            let Some(texture) = crate::resource::host_resource(record.resource)
+                .filter(|t| crate::host::allows_render_target(t))
+            else {
+                rtvs.push(host.null_rtv());
                 continue;
             };
             self.targets.push(record.resource as usize);
diff --git a/crates/victory-gpu/src/host.rs b/crates/victory-gpu/src/host.rs
index 476ce4d..f5d515b 100644
--- a/crates/victory-gpu/src/host.rs
+++ b/crates/victory-gpu/src/host.rs
@@ -558,6 +558,26 @@ impl Host {
         first_error
     }
 
+    /// A null render target view (writes to it are discarded), for a slot
+    /// whose texture the host could not make a render target: the slot keeps
+    /// its position, so later targets stay where the pipeline writes them.
+    pub(crate) fn null_rtv(&self) -> D3D12_CPU_DESCRIPTOR_HANDLE {
+        let desc = D3D12_RENDER_TARGET_VIEW_DESC {
+            Format: windows::Win32::Graphics::Dxgi::Common::DXGI_FORMAT_R8G8B8A8_UNORM,
+            ViewDimension: D3D12_RTV_DIMENSION_TEXTURE2D,
+            ..Default::default()
+        };
+        let slot = self.next_rtv.fetch_add(1, Ordering::Relaxed) % RTV_RING;
+        // SAFETY: a slot of our heap; a null resource with a full description.
+        unsafe {
+            let mut handle = self.rtvs.GetCPUDescriptorHandleForHeapStart();
+            handle.ptr += (slot * self.rtv_size) as usize;
+            self.device
+                .CreateRenderTargetView(None::<&ID3D12Resource>, Some(&desc), handle);
+            handle
+        }
+    }
+
     /// A host render target view of `resource`, valid until it is recorded.
     pub(crate) fn rtv(
         &self,
@@ -1350,6 +1370,14 @@ pub(crate) fn legal_state(texture: &ID3D12Resource, state: u32) -> u32 {
     legal_for(unsafe { texture.GetDesc() }.Flags.0 as u32, state)
 }
 
+/// Whether the host texture may be a render target (its host copy can lack
+/// the use when the host's format support refuses it; see
+/// `resource::host_texture`).
+pub(crate) fn allows_render_target(texture: &ID3D12Resource) -> bool {
+    // SAFETY: a plain query.
+    unsafe { texture.GetDesc() }.Flags.0 & D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET.0 != 0
+}
+
 /// [`legal_state`] for a texture with resource flags `flags`.
 pub(crate) fn legal_for(flags: u32, state: u32) -> u32 {
     // (flag, set or clear forbids, state bits): render target, unordered
diff --git a/crates/victory-gpu/src/list.rs b/crates/victory-gpu/src/list.rs
index 6f11cc7..efa0582 100644
--- a/crates/victory-gpu/src/list.rs
+++ b/crates/victory-gpu/src/list.rs
@@ -673,6 +673,10 @@ extern "system" fn clear_rtv(
         ) else {
             return;
         };
+        // A host copy that cannot be a render target has nothing to clear.
+        if !crate::host::allows_render_target(texture) {
+            return;
+        }
         // SAFETY: the title passes four floats (null is tolerated).
         let Some(color) = (unsafe { color.as_ref() }) else {
             return;
diff --git a/crates/victory-gpu/src/resource.rs b/crates/victory-gpu/src/resource.rs
index 828113e..50c48d0 100644
--- a/crates/victory-gpu/src/resource.rs
+++ b/crates/victory-gpu/src/resource.rs
@@ -839,25 +839,67 @@ fn host_texture(
         Type: D3D12_HEAP_TYPE_DEFAULT,
         ..Default::default()
     };
-    let mut texture: Option<ID3D12Resource> = None;
-    // SAFETY: the description has the host layout (checked size, same
-    // fields); the out pointer is ours.
-    let made = unsafe {
-        host.device.CreateCommittedResource(
-            &heap,
-            D3D12_HEAP_FLAG_NONE,
-            (&raw const d).cast(),
-            D3D12_RESOURCE_STATES(
-                crate::host::legal_for(d.flags, crate::host::texture_state(state)) as i32,
-            ),
-            // The same layout: format, then color or depth and stencil.
-            clear_value.as_ref().map(|v| std::ptr::from_ref(v).cast()),
-            &mut texture,
-        )
+    let create = |d: &ResourceDesc, clear: Option<&[u32; 5]>| {
+        let mut texture: Option<ID3D12Resource> = None;
+        // SAFETY: the description has the host layout (checked size, same
+        // fields); the out pointer is ours.
+        let made = unsafe {
+            host.device.CreateCommittedResource(
+                &heap,
+                D3D12_HEAP_FLAG_NONE,
+                std::ptr::from_ref(d).cast(),
+                D3D12_RESOURCE_STATES(crate::host::legal_for(
+                    d.flags,
+                    crate::host::texture_state(state),
+                ) as i32),
+                // The same layout: format, then color or depth and stencil.
+                clear.map(|v| std::ptr::from_ref(v).cast()),
+                &mut texture,
+            )
+        };
+        made.map(|()| texture)
+    };
+    let texture = match create(&d, clear_value.as_ref()) {
+        Ok(t) => t,
+        Err(e) => {
+            // Some hosts lack uses of a format the console has (NVIDIA:
+            // B5G5R5A1 unordered access, B4G4R4A4 render targets). The texture
+            // is made without them, so it still exists for sampling and copies;
+            // render targets without the use bind as null views and are not
+            // cleared, unordered access views of it are refused (`fits`).
+            let (without, kept) = unsupported_uses(&host.device, &d);
+            if without == 0 {
+                tracing::warn!(error = %e, desc = ?d, "no host texture");
+                None
+            } else {
+                static SEEN: std::sync::Mutex<Vec<(u32, u32)>> = std::sync::Mutex::new(Vec::new());
+                let mut seen = SEEN.lock().unwrap_or_else(|e| e.into_inner());
+                if !seen.contains(&(d.format, d.flags)) {
+                    seen.push((d.format, d.flags));
+                    tracing::warn!(
+                        format = d.format,
+                        flags = format_args!("{:#x}", d.flags),
+                        dropped = format_args!("{without:#x}"),
+                        "the host's format support lacks uses of this texture; made without them"
+                    );
+                }
+                drop(seen);
+                let mut fallback = d;
+                fallback.flags = kept;
+                let clear = clear_value.as_ref().filter(|_| kept & 0x3 != 0);
+                match create(&fallback, clear) {
+                    Ok(t) => {
+                        d = fallback;
+                        t
+                    }
+                    Err(e) => {
+                        tracing::warn!(error = %e, desc = ?fallback, "no host texture");
+                        None
+                    }
+                }
+            }
+        }
     };
-    if let Err(e) = made {
-        tracing::warn!(error = %e, desc = ?d, "no host texture");
-    }
     if let Some(t) = &texture {
         crate::host::name(t, || {
             format!("texture {}x{} f{} flags {:#x}", d.width, d.height, d.format, d.flags)
@@ -866,6 +908,46 @@ fn host_texture(
     texture
 }
 
+/// The render-target and unordered-access uses in `d.flags` the host's
+/// format support refuses for `d.format`, and the flags without them.
+#[cfg(windows)]
+fn unsupported_uses(
+    device: &windows::Win32::Graphics::Direct3D12::ID3D12Device,
+    d: &ResourceDesc,
+) -> (u32, u32) {
+    use windows::Win32::Graphics::Direct3D12::*;
+    use windows::Win32::Graphics::Dxgi::Common::DXGI_FORMAT;
+    const RENDER_TARGET: u32 = 0x1;
+    const UNORDERED: u32 = 0x4;
+    let mut support = D3D12_FEATURE_DATA_FORMAT_SUPPORT {
+        Format: DXGI_FORMAT(d.format as i32),
+        ..Default::default()
+    };
+    // SAFETY: the structure the query names, with its size.
+    let asked = unsafe {
+        device.CheckFeatureSupport(
+            D3D12_FEATURE_FORMAT_SUPPORT,
+            (&raw mut support).cast(),
+            std::mem::size_of_val(&support) as u32,
+        )
+    };
+    if asked.is_err() {
+        return (0, d.flags);
+    }
+    let mut without = 0;
+    if d.flags & RENDER_TARGET != 0
+        && support.Support1.0 & D3D12_FORMAT_SUPPORT1_RENDER_TARGET.0 == 0
+    {
+        without |= RENDER_TARGET;
+    }
+    if d.flags & UNORDERED != 0
+        && support.Support1.0 & D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW.0 == 0
+    {
+        without |= UNORDERED;
+    }
+    (without, d.flags & !without)
+}
+
 /// A texture's console memory and description; `None` for buffers.
 pub(crate) fn texture_memory(this: This) -> Option<(*const u8, ResourceDesc)> {
     if this.is_null() {

AI-assisted (Claude Code). Own copy of the title; no game data in this comment.

**@⁠FIocker** on GitHub · 2026-11-23 23:09 UTC · [original](https://github.com/Marvisak/VIctory/issues/16#issuecomment-7116625315) Same hang here on an **RTX 5080** (driver 621.1), and I think it is the two refused textures you listed. With the patch below the title no longer hangs at the menus here. **Why.** NVIDIA's D3D12 driver has no `TYPED_UNORDERED_ACCESS_VIEW` support for `B5G5R5A1_UNORM` (86) and no `RENDER_TARGET` support for `B4G4R4A4_UNORM` (115); the title creates both at 2560x1440 (flags 0x5 and 0x1). With `no host texture`, the descriptors that name them point at nothing, and `draw::State::set_targets` skips the slot with `continue`, so every render target after a missing one moves down a slot. The DRED trail then stops on the same 6-vertex quad as yours (`vertex 0602c2384acbb3b2 / pixel a78d088fa55aa495`, sampling the 3840x2160 R8G8B8A8 target). WARP, which accepts both formats, runs past that point. None of the shaders in that submission has a backward branch, DRED has no page fault and the debug layer reports nothing, as in your log. **Fix (in the patch):** - `resource::host_texture`: when `CreateCommittedResource` fails, ask `CheckFeatureSupport(FORMAT_SUPPORT)` which of the RT/UAV uses the format lacks, and create the texture again without them (logged once per format and flags). Nothing changes for textures the host accepts. - `draw.rs`: a render-target slot whose texture is missing or has no render-target use binds a null RTV (writes discarded) instead of being skipped, so later targets keep their slots. - `list.rs`: `ClearRenderTargetView` on such a texture is skipped. Views of it are already refused by `fits`, and `legal_for` already drops the RT state bit. **Result on the RTX 5080** (release and diag builds, no input): first-boot screens and menus at 30 fps for about 2.5 min, loading-screen artwork renders, then the title loads into the world (about 500 draws per frame, mesh pipelines, 0.1-0.2 fps). It runs there until the device is lost on the first world mesh pass, which looks like the README's AMD world failure, not this one. Black frames still alternate with drawn ones in the menus. On the 1,000,000 shader-visible heap cap you mention: I see the same `host view heap capped` line and have not ruled it out for the world failure yet. `cargo test --workspace` passes with the patch (214 passed, 0 failed). It needs nothing else from my branch. <details><summary>Patch (git format-patch, against e8f3b1c)</summary> ```diff diff --git a/crates/victory-gpu/src/draw.rs b/crates/victory-gpu/src/draw.rs index e7a3ec4..56e89ea 100644 --- a/crates/victory-gpu/src/draw.rs +++ b/crates/victory-gpu/src/draw.rs @@ -245,15 +245,21 @@ impl State { }; self.targets.clear(); let mut rtvs = Vec::new(); + // A slot whose texture the host lacks (or could not make a render + // target) takes a null view, so the targets after it keep their slots. for &h in handles { let Some(record) = crate::descriptor::rtv_record(h) else { once!( handle = format_args!("{h:#x}"), "render target without a recorded view" ); + rtvs.push(host.null_rtv()); continue; }; - let Some(texture) = crate::resource::host_resource(record.resource) else { + let Some(texture) = crate::resource::host_resource(record.resource) + .filter(|t| crate::host::allows_render_target(t)) + else { + rtvs.push(host.null_rtv()); continue; }; self.targets.push(record.resource as usize); diff --git a/crates/victory-gpu/src/host.rs b/crates/victory-gpu/src/host.rs index 476ce4d..f5d515b 100644 --- a/crates/victory-gpu/src/host.rs +++ b/crates/victory-gpu/src/host.rs @@ -558,6 +558,26 @@ impl Host { first_error } + /// A null render target view (writes to it are discarded), for a slot + /// whose texture the host could not make a render target: the slot keeps + /// its position, so later targets stay where the pipeline writes them. + pub(crate) fn null_rtv(&self) -> D3D12_CPU_DESCRIPTOR_HANDLE { + let desc = D3D12_RENDER_TARGET_VIEW_DESC { + Format: windows::Win32::Graphics::Dxgi::Common::DXGI_FORMAT_R8G8B8A8_UNORM, + ViewDimension: D3D12_RTV_DIMENSION_TEXTURE2D, + ..Default::default() + }; + let slot = self.next_rtv.fetch_add(1, Ordering::Relaxed) % RTV_RING; + // SAFETY: a slot of our heap; a null resource with a full description. + unsafe { + let mut handle = self.rtvs.GetCPUDescriptorHandleForHeapStart(); + handle.ptr += (slot * self.rtv_size) as usize; + self.device + .CreateRenderTargetView(None::<&ID3D12Resource>, Some(&desc), handle); + handle + } + } + /// A host render target view of `resource`, valid until it is recorded. pub(crate) fn rtv( &self, @@ -1350,6 +1370,14 @@ pub(crate) fn legal_state(texture: &ID3D12Resource, state: u32) -> u32 { legal_for(unsafe { texture.GetDesc() }.Flags.0 as u32, state) } +/// Whether the host texture may be a render target (its host copy can lack +/// the use when the host's format support refuses it; see +/// `resource::host_texture`). +pub(crate) fn allows_render_target(texture: &ID3D12Resource) -> bool { + // SAFETY: a plain query. + unsafe { texture.GetDesc() }.Flags.0 & D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET.0 != 0 +} + /// [`legal_state`] for a texture with resource flags `flags`. pub(crate) fn legal_for(flags: u32, state: u32) -> u32 { // (flag, set or clear forbids, state bits): render target, unordered diff --git a/crates/victory-gpu/src/list.rs b/crates/victory-gpu/src/list.rs index 6f11cc7..efa0582 100644 --- a/crates/victory-gpu/src/list.rs +++ b/crates/victory-gpu/src/list.rs @@ -673,6 +673,10 @@ extern "system" fn clear_rtv( ) else { return; }; + // A host copy that cannot be a render target has nothing to clear. + if !crate::host::allows_render_target(texture) { + return; + } // SAFETY: the title passes four floats (null is tolerated). let Some(color) = (unsafe { color.as_ref() }) else { return; diff --git a/crates/victory-gpu/src/resource.rs b/crates/victory-gpu/src/resource.rs index 828113e..50c48d0 100644 --- a/crates/victory-gpu/src/resource.rs +++ b/crates/victory-gpu/src/resource.rs @@ -839,25 +839,67 @@ fn host_texture( Type: D3D12_HEAP_TYPE_DEFAULT, ..Default::default() }; - let mut texture: Option<ID3D12Resource> = None; - // SAFETY: the description has the host layout (checked size, same - // fields); the out pointer is ours. - let made = unsafe { - host.device.CreateCommittedResource( - &heap, - D3D12_HEAP_FLAG_NONE, - (&raw const d).cast(), - D3D12_RESOURCE_STATES( - crate::host::legal_for(d.flags, crate::host::texture_state(state)) as i32, - ), - // The same layout: format, then color or depth and stencil. - clear_value.as_ref().map(|v| std::ptr::from_ref(v).cast()), - &mut texture, - ) + let create = |d: &ResourceDesc, clear: Option<&[u32; 5]>| { + let mut texture: Option<ID3D12Resource> = None; + // SAFETY: the description has the host layout (checked size, same + // fields); the out pointer is ours. + let made = unsafe { + host.device.CreateCommittedResource( + &heap, + D3D12_HEAP_FLAG_NONE, + std::ptr::from_ref(d).cast(), + D3D12_RESOURCE_STATES(crate::host::legal_for( + d.flags, + crate::host::texture_state(state), + ) as i32), + // The same layout: format, then color or depth and stencil. + clear.map(|v| std::ptr::from_ref(v).cast()), + &mut texture, + ) + }; + made.map(|()| texture) + }; + let texture = match create(&d, clear_value.as_ref()) { + Ok(t) => t, + Err(e) => { + // Some hosts lack uses of a format the console has (NVIDIA: + // B5G5R5A1 unordered access, B4G4R4A4 render targets). The texture + // is made without them, so it still exists for sampling and copies; + // render targets without the use bind as null views and are not + // cleared, unordered access views of it are refused (`fits`). + let (without, kept) = unsupported_uses(&host.device, &d); + if without == 0 { + tracing::warn!(error = %e, desc = ?d, "no host texture"); + None + } else { + static SEEN: std::sync::Mutex<Vec<(u32, u32)>> = std::sync::Mutex::new(Vec::new()); + let mut seen = SEEN.lock().unwrap_or_else(|e| e.into_inner()); + if !seen.contains(&(d.format, d.flags)) { + seen.push((d.format, d.flags)); + tracing::warn!( + format = d.format, + flags = format_args!("{:#x}", d.flags), + dropped = format_args!("{without:#x}"), + "the host's format support lacks uses of this texture; made without them" + ); + } + drop(seen); + let mut fallback = d; + fallback.flags = kept; + let clear = clear_value.as_ref().filter(|_| kept & 0x3 != 0); + match create(&fallback, clear) { + Ok(t) => { + d = fallback; + t + } + Err(e) => { + tracing::warn!(error = %e, desc = ?fallback, "no host texture"); + None + } + } + } + } }; - if let Err(e) = made { - tracing::warn!(error = %e, desc = ?d, "no host texture"); - } if let Some(t) = &texture { crate::host::name(t, || { format!("texture {}x{} f{} flags {:#x}", d.width, d.height, d.format, d.flags) @@ -866,6 +908,46 @@ fn host_texture( texture } +/// The render-target and unordered-access uses in `d.flags` the host's +/// format support refuses for `d.format`, and the flags without them. +#[cfg(windows)] +fn unsupported_uses( + device: &windows::Win32::Graphics::Direct3D12::ID3D12Device, + d: &ResourceDesc, +) -> (u32, u32) { + use windows::Win32::Graphics::Direct3D12::*; + use windows::Win32::Graphics::Dxgi::Common::DXGI_FORMAT; + const RENDER_TARGET: u32 = 0x1; + const UNORDERED: u32 = 0x4; + let mut support = D3D12_FEATURE_DATA_FORMAT_SUPPORT { + Format: DXGI_FORMAT(d.format as i32), + ..Default::default() + }; + // SAFETY: the structure the query names, with its size. + let asked = unsafe { + device.CheckFeatureSupport( + D3D12_FEATURE_FORMAT_SUPPORT, + (&raw mut support).cast(), + std::mem::size_of_val(&support) as u32, + ) + }; + if asked.is_err() { + return (0, d.flags); + } + let mut without = 0; + if d.flags & RENDER_TARGET != 0 + && support.Support1.0 & D3D12_FORMAT_SUPPORT1_RENDER_TARGET.0 == 0 + { + without |= RENDER_TARGET; + } + if d.flags & UNORDERED != 0 + && support.Support1.0 & D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW.0 == 0 + { + without |= UNORDERED; + } + (without, d.flags & !without) +} + /// A texture's console memory and description; `None` for buffers. pub(crate) fn texture_memory(this: This) -> Option<(*const u8, ResourceDesc)> { if this.is_null() { ``` </details> AI-assisted (Claude Code). Own copy of the title; no game data in this comment.
Author
Owner

@⁠MaurycyBartczak on GitHub · 2026-11-23 23:20 UTC · original

Thanks @⁠FIocker, I tried the patch on the RTX 5070 Ti (driver 621.24).

Applied cleanly on d348b9a, release and diag builds, VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1.

The texture part works here too:

the host's format support lacks uses of this texture; made without them format=86 flags=0x5 dropped=0x4
the host's format support lacks uses of this texture; made without them format=115 flags=0x1 dropped=0x1

But it still hangs, at a later point. First-boot screens run at 30 fps. The hang comes right after I accept the legal/privacy screen, about 59 s in (before the patch: about 45 s in the diag build, without input). It is still DXGI_ERROR_DEVICE_HUNG (TDR). DRED has no page fault, and the debug layer reports nothing new before it.

slow host submission ms=504 lists=4 pipelines={[compute 052a2316a03b9ba1], [vertex 0602c2384acbb3b2, pixel a78d088fa55aa495],
  [vertex 58d926085fca4999, pixel edc1cad8ffb79bc9], [vertex a59924ecd59ce5dd, pixel a820d0c3bdb59905],
  [vertex bbc8a9d9207f6dcf, pixel 82ba5eae46a856a4], [vertex dfafaf385b2f94e8, pixel 06295fb1d1aefb78]}
host GPU device removed after a submission of 4 lists;
a list stopped at command 13 of 19 (op 4), commands 10..16 between its barriers (11: op 3, 13: op 4, 15: op 4, no markers);
a list stopped at command 0 of 2 (op 46);
list 2 of 4, of its 6: dispatch 5x5x33 [compute 052a2316a03b9ba1] (Srv 2x2 f2, Uav 33x33 f10),
  draw 3x1 [dfafaf385b2f94e8/06295fb1d1aefb78], draw 6x1 [58d926085fca4999/edc1cad8ffb79bc9],
  indexed 30x1 [a59924ecd59ce5dd/a820d0c3bdb59905], indexed 30x1 [bbc8a9d9207f6dcf/82ba5eae46a856a4],
  draw 6x1 [0602c2384acbb3b2/a78d088fa55aa495]

Notes:

  • compute 052a2316a03b9ba1 is in the hung submission in all three of my hangs: the two before the patch and this one. It is bound from about frame 33 and runs fine for about a minute before that, so it may simply run every frame rather than being the cause.
  • Each hang is preceded by a single slow host submission of about 500 ms.
  • The host view heap capped at 1000000 (title wants 1,245,184 / 1,310,720) is still there.

AI-assisted (Claude Code); no game files attached.

**@⁠MaurycyBartczak** on GitHub · 2026-11-23 23:20 UTC · [original](https://github.com/Marvisak/VIctory/issues/16#issuecomment-7116841218) Thanks @⁠FIocker, I tried the patch on the RTX 5070 Ti (driver 621.24). Applied cleanly on `d348b9a`, release and diag builds, `VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1`. **The texture part works here too:** ``` the host's format support lacks uses of this texture; made without them format=86 flags=0x5 dropped=0x4 the host's format support lacks uses of this texture; made without them format=115 flags=0x1 dropped=0x1 ``` **But it still hangs, at a later point.** First-boot screens run at 30 fps. The hang comes right after I accept the legal/privacy screen, about 59 s in (before the patch: about 45 s in the diag build, without input). It is still `DXGI_ERROR_DEVICE_HUNG` (TDR). DRED has no page fault, and the debug layer reports nothing new before it. ``` slow host submission ms=504 lists=4 pipelines={[compute 052a2316a03b9ba1], [vertex 0602c2384acbb3b2, pixel a78d088fa55aa495], [vertex 58d926085fca4999, pixel edc1cad8ffb79bc9], [vertex a59924ecd59ce5dd, pixel a820d0c3bdb59905], [vertex bbc8a9d9207f6dcf, pixel 82ba5eae46a856a4], [vertex dfafaf385b2f94e8, pixel 06295fb1d1aefb78]} host GPU device removed after a submission of 4 lists; a list stopped at command 13 of 19 (op 4), commands 10..16 between its barriers (11: op 3, 13: op 4, 15: op 4, no markers); a list stopped at command 0 of 2 (op 46); list 2 of 4, of its 6: dispatch 5x5x33 [compute 052a2316a03b9ba1] (Srv 2x2 f2, Uav 33x33 f10), draw 3x1 [dfafaf385b2f94e8/06295fb1d1aefb78], draw 6x1 [58d926085fca4999/edc1cad8ffb79bc9], indexed 30x1 [a59924ecd59ce5dd/a820d0c3bdb59905], indexed 30x1 [bbc8a9d9207f6dcf/82ba5eae46a856a4], draw 6x1 [0602c2384acbb3b2/a78d088fa55aa495] ``` Notes: - `compute 052a2316a03b9ba1` is in the hung submission in all three of my hangs: the two before the patch and this one. It is bound from about frame 33 and runs fine for about a minute before that, so it may simply run every frame rather than being the cause. - Each hang is preceded by a single `slow host submission` of about 500 ms. - The `host view heap capped at 1000000` (title wants 1,245,184 / 1,310,720) is still there. AI-assisted (Claude Code); no game files attached.
Author
Owner

@⁠regiumlepidi on GitHub · 2026-11-23 23:24 UTC · original

Measured what this issue (and @⁠FIocker's patch) rests on, without the title: a small D3D12 program that asks each adapter of one PC about the formats and the heap size. Same CPU as the report (Ryzen 7 9800X3D), whose iGPU is an AMD RDNA2 part, so both vendors are on one machine.

Hardware: NVIDIA GeForce RTX 5070 Ti 16 GB, driver 617.42 (32.0.16.1742); AMD Radeon(TM) Graphics (9800X3D iGPU, RDNA2, 1002:13C0), driver 32.0.21030.2001; Windows 11 Pro. Both report resource binding tier 3.

RTX 5070 Ti AMD RDNA2 iGPU
B5G5R5A1_UNORM (86): TYPED_UNORDERED_ACCESS_VIEW no yes
B5G5R5A1_UNORM: RENDER_TARGET yes yes
B4G4R4A4_UNORM (115): RENDER_TARGET no yes
B4G4R4A4_UNORM: TYPED_UNORDERED_ACCESS_VIEW no yes
2560x1440 committed texture, 86 + ALLOW_UNORDERED_ACCESS 0x80070057 ok
2560x1440 committed texture, 115 + ALLOW_RENDER_TARGET 0x80070057 ok
2560x1440 committed texture, 115 + ALLOW_UNORDERED_ACCESS 0x80070057 ok
shader-visible CBV/SRV/UAV heap of 1,000,000 ok ok
... of 1,000,001 0x80070057 ok
... of 1,310,720 (1,245,184 + DYNAMIC) 0x80070057 ok
... of 2,000,000 0x80070057 ok

(B5G6R5_UNORM behaves like B5G5R5A1 on both: render target yes, typed UAV only on AMD.)

So on this driver:

  • CheckFeatureSupport(FORMAT_SUPPORT) predicts exactly which committed textures fail, which is what unsupported_uses in the patch relies on.
  • The shader-visible view heap is capped at exactly 1,000,000 on NVIDIA even at binding tier 3, while AMD takes 2,000,000. With the title's 1,245,184 views, HostHeap::new falls back to PORTABLE_VIEWS and keeps 934,464 title slots (1,000,000 − DYNAMIC), so views 934,464..1,245,183 are left out on NVIDIA only. That is still there on main (descriptor/host.rs, 8c26061); I have not checked whether the title reaches those slots.

The patch on current main: it applies cleanly to 8c26061 ("GPU: the world stays up…"), not only to e8f3b1c. cargo test --workspace (pinned 1.98.1, debug) on the RTX 5070 Ti: 222 passed, 0 failed, 3 ignored with the patch, the same as 8c26061 without it. Those tests do not reach host_texture's fallback, and the GPU diff tests skip here (no VICTORY_CONSOLE_DXC).

Not tested: the title (I have no dump), so nothing about whether the patch removes the hang on this card; the debug layer's view of a null RTV whose format differs from the pipeline's RTVFormats.

The probe (Rust, windows 0.62.2)
use windows::Win32::Graphics::Direct3D::*;
use windows::Win32::Graphics::Direct3D12::*;
use windows::Win32::Graphics::Dxgi::Common::*;
use windows::Win32::Graphics::Dxgi::*;

fn main() -> windows::core::Result<()> {
    let factory: IDXGIFactory6 = unsafe { CreateDXGIFactory2(DXGI_CREATE_FACTORY_FLAGS(0))? };
    let mut i = 0;
    while let Ok(adapter) = unsafe { factory.EnumAdapterByGpuPreference::<IDXGIAdapter1>(i, DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE) } {
        i += 1;
        let desc = unsafe { adapter.GetDesc1()? };
        if desc.Flags & (DXGI_ADAPTER_FLAG_SOFTWARE.0 as u32) != 0 { continue; }
        let mut dev: Option<ID3D12Device> = None;
        if unsafe { D3D12CreateDevice(&adapter, D3D_FEATURE_LEVEL_12_0, &mut dev) }.is_err() { continue; }
        let dev = dev.unwrap();
        println!("== {}", String::from_utf16_lossy(&desc.Description).trim_end_matches('\0'));
        for fmt in [DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_B5G6R5_UNORM] {
            let mut fs = D3D12_FEATURE_DATA_FORMAT_SUPPORT { Format: fmt, ..Default::default() };
            unsafe { dev.CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &mut fs as *mut _ as _, std::mem::size_of_val(&fs) as u32)? };
            println!("format {}: support1 {:#x} support2 {:#x}", fmt.0, fs.Support1.0, fs.Support2.0);
            for flags in [D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET] {
                let rd = D3D12_RESOURCE_DESC { Dimension: D3D12_RESOURCE_DIMENSION_TEXTURE2D, Width: 2560, Height: 1440,
                    DepthOrArraySize: 1, MipLevels: 1, Format: fmt, SampleDesc: DXGI_SAMPLE_DESC { Count: 1, Quality: 0 },
                    Layout: D3D12_TEXTURE_LAYOUT_UNKNOWN, Flags: flags, Alignment: 0 };
                let hp = D3D12_HEAP_PROPERTIES { Type: D3D12_HEAP_TYPE_DEFAULT, ..Default::default() };
                let mut r: Option<ID3D12Resource> = None;
                let res = unsafe { dev.CreateCommittedResource(&hp, D3D12_HEAP_FLAG_NONE, &rd, D3D12_RESOURCE_STATE_COMMON, None, &mut r) };
                println!("  flags {:#x}: {:?}", flags.0, res.map_err(|e| e.code()));
            }
        }
        for n in [1_000_000u32, 1_000_001, 1_310_720, 2_000_000] {
            let r: windows::core::Result<ID3D12DescriptorHeap> = unsafe { dev.CreateDescriptorHeap(&D3D12_DESCRIPTOR_HEAP_DESC {
                Type: D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, NumDescriptors: n,
                Flags: D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE, NodeMask: 0 }) };
            println!("shader-visible view heap of {n}: {:?}", r.map(|_| ()).map_err(|e| e.code()));
        }
    }
    Ok(())
}

AI-assisted (Claude Code, Claude Opus 5.5): wrote and ran the probe and the tests, and this comment. No game data.

**@⁠regiumlepidi** on GitHub · 2026-11-23 23:24 UTC · [original](https://github.com/Marvisak/VIctory/issues/16#issuecomment-7116918137) Measured what this issue (and @⁠FIocker's patch) rests on, without the title: a small D3D12 program that asks each adapter of one PC about the formats and the heap size. Same CPU as the report (Ryzen 7 9800X3D), whose iGPU is an AMD RDNA2 part, so both vendors are on one machine. **Hardware:** NVIDIA GeForce RTX 5070 Ti 16 GB, driver 617.42 (32.0.16.1742); AMD Radeon(TM) Graphics (9800X3D iGPU, RDNA2, 1002:13C0), driver 32.0.21030.2001; Windows 11 Pro. Both report resource binding tier 3. | | RTX 5070 Ti | AMD RDNA2 iGPU | |---|---|---| | B5G5R5A1_UNORM (86): `TYPED_UNORDERED_ACCESS_VIEW` | **no** | yes | | B5G5R5A1_UNORM: `RENDER_TARGET` | yes | yes | | B4G4R4A4_UNORM (115): `RENDER_TARGET` | **no** | yes | | B4G4R4A4_UNORM: `TYPED_UNORDERED_ACCESS_VIEW` | **no** | yes | | 2560x1440 committed texture, 86 + `ALLOW_UNORDERED_ACCESS` | `0x80070057` | ok | | 2560x1440 committed texture, 115 + `ALLOW_RENDER_TARGET` | `0x80070057` | ok | | 2560x1440 committed texture, 115 + `ALLOW_UNORDERED_ACCESS` | `0x80070057` | ok | | shader-visible CBV/SRV/UAV heap of 1,000,000 | ok | ok | | ... of 1,000,001 | `0x80070057` | ok | | ... of 1,310,720 (1,245,184 + `DYNAMIC`) | `0x80070057` | ok | | ... of 2,000,000 | `0x80070057` | ok | (B5G6R5_UNORM behaves like B5G5R5A1 on both: render target yes, typed UAV only on AMD.) So on this driver: - `CheckFeatureSupport(FORMAT_SUPPORT)` predicts exactly which committed textures fail, which is what `unsupported_uses` in the patch relies on. - The shader-visible view heap is capped at exactly 1,000,000 on NVIDIA even at binding tier 3, while AMD takes 2,000,000. With the title's 1,245,184 views, `HostHeap::new` falls back to `PORTABLE_VIEWS` and keeps 934,464 title slots (1,000,000 − `DYNAMIC`), so views 934,464..1,245,183 are left out on NVIDIA only. That is still there on `main` (`descriptor/host.rs`, 8c26061); I have not checked whether the title reaches those slots. **The patch on current `main`:** it applies cleanly to `8c26061` ("GPU: the world stays up…"), not only to `e8f3b1c`. `cargo test --workspace` (pinned 1.98.1, debug) on the RTX 5070 Ti: 222 passed, 0 failed, 3 ignored with the patch, the same as `8c26061` without it. Those tests do not reach `host_texture`'s fallback, and the GPU diff tests skip here (no `VICTORY_CONSOLE_DXC`). **Not tested:** the title (I have no dump), so nothing about whether the patch removes the hang on this card; the debug layer's view of a null RTV whose format differs from the pipeline's `RTVFormats`. <details><summary>The probe (Rust, windows 0.62.2)</summary> ```rust use windows::Win32::Graphics::Direct3D::*; use windows::Win32::Graphics::Direct3D12::*; use windows::Win32::Graphics::Dxgi::Common::*; use windows::Win32::Graphics::Dxgi::*; fn main() -> windows::core::Result<()> { let factory: IDXGIFactory6 = unsafe { CreateDXGIFactory2(DXGI_CREATE_FACTORY_FLAGS(0))? }; let mut i = 0; while let Ok(adapter) = unsafe { factory.EnumAdapterByGpuPreference::<IDXGIAdapter1>(i, DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE) } { i += 1; let desc = unsafe { adapter.GetDesc1()? }; if desc.Flags & (DXGI_ADAPTER_FLAG_SOFTWARE.0 as u32) != 0 { continue; } let mut dev: Option<ID3D12Device> = None; if unsafe { D3D12CreateDevice(&adapter, D3D_FEATURE_LEVEL_12_0, &mut dev) }.is_err() { continue; } let dev = dev.unwrap(); println!("== {}", String::from_utf16_lossy(&desc.Description).trim_end_matches('\0')); for fmt in [DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_B5G6R5_UNORM] { let mut fs = D3D12_FEATURE_DATA_FORMAT_SUPPORT { Format: fmt, ..Default::default() }; unsafe { dev.CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &mut fs as *mut _ as _, std::mem::size_of_val(&fs) as u32)? }; println!("format {}: support1 {:#x} support2 {:#x}", fmt.0, fs.Support1.0, fs.Support2.0); for flags in [D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET] { let rd = D3D12_RESOURCE_DESC { Dimension: D3D12_RESOURCE_DIMENSION_TEXTURE2D, Width: 2560, Height: 1440, DepthOrArraySize: 1, MipLevels: 1, Format: fmt, SampleDesc: DXGI_SAMPLE_DESC { Count: 1, Quality: 0 }, Layout: D3D12_TEXTURE_LAYOUT_UNKNOWN, Flags: flags, Alignment: 0 }; let hp = D3D12_HEAP_PROPERTIES { Type: D3D12_HEAP_TYPE_DEFAULT, ..Default::default() }; let mut r: Option<ID3D12Resource> = None; let res = unsafe { dev.CreateCommittedResource(&hp, D3D12_HEAP_FLAG_NONE, &rd, D3D12_RESOURCE_STATE_COMMON, None, &mut r) }; println!(" flags {:#x}: {:?}", flags.0, res.map_err(|e| e.code())); } } for n in [1_000_000u32, 1_000_001, 1_310_720, 2_000_000] { let r: windows::core::Result<ID3D12DescriptorHeap> = unsafe { dev.CreateDescriptorHeap(&D3D12_DESCRIPTOR_HEAP_DESC { Type: D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, NumDescriptors: n, Flags: D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE, NodeMask: 0 }) }; println!("shader-visible view heap of {n}: {:?}", r.map(|_| ()).map_err(|e| e.code())); } } Ok(()) } ``` </details> AI-assisted (Claude Code, Claude Opus 5.5): wrote and ran the probe and the tests, and this comment. No game data.
Author
Owner

@⁠artor410 on GitHub · 2026-11-23 23:13 UTC · original · edited 2026-11-23 23:25 UTC

Update: #21 already covers the heap-cap part (tables past the capped host heap are made afresh, tested on an RTX 3080), so I'm not opening a duplicate. A page-remap alternative (title pages mapped into the 1M host heap, no per-frame dynamic slots) is on artor410/VIctory branch descriptor-page-remap in case the dynamic slots run short in the world. (AI-assisted, Claude Code.)

**@⁠artor410** on GitHub · 2026-11-23 23:13 UTC · [original](https://github.com/Marvisak/VIctory/issues/16#issuecomment-7116692042) · edited 2026-11-23 23:25 UTC Update: #21 already covers the heap-cap part (tables past the capped host heap are made afresh, tested on an RTX 3080), so I'm not opening a duplicate. A page-remap alternative (title pages mapped into the 1M host heap, no per-frame dynamic slots) is on artor410/VIctory branch `descriptor-page-remap` in case the dynamic slots run short in the world. (AI-assisted, Claude Code.)
Author
Owner

@⁠Nostyxx on GitHub · 2026-11-23 23:28 UTC · original

Tested @⁠FIocker's texture patch on an RTX 3080 (driver 32.0.16.2114, Windows 11, title 1.0.2.1), on top of e8f3b1c. For the heap cap I used #21, not anything else from FIocker's branch: the build is e8f3b1c + only the texture patch from this issue, then the same with #21 merged in.

diag build, VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1, clicking through the screens by hand.

Texture patch only Texture patch + #21
no host texture (86 / 115) gone gone
made without them once each, as expected once each
First-boot screens and menus black flicker, then device removed about 1 min in (DXGI_ERROR_DEVICE_HUNG) normal, no black flicker, no device loss
How far menus loads into the world (black picture, sound plays: the known world state)
the host's format support lacks uses of this texture; made without them format=86 flags=0x5 dropped=0x4
the host's format support lacks uses of this texture; made without them format=115 flags=0x1 dropped=0x1

So the texture part works here too, and the hang that is left with it alone looks like the heap cap: the patch-only run still logs NumDescriptors 1310720, but the limit for shader visible view heaps is 1000000, and its DRED trail stops on the same draw 6x1 [vertex 0602c2384acbb3b2, pixel a78d088fa55aa495] as before. That may also be the later hang @⁠MaurycyBartczak saw with the patch.

On the open question from @⁠regiumlepidi: the debug layer printed nothing about null render target views in either run (I did not log how often one was bound).

Something else in the world on NVIDIA, separate from both fixes: the combined run logs 73 host pipeline refused for compute shaders, with the debug layer saying Shader wants wave lane count of 64 (NVIDIA has 32). In the world the title then stops responding and the sound stutters.

cargo test --workspace passes with the patch.

AI-assisted (Claude Code). Own copy of the title; no game data in this comment.

**@⁠Nostyxx** on GitHub · 2026-11-23 23:28 UTC · [original](https://github.com/Marvisak/VIctory/issues/16#issuecomment-7116995841) Tested @⁠FIocker's texture patch on an **RTX 3080** (driver 32.0.16.2114, Windows 11, title 1.0.2.1), on top of `e8f3b1c`. For the heap cap I used #21, not anything else from FIocker's branch: the build is `e8f3b1c` + only the texture patch from this issue, then the same with #21 merged in. diag build, `VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1`, clicking through the screens by hand. | | Texture patch only | Texture patch + #21 | |---|---|---| | `no host texture` (86 / 115) | gone | gone | | `made without them` | once each, as expected | once each | | First-boot screens and menus | black flicker, then device removed about 1 min in (`DXGI_ERROR_DEVICE_HUNG`) | normal, no black flicker, no device loss | | How far | menus | loads into the world (black picture, sound plays: the known world state) | ``` the host's format support lacks uses of this texture; made without them format=86 flags=0x5 dropped=0x4 the host's format support lacks uses of this texture; made without them format=115 flags=0x1 dropped=0x1 ``` So the texture part works here too, and the hang that is left with it alone looks like the heap cap: the patch-only run still logs `NumDescriptors 1310720, but the limit for shader visible view heaps is 1000000`, and its DRED trail stops on the same `draw 6x1 [vertex 0602c2384acbb3b2, pixel a78d088fa55aa495]` as before. That may also be the later hang @⁠MaurycyBartczak saw with the patch. On the open question from @⁠regiumlepidi: the debug layer printed nothing about null render target views in either run (I did not log how often one was bound). Something else in the world on NVIDIA, separate from both fixes: the combined run logs 73 `host pipeline refused` for compute shaders, with the debug layer saying `Shader wants wave lane count of 64` (NVIDIA has 32). In the world the title then stops responding and the sound stutters. `cargo test --workspace` passes with the patch. AI-assisted (Claude Code). Own copy of the title; no game data in this comment.
Author
Owner

@⁠kleinerleuge-eng on GitHub · 2026-11-23 23:29 UTC · original

Another RTX 5070 Ti, this time on current main (8c26061 release, 1dd7afd diag) without the format/RTV patch from this thread. On this machine the hang now happens in the world, not in the menus.

Setup: RTX 5070 Ti, driver 621.01 (32.0.16.2101); Ryzen 7 9800X3D, 32 GB; Windows 11 Pro 26200 (German locale). Xbox Series 1.0.2.1, build unknown (b99f876b…) as in #5. victory.exe run <...>\game_scarlett_master.exe --execute, no input.

What happens (two runs, same result):

  • Boot and menus run at 30 fps. The title then loads into the world, which runs at 0.4–7 fps.
  • Device removed 0x887A0006 (DEVICE_HUNG) about 85 s (release) and 60 s (diag) after the last 30 fps frame. Both times one slow host submission of about 4830 ms comes right before it (14 lists in release, 28 in diag). So this is the TDR, not a fault.
  • The same warnings as in the issue body appear: host view heap capped at 1000000 and two no host texture (0x80070057).
  • For comparison, on 015d45b this machine hung in two of three runs with the pipeline set from the issue body (compute 052a2316a03b9ba1 plus the vertex/pixel pairs). The slow submissions there were 6663 ms and 4850 ms, with 4 lists each. That set no longer shows up in the hung submission on 8c26061.

DRED (diag build, VICTORY_D3D12_DRED=1), summarised:

host GPU device removed after a submission of 28 lists;
a list stopped at command 148 of 175 (op 42), commands 107..175 between its barriers:
  108 (op 42): mesh 14 [mesh 6b57e37fe499c6e7, pixel 573d1857e903fab5]
  110 (op 42): mesh 5  [mesh 6b57e37fe499c6e7, pixel 573d1857e903fab5]
  112 (op 42): mesh 1  [mesh 1921f28ef78e3a4b, pixel 80b3065a4477c8c4]
  114 (op 42): mesh 1  [mesh 6b57e37fe499c6e7, pixel 573d1857e903fab5]
  116 (op 42): mesh 6  [mesh 6b57e37fe499c6e7, pixel 573d1857e903fab5]
  118 (op 42): mesh 1  [mesh 0f73a9ae763e96e2, pixel ce1481325c93bb70]
  120..130: the same six again
the other in-flight lists stopped at command 0 (op 46)
  • The command where it stopped is a mesh dispatch (op 42). The report lists commands only up to 130, so 148 itself is not named. If the 12-command pattern continues, 148 would be the 1921f28ef78e3a4b / 80b3065a4477c8c4 pair. I have not verified that.
  • The report shows no page fault.
  • Every view-heap index in the report is below 934,464, so on this path the hang does not involve the slots dropped by the 1M cap. Many table slots are null, which are the new typed null descriptors from 8c26061.
  • This fits what FIocker saw on the RTX 5080 with the patch: the device was lost on the first world mesh pass.
  • The other pipelines in the hung submission: computes 9146291b38ea9ce1 (in every hang on 8c26061), 362753554f3ad60b, 9938c251a313fe28, 6b48bef1005f4f2f, 81e79f687ae84943, f7f9f22551967b84, 98888f39b68dbfde, 6a62009bc6a4146e. Mesh/pixel pairs e59d263ea2af2987/c100f3c699648196, dbbc6ccc56963935/74d016634e50b80e, dbbc6ccc56963935/fb93cb23cbe58dc0, 99daf52a34e3b6a4/4479187af47f2660, e70dcdec3cdcb398/24453153db030f99.

I can run patched builds here if that helps. The full DRED report is available on request.

AI-assisted (Claude Code); no game files attached.

**@⁠kleinerleuge-eng** on GitHub · 2026-11-23 23:29 UTC · [original](https://github.com/Marvisak/VIctory/issues/16#issuecomment-7117016939) Another RTX 5070 Ti, this time on current `main` (`8c26061` release, `1dd7afd` diag) **without** the format/RTV patch from this thread. On this machine the hang now happens in the world, not in the menus. **Setup:** RTX 5070 Ti, driver 621.01 (32.0.16.2101); Ryzen 7 9800X3D, 32 GB; Windows 11 Pro 26200 (German locale). Xbox Series 1.0.2.1, `build unknown (b99f876b…)` as in #5. `victory.exe run <...>\game_scarlett_master.exe --execute`, no input. **What happens (two runs, same result):** - Boot and menus run at 30 fps. The title then loads into the world, which runs at 0.4–7 fps. - Device removed `0x887A0006` (DEVICE_HUNG) about 85 s (release) and 60 s (diag) after the last 30 fps frame. Both times one `slow host submission` of about 4830 ms comes right before it (14 lists in release, 28 in diag). So this is the TDR, not a fault. - The same warnings as in the issue body appear: `host view heap capped at 1000000` and two `no host texture` (`0x80070057`). - For comparison, on `015d45b` this machine hung in two of three runs with the pipeline set from the issue body (`compute 052a2316a03b9ba1` plus the vertex/pixel pairs). The slow submissions there were 6663 ms and 4850 ms, with 4 lists each. That set no longer shows up in the hung submission on `8c26061`. **DRED (diag build, `VICTORY_D3D12_DRED=1`), summarised:** ``` host GPU device removed after a submission of 28 lists; a list stopped at command 148 of 175 (op 42), commands 107..175 between its barriers: 108 (op 42): mesh 14 [mesh 6b57e37fe499c6e7, pixel 573d1857e903fab5] 110 (op 42): mesh 5 [mesh 6b57e37fe499c6e7, pixel 573d1857e903fab5] 112 (op 42): mesh 1 [mesh 1921f28ef78e3a4b, pixel 80b3065a4477c8c4] 114 (op 42): mesh 1 [mesh 6b57e37fe499c6e7, pixel 573d1857e903fab5] 116 (op 42): mesh 6 [mesh 6b57e37fe499c6e7, pixel 573d1857e903fab5] 118 (op 42): mesh 1 [mesh 0f73a9ae763e96e2, pixel ce1481325c93bb70] 120..130: the same six again the other in-flight lists stopped at command 0 (op 46) ``` - The command where it stopped is a mesh dispatch (op 42). The report lists commands only up to 130, so 148 itself is not named. If the 12-command pattern continues, 148 would be the `1921f28ef78e3a4b / 80b3065a4477c8c4` pair. I have not verified that. - The report shows no page fault. - Every view-heap index in the report is below 934,464, so on this path the hang does not involve the slots dropped by the 1M cap. Many table slots are `null`, which are the new typed null descriptors from `8c26061`. - This fits what FIocker saw on the RTX 5080 with the patch: the device was lost on the first world mesh pass. - The other pipelines in the hung submission: computes `9146291b38ea9ce1` (in every hang on `8c26061`), `362753554f3ad60b`, `9938c251a313fe28`, `6b48bef1005f4f2f`, `81e79f687ae84943`, `f7f9f22551967b84`, `98888f39b68dbfde`, `6a62009bc6a4146e`. Mesh/pixel pairs `e59d263ea2af2987/c100f3c699648196`, `dbbc6ccc56963935/74d016634e50b80e`, `dbbc6ccc56963935/fb93cb23cbe58dc0`, `99daf52a34e3b6a4/4479187af47f2660`, `e70dcdec3cdcb398/24453153db030f99`. I can run patched builds here if that helps. The full DRED report is available on request. AI-assisted (Claude Code); no game files attached.
Author
Owner

@⁠MaurycyBartczak on GitHub · 2026-11-23 23:41 UTC · original

Update on the RTX 5070 Ti (driver 621.24): with #21 merged (97c78d1), and without FIocker's texture patch, the title gets past the legal screen and loads into the world, both in the release and in the diag build. The picture is black and sound plays: the known world state. So on this card #21 alone is enough to get past the menu hang. I haven't retested it together with the texture patch on 97c78d1 yet.

The device is then lost in the world, about 30 s after it starts drawing the world (DXGI_ERROR_DEVICE_HUNG). This is the diag build with VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1:

slow host submission ms=5366 lists=31   (the one before it: ms=313 lists=33)
host GPU device removed after a submission of 31 lists
a list stopped at command 12 of 25 (op 42), commands 3..25 between its barriers (all op 42, no markers)
in flight, list 30 of 31: dispatch 178x1x1 [compute af2fa61072fabb44], dispatch 32x1x1 [compute a133bf0a24aff410],
  dispatch 32x1x1 [compute 4c0ac499ad613809], ...

Also logged in the world, as Nostyxx saw on the 3080:

count
host pipeline refused, compute, debug layer Shader wants wave lane count of 64 but maximum wave lane count for device is 32 76
compute shaders that do not translate: an address in an SGPR that is no root parameter 35
pixel shaders that do not translate: 64-bit image atomic (2), lane-mask join of an untracked mask (2), a descriptor read only as data (1), barycentrics read directly (1) 6
indirect execution dropped (first time per signature) 4 signatures

AI-assisted (Claude Code); no game files attached.

**@⁠MaurycyBartczak** on GitHub · 2026-11-23 23:41 UTC · [original](https://github.com/Marvisak/VIctory/issues/16#issuecomment-7117241778) Update on the RTX 5070 Ti (driver 621.24): with #21 merged (`97c78d1`), and **without** FIocker's texture patch, the title gets past the legal screen and loads into the world, both in the release and in the diag build. The picture is black and sound plays: the known world state. So on this card #21 alone is enough to get past the menu hang. I haven't retested it together with the texture patch on `97c78d1` yet. The device is then lost in the world, about 30 s after it starts drawing the world (`DXGI_ERROR_DEVICE_HUNG`). This is the diag build with `VICTORY_D3D12_DEBUG=1 VICTORY_D3D12_DRED=1`: ``` slow host submission ms=5366 lists=31 (the one before it: ms=313 lists=33) host GPU device removed after a submission of 31 lists a list stopped at command 12 of 25 (op 42), commands 3..25 between its barriers (all op 42, no markers) in flight, list 30 of 31: dispatch 178x1x1 [compute af2fa61072fabb44], dispatch 32x1x1 [compute a133bf0a24aff410], dispatch 32x1x1 [compute 4c0ac499ad613809], ... ``` Also logged in the world, as Nostyxx saw on the 3080: | | count | |---|---| | `host pipeline refused`, compute, debug layer `Shader wants wave lane count of 64 but maximum wave lane count for device is 32` | 76 | | compute shaders that do not translate: `an address in an SGPR that is no root parameter` | 35 | | pixel shaders that do not translate: `64-bit image atomic` (2), `lane-mask join of an untracked mask` (2), `a descriptor read only as data` (1), `barycentrics read directly` (1) | 6 | | `indirect execution dropped` (first time per signature) | 4 signatures | AI-assisted (Claude Code); no game files attached.
Author
Owner

@⁠kleinerleuge-eng on GitHub · 2026-11-23 23:43 UTC · original

Follow-up on the same RTX 5070 Ti (driver 621.01), now on 97c78d1 with #21 merged, release build:

  • #21 helps the menus. The loading screens and menus run noticeably better, and the flicker (black frames between drawn ones) is gone.
  • The world hang is still there. About 20 s after the menus there is one slow host submission ms=5990 lists=27, then 0x887A0006 (DEVICE_HUNG). This matches the DRED run above, where no view-heap index in the stuck lists was past the cap, so #21 was not expected to change it.

Across four runs (8c26061 → 97c78d1) the world hang hit three different submissions: mesh passes (DRED: op 42 between barriers 107..175), a compute-only list of 1, and a mixed list of 27. In every run it is a single submission of about 4.8–6.6 s, i.e. a TDR. The time to the hang shrank from about 85 s to about 20 s, probably because the shader cache warms up and the world is reached sooner.

AI-assisted (Claude Code); no game files attached.

**@⁠kleinerleuge-eng** on GitHub · 2026-11-23 23:43 UTC · [original](https://github.com/Marvisak/VIctory/issues/16#issuecomment-7117298927) Follow-up on the same RTX 5070 Ti (driver 621.01), now on `97c78d1` with #21 merged, release build: - **#21 helps the menus.** The loading screens and menus run noticeably better, and the flicker (black frames between drawn ones) is gone. - **The world hang is still there.** About 20 s after the menus there is one `slow host submission ms=5990 lists=27`, then `0x887A0006` (DEVICE_HUNG). This matches the DRED run above, where no view-heap index in the stuck lists was past the cap, so #21 was not expected to change it. Across four runs (`8c26061` → `97c78d1`) the world hang hit three different submissions: mesh passes (DRED: op 42 between barriers 107..175), a compute-only list of 1, and a mixed list of 27. In every run it is a single submission of about 4.8–6.6 s, i.e. a TDR. The time to the hang shrank from about 85 s to about 20 s, probably because the shader cache warms up and the world is reached sooner. AI-assisted (Claude Code); no game files attached.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#16
No description provided.