Skip to content

GPU: experimental budgeted GPU upload heaps for read-only scratch - #5

Draft
ChaerilM wants to merge 1 commit into
perf/experimental-memory-poolsfrom
perf/gpu-upload-scratch
Draft

ChaerilM wants to merge 1 commit into
perf/experimental-memory-poolsfrom
perf/gpu-upload-scratch

Conversation

@ChaerilM

Copy link
Copy Markdown
Owner

Scope

Stacked on #2 (shared scratch pool); merge #2 first and retarget if needed. Narrow adaptation of VItoriaBr GPU upload windows and NVIDIA's GPU upload heaps guidance.

  • Opt-in VICTORY_GPU_UPLOAD_SCRATCH_MB (default 0, maximum 1024 MiB). Only reusable command-list scratch chunks are eligible: misaligned read-only root CBVs and CPU-expanded rectangle vertices. Oversized dedicated uploads, writable title shadows, all UAVs, and readback remain unchanged.
  • Query OPTIONS16 GPUUploadHeapSupported, allocate GENERIC_READ with no UAV flags, check local DXGI budget at admission (80% including requested chunk), fall back to the ordinary upload heap when unavailable or capped. Atomic logical allocation reservations persist for pooled chunks until release. Driver overhead and changing DXGI budgets not covered; the pressure check is advisory.
  • Regression tests for reservation limit and budget check, and a GPU readback fixture for CPU-written GPU upload heaps. Documentation in docs/gpu-upload-scratch.md. No existing preset automatically enables the feature; pass the environment variable explicitly (launcher preserves unmanaged env vars).

Limitations

The fork's VICTORY_CARD_BUFFERS_MB writable-shadow migration is NOT implemented: it depends on separate GPU and CPU buffers, dirty upload, GPU-side comparisons and writeback. Current shadows use a single mapped resource throughout. Do not substitute GPU upload heaps for them. This PR targets a narrower safe-to-attempt path and does not claim equivalent gains.

No Rust compilation, Windows GPU fixture execution, D3D12 debug-layer validation or gameplay benchmarking performed. Verified branch comparison. Suggested experiment: 0 vs 64/128/256 MiB on same hardware and scene, warmed cache, measure frame times and image correctness. Keep default 0 until evidence.

Use feature-gated GPU upload heaps for reusable CPU-written command-list scratch, with an atomic lifetime budget and DXGI pressure check. Preserve normal upload fallback and writable shadow semantics. Add reservation and GPU readback fixtures. Stacked on PR #2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant