Skip to content

GPU: a shared texture's allocation size is asked of its own description (NVIDIA device removal) - #2286

Open
Bullet18x wants to merge 1 commit into
Marvisak:mainfrom
Bullet18x:fix/nvidia-allocation-info
Open

Bullet18x wants to merge 1 commit into
Marvisak:mainfrom
Bullet18x:fix/nvidia-allocation-info

Conversation

@Bullet18x

Copy link
Copy Markdown

Problem

Since 13bbd6f ("one host texture per texture memory"), shared_texture() asks GetResourceAllocationInfo for the bytes sharing saved, using the title's description d. That description can ask for uses its format does not take on the host. On NVIDIA it asks for unordered access on B5G5R5A1_UNORM, the query rejects it, and the device is removed a few seconds into the title on every NVIDIA card.

With VICTORY_D3D12_DEBUG=1 (RTX 5090, driver 621.40):

ID3D12Device::GetResourceAllocationInfo: A texture that has D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS set in
D3D12_RESOURCE_DESC::Flags must be created with a format that either can be used as unordered access, or cast to a
format that could be used as unordered access. FeatureLevel is D3D_FEATURE_LEVEL_12_2. D3D12_RESOURCE_DESC::Format is B5G5R5A1_UNORM.

followed by host GPU device removed after a submission of 1 lists ... (0x887A0001 DXGI_ERROR_INVALID_CALL) around frame 32.

Fix

Ask the size of the live texture the description is shared with (t.texture.GetDesc()), as HostTexture::new already does. That is a description the host made a texture from, so the query always accepts it. Only the SAVED statistic reads the result; it now counts the live texture's size, which is the memory the sharing actually saved.

Tested

Not covered

B5G5R5A1_UNORM also reaches CreateUnorderedAccessView and render-target creation on NVIDIA. #1780 and #2180 cover those; with them on top of this, the title gets much further on this card. This PR only fixes the statistics query, which main hits first.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

shared_texture() asks GetResourceAllocationInfo for the size it saves, with
the title's description. That description may ask for uses its format does
not take on the host: on NVIDIA, unordered access on B5G5R5A1_UNORM. The
query rejects it, and the device is removed (DXGI_ERROR_INVALID_CALL) a few
seconds into the title on every NVIDIA card.

Ask it of the live texture the description is shared with, as
HostTexture::new does: a description the host made the texture from.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zhaibingye added a commit to zhaibingye/VIctory that referenced this pull request Nov 25, 2026

@DenRakEiw DenRakEiw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified against origin/main (940d32f) on Windows 11 + NVIDIA GeForce RTX 5090 and WARP:

  • Querying t.texture.GetDesc() instead of the incoming title d avoids passing host-invalid flag/format combinations (e.g. UAV on B5G5R5A1 on NVIDIA) to GetResourceAllocationInfo and eliminates the raw pointer cast / read_unaligned.
  • cargo test -p victory-gpu resource::: 10/10 passed on RTX 5090, 10/10 passed on WARP.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings: 0 warnings.
  • cargo xtask policy: 183 files ok.

AI-assisted (Gemini 4 Neon).

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shared texture allocation size asked of the live texture's own GetDesc() instead of the requested desc (B5G5R5A1 UAV on NVIDIA removed the device). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Real device-removal fix, 5 lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants