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

Manually merged
github merged 1 commit from github-bot/gh-999 into main 2026-11-28 19:42:42 +00:00 AGit
Owner

@⁠adwen-007 on GitHub · 2026-11-28 10:56 UTC · original
adwen-007:pr/fix-aliasing-barrier-committed → main · +17 −4 · 3 files · 1 commits · merged 2026-11-28 19:39 UTC

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.
**@⁠adwen-007** on GitHub · 2026-11-28 10:56 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/999) `adwen-007:pr/fix-aliasing-barrier-committed` → `main` · +17 −4 · 3 files · 1 commits · merged 2026-11-28 19:39 UTC ### 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 14:31:27 +00:00
github-bot referenced this pull request from a commit 2026-11-28 19:41:56 +00:00
github manually merged commit ad000575cf into main 2026-11-28 19:42:42 +00:00
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!999
No description provided.