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

Closed
Glory-star wants to merge 1 commit from upstream-pr/547 into main
Glory-star commented 2026-11-28 00:39:18 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Glory-star on 2026-11-28T00:39:18Z.


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.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5535008788 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/547). Originally posted by [Glory-star](https://github.com/Glory-star) on 2026-11-28T00:39:18Z. --- ### 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 commented 2026-11-28 01:56:55 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Machad3x on 2026-11-28T01:56:55Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7232024494 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/547#issuecomment-7232024494). Originally posted by [Machad3x](https://github.com/Machad3x) on 2026-11-28T01:56:55Z. --- 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.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
trustno1-coder/VIctory-NVIDIA!547
No description provided.