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

Closed
github-bot wants to merge 1 commit from github-bot/gh-547 into main AGit
Owner

@⁠Glory-star on GitHub · 2026-11-28 00:39 UTC · original
pr/fix-aliasing-barrier-committed → main · +17 −4 · 3 files · 1 commits · closed without merging

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.
**@⁠Glory-star** on GitHub · 2026-11-28 00:39 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/547) `pr/fix-aliasing-barrier-committed` → `main` · +17 −4 · 3 files · 1 commits · closed without merging ### 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 00:41:13 +00:00
github-bot closed this pull request 2026-11-28 00:49:49 +00:00
Author
Owner

@⁠Machad3x on GitHub · 2026-11-28 01:56 UTC · original

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.

**@⁠Machad3x** on GitHub · 2026-11-28 01:56 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/547#issuecomment-7232024494) 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

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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/trustno1-coder--VIctory-NVIDIA!547
No description provided.