feat(gpu): port opt-in GPU compute texture detiling (VICTORY_GPU_DETILE) #36

Manually merged
github merged 2 commits from github-bot/gh-36 into main 2026-11-28 19:03:10 +00:00 AGit
Owner

@⁠wike1701 on GitHub · 2026-11-27 12:16 UTC · original
wike1701:feat/gpu-detile → main · +1108 −12 · 6 files · 2 commits · merged 2026-11-28 19:01 UTC

Summary

Ports opt-in GPU compute texture detiling (VICTORY_GPU_DETILE=1) from xceless/victory-fork@3461f52 (GPL-3.0), adapted for VIctory-NVIDIA:

  • crates/victory-formats/src/texture.rs: adds Swizzle::name(), DetileParams + DetileParams::address(), Layout::detile_params(), Layout::pattern_tables(), and unit test detile_params_address_every_element_as_offset_does.
  • crates/victory-gpu/src/gpudetile.rs: adds D3D12 compute detiling pipeline (HLSL -> DXIL via DXC, root signature, PSO, job planner, raw/mask/pattern-table staging layout, and WARP byte-exact test he_card_detiles_as_the_cpu_does).
  • crates/victory-gpu/src/texture.rs: adds opt-in Staging::gpu (VICTORY_GPU_DETILE=1) backed by pooled device-local UAV linear buffers (SPARE_LINEAR), plus per-frame CPU/GPU detile telemetry (DETILED, BY_MODE).
  • crates/victory-gpu/src/host.rs: records GPU detiling in HostList::prelude (idempotent per submission) and logs per-frame detiling breakdown in Meter.

Adaptations for VIctory-NVIDIA

  1. PreludeUpload ordering: when VICTORY_PRELUDE_UPLOADS=1, HostList::prelude records upload.staging().record_detile(list, submission) before upload.record(list), and PreludeUpload::record reads from staging.copy_source() / staging.copy_base().
  2. Partial-mip & pooled-staging safety: Staging::gpu is only enabled when irst == 0 && level0 == 0 (so ootprints matches
**@⁠wike1701** on GitHub · 2026-11-27 12:16 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/36) `wike1701:feat/gpu-detile` → `main` · +1108 −12 · 6 files · 2 commits · merged 2026-11-28 19:01 UTC ## Summary Ports opt-in GPU compute texture detiling (VICTORY_GPU_DETILE=1) from [ xceless/victory-fork@3461f52](https://github.com/fxceless/victory-fork/commit/3461f52) (GPL-3.0), adapted for VIctory-NVIDIA: - **crates/victory-formats/src/texture.rs**: adds Swizzle::name(), DetileParams + DetileParams::address(), Layout::detile_params(), Layout::pattern_tables(), and unit test detile_params_address_every_element_as_offset_does. - **crates/victory-gpu/src/gpudetile.rs**: adds D3D12 compute detiling pipeline (HLSL -> DXIL via DXC, root signature, PSO, job planner, raw/mask/pattern-table staging layout, and WARP byte-exact test he_card_detiles_as_the_cpu_does). - **crates/victory-gpu/src/texture.rs**: adds opt-in Staging::gpu (VICTORY_GPU_DETILE=1) backed by pooled device-local UAV linear buffers (SPARE_LINEAR), plus per-frame CPU/GPU detile telemetry (DETILED, BY_MODE). - **crates/victory-gpu/src/host.rs**: records GPU detiling in HostList::prelude (idempotent per submission) and logs per-frame detiling breakdown in Meter. ### Adaptations for VIctory-NVIDIA 1. **PreludeUpload ordering**: when VICTORY_PRELUDE_UPLOADS=1, HostList::prelude records upload.staging().record_detile(list, submission) **before** upload.record(list), and PreludeUpload::record reads from staging.copy_source() / staging.copy_base(). 2. **Partial-mip & pooled-staging safety**: Staging::gpu is only enabled when irst == 0 && level0 == 0 (so ootprints matches
Ports GPU compute texture detiling from fxceless/victory-fork commit 3461f52 (GPL-3.0), adapted for VIctory-NVIDIA's PreludeUpload path and pooled staging allocator:

- crates/victory-formats/src/texture.rs: add Swizzle::name(), DetileParams + DetileParams::address(), Layout::detile_params(), Layout::pattern_tables(), and unit test detile_params_address_every_element_as_offset_does.
- crates/victory-gpu/src/gpudetile.rs: add D3D12 compute detiler (HLSL -> DXIL via DXC, root signature, PSO, job planner, raw layout/mask/table writers, and WARP byte-exact test the_card_detiles_as_the_cpu_does).
- crates/victory-gpu/src/texture.rs: add opt-in Staging::gpu (VICTORY_GPU_DETILE=1) with pooled device-local linear UAV buffers, restricted to full textures starting at mip 0 (first == 0 && level0 == 0) with dedicated offset-0 upload buffers, plus CPU/GPU detile telemetry (DETILED, BY_MODE).
- crates/victory-gpu/src/host.rs: schedule GPU detiling in HostList::prelude before both PreludeUpload copies and regular CopyTextureRegion list copies (idempotent per submission), and log per-frame detiling stats in Meter.

Default behavior is unchanged when VICTORY_GPU_DETILE is unset.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 12:24:12 +00:00
texture::ahead copies on a D3D12 copy queue, which cannot run the gpudetile compute pass and reads staging.buffer directly with linear footprints. When VICTORY_GPU_DETILE=1 was combined with VICTORY_UPLOAD_AHEAD=1, ahead copies failed with E_INVALIDARG (0x80070057) because staging.buffer holds tiled raw bytes rather than linear footprints.

Filter out s.is_gpu() in texture::ahead::claim() so GPU-detiled textures upload through the direct queue prelude where gpudetile runs.
github-bot referenced this pull request from a commit 2026-11-28 19:01:59 +00:00
github manually merged commit 19dadf59ff into main 2026-11-28 19:03:10 +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!36
No description provided.