GPU: detile wide texture elements in one shader thread #2321

Manually merged
github merged 1 commit from github-bot/gh-2321 into main 2026-11-30 14:17:31 +00:00 AGit
Owner

@⁠yumaste on GitHub · 2026-11-29 11:52 UTC · original
yumaste:nvidia/perf-gpu-detile-wide → main · +38 −25 · 1 files · 1 commits · merged 2026-11-30 14:12 UTC

What it changes

The D3D12 detiler assigned one shader thread per 32-bit word. A BC1 block repeated the same tiled-address calculation twice and a BC7 block repeated it four times. Give each thread one 8- or 16-byte element and transfer it with Load2/Store2 or Load4/Store4. The dispatch width now counts elements for these formats. R8 and R16 still pack the elements of one output word, using their fixed group sizes of four and two.

The change applies to the existing opt-in path VICTORY_GPU_DETILE=1. Masked mips still write zeros, including all words of a wide element.

GPU timing

Intel Graphics, Windows, driver 32.0.101.8826. Baseline and candidate PSOs used the same synthetic texture bytes and buffers. GPU timestamps bracketed the detile dispatches and their resource transitions, excluding setup and readback. Each of three runs used five warm-up pairs and 41 timed pairs with alternating order.

Texture and mip chain Representative baseline median Candidate median Paired time reduction across runs
BC7, 2048 × 2048, 64 KiB swizzle 379.48 µs 240.57 µs 30–36%
BC1, 2048 × 2048, 64 KiB swizzle 206.35 µs 159.06 µs 17–25%
BC7, 1024 × 1024, 4 KiB swizzle 90.99 µs 60.05 µs 33–34%
RGBA8, 1024 × 1024, 64 KiB swizzle 429.43 µs 417.97 µs 3%
R8 and R16, 1024 × 1024, 64 KiB swizzle 0–1%

NVIDIA timing and in-game frame times remain unmeasured.

How it was tested

  • Ran cargo test --locked -p victory-gpu --lib gpudetile::tests -- --test-threads=1 on Windows. The WARP test matched the CPU detiler byte for byte across its cases, including a partial BC1 thread group, masked BC1 and BC7 mips and 3D 8-byte elements.
  • Each hardware timing case also matched the CPU detiler byte for byte over the active row bytes. The staged asset-policy check passed.

Checked for overlap

  • Checked open detile PRs. #2240 changes idle buffer reclamation. This PR changes the compute shader and dispatch width.
**@⁠yumaste** on GitHub · 2026-11-29 11:52 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2321) `yumaste:nvidia/perf-gpu-detile-wide` → `main` · +38 −25 · 1 files · 1 commits · merged 2026-11-30 14:12 UTC ## What it changes The D3D12 detiler assigned one shader thread per 32-bit word. A BC1 block repeated the same tiled-address calculation twice and a BC7 block repeated it four times. Give each thread one 8- or 16-byte element and transfer it with `Load2`/`Store2` or `Load4`/`Store4`. The dispatch width now counts elements for these formats. R8 and R16 still pack the elements of one output word, using their fixed group sizes of four and two. The change applies to the existing opt-in path `VICTORY_GPU_DETILE=1`. Masked mips still write zeros, including all words of a wide element. ## GPU timing Intel Graphics, Windows, driver 32.0.101.8826. Baseline and candidate PSOs used the same synthetic texture bytes and buffers. GPU timestamps bracketed the detile dispatches and their resource transitions, excluding setup and readback. Each of three runs used five warm-up pairs and 41 timed pairs with alternating order. | Texture and mip chain | Representative baseline median | Candidate median | Paired time reduction across runs | |---|---:|---:|---:| | BC7, 2048 × 2048, 64 KiB swizzle | 379.48 µs | 240.57 µs | 30–36% | | BC1, 2048 × 2048, 64 KiB swizzle | 206.35 µs | 159.06 µs | 17–25% | | BC7, 1024 × 1024, 4 KiB swizzle | 90.99 µs | 60.05 µs | 33–34% | | RGBA8, 1024 × 1024, 64 KiB swizzle | 429.43 µs | 417.97 µs | 3% | | R8 and R16, 1024 × 1024, 64 KiB swizzle | | | 0–1% | NVIDIA timing and in-game frame times remain unmeasured. ## How it was tested - Ran `cargo test --locked -p victory-gpu --lib gpudetile::tests -- --test-threads=1` on Windows. The WARP test matched the CPU detiler byte for byte across its cases, including a partial BC1 thread group, masked BC1 and BC7 mips and 3D 8-byte elements. - Each hardware timing case also matched the CPU detiler byte for byte over the active row bytes. The staged asset-policy check passed. ## Checked for overlap - [x] Checked open detile PRs. #2240 changes idle buffer reclamation. This PR changes the compute shader and dispatch width.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 11:55:04 +00:00
github manually merged commit ad2d8a1909 into main 2026-11-30 14:17:31 +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!2321
No description provided.