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

Merged
adwen-007 merged 1 commit from upstream-pr/999 into main 2026-11-28 19:39:38 +00:00
adwen-007 commented 2026-11-28 10:56:47 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by adwen-007 on 2026-11-28T10:56:47Z.


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:5539390589 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/999). Originally posted by [adwen-007](https://github.com/adwen-007) on 2026-11-28T10:56:47Z. --- ### 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.
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!999
No description provided.