Skip to content

fix(gpu): only emit D3D12 aliasing barriers on pooled placed textures - #547

Closed
Glory-star wants to merge 1 commit into
trustno1-coder:mainfrom
Glory-star:pr/fix-aliasing-barrier-committed
Closed

Glory-star wants to merge 1 commit into
trustno1-coder:mainfrom
Glory-star:pr/fix-aliasing-barrier-committed

Conversation

@Glory-star

Copy link
Copy Markdown

Problem

When VICTORY_TEXTURE_POOL=1 is active, both host.rs (host state prelude) and texture.rs (record_upload) emit a D3D12_RESOURCE_BARRIER_TYPE_ALIASING barrier on a texture's first upload by checking only crate::pool::on().

If a texture is too large for a pool block (or falls back to CreateCommittedResource for any reason), D3D12 rejects the aliasing barrier on a committed resource and ID3D12GraphicsCommandList::Close() fails with E_INVALIDARG (0x80070057):

ERROR victory_gpu::host: a host state prelude did not record (0x80070057); a diagnostics build with VICTORY_D3D12_DEBUG=1 names the command

Fix

  • Add pool::is_pooled(texture: &ID3D12Resource) -> bool, which checks whether our RECLAIM_KEY private data interface is attached via GetPrivateData(&RECLAIM_KEY, &mut size, None).is_ok() (zero AddRef, zero locks, checked once on first upload).
  • Gate the aliasing barriers in crates/victory-gpu/src/host.rs and crates/victory-gpu/src/texture.rs on pool::is_pooled(...).

Verification

  • Tested on Windows 10 (19045), RTX 3060 Ti 8 GB (driver 621.40), i7-12700K: resolved reproducible startup 0x80070057 crash on committed fallback textures; 20+ minute gameplay sessions with 0 crashes.

@Machad3x

Copy link
Copy Markdown

Tested in a batch on an RTX 3080 Ti + Ryzen 7 5700X, 1440p, DLSS Quality, title ray tracing on (VICTORY_BVH_BUILDER=1), 240 s runs into the prison cell scene. Batch: #552, #550, #548, #547, #544.
Result without #550: alive for the whole run, 67-70 ms/frame, no shader or pipeline refused, picture unchanged. No problem found in this PR.

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