Repository navigation
GPU: prepare and upload only dirty texture bands (opt-in) - #2358
nicolasveilleux wants to merge 2 commits into
Conversation
Keep full copies for the first upload and ineligible layouts. Use tracked tile-row ranges only for bindless uploads, and validate the D3D12 copy with synthetic readback.
Read the complete tiled row band and detile into only those staging rows. Keep the full fallback and validate band bounds and pixel parity for linear, swizzled and block-compressed layouts.
|
I adapted the GPU band-copy fixture on On native Windows with an RTX 4070 Ti (621.01) and WARP, the full readback matched on both adapters: the last block row held the new pattern, and all 128 preceding block rows kept their original bytes. This exercises AI-assisted with Codex. |
catminou4
left a comment
There was a problem hiding this comment.
Prepare and upload only dirty texture bands (opt-in VICTORY_TEXTURE_UPLOAD_BANDS): detile_rows partial detiling in victory-formats + GPU wiring (+523). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. The formats-side detile_rows is the portable part — being batch-tested on macOS now, will follow up.
catminou4
left a comment
There was a problem hiding this comment.
Follow-up to my earlier static note: the victory-formats side (detile_rows partial detiling) tested locally — merged into main 940d32f, cargo test -p victory-formats --locked on macOS arm64: 38 passed, 0 failed, 5 ignored. The portable detiling math is green; the GPU upload wiring remains Windows-only (static).
What changes
When a tracked, single-mip 2D texture is reached through the descriptor heap, a sparse update can now read and detile only the affected tile rows and copy just that band to the GPU. The first upload, dense changes and unsupported layouts keep the existing full path. This is opt-in (
VICTORY_TEXTURE_UPLOAD_BANDS=1) and off by default.The scope is within a subresource. #1135 skips unaffected mips and slices on the CPU but still uploads the full texture. This PR does not change the eager upload timing addressed by #230 and #1891.
Validation
On Windows 11, RTX 2070 Super (driver 610.60), 24 paired runs of a synthetic 4096 × 4096 RGBA8 texture:
Timing includes the CPU write, preparation, and submission through queue completion. The partial path won 24/24 pairs. Dense updates kept the full 64 MiB copy in both modes (45.31 vs. 43.53 ms median). Full GPU readback matched expected bytes in both modes for both patterns. No game files or gameplay measurements.
main(940d32f) and on this branch with bands off and on. The test was not included in this PR.AI-assisted (OpenAI Codex).