Skip to content

[Review import] NVIDIA: scale dynamic descriptor pool on capped heaps (upstream #3300) - #2

Draft
maok625 wants to merge 1 commit into
mainfrom
review/upstream-pr-3300-dynamic-descriptor-pool
Draft

maok625 wants to merge 1 commit into
mainfrom
review/upstream-pr-3300-dynamic-descriptor-pool

Conversation

@maok625

@maok625 maok625 commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Imported from Marvisak#3300 for review on this fork.

Upstream source head: 01f91fea96de7c6fe47d5dd9f302e51a2403cac7 (from AdvaitPalve11/VIctory). This commit is directly based on the current fork baseline 63bcca43c6a00a758510398fa43096ce7e4f7df0; no commits from main need to be replayed.

This is a draft review import only. Please inspect the implementation and tests, resolve any interactions with other review branches, and run the Windows/D3D12 test suite before merging. No local build or hardware validation has been performed by this import.

Integration / merge warning

This allocator implementation overlaps upstream Marvisak#2177 in the same file, crates/victory-gpu/src/descriptor/host.rs. Marvisak#2177 also adds the shader-side host heap limit, null-view placement, and a reserved pair area. This PR is allocator-only; do not merge it independently as the complete NVIDIA capped-heap fix. Compare both allocation policies and build one combined implementation with regression tests for title slots, dynamic slots, null SRV/UAV slots, and memory view pairs. Marvisak#2177 currently has a reported layout boundary bug that also needs correction.

On NVIDIA hardware, shader-visible CBV/SRV/UAV heaps fail creation past PORTABLE_VIEWS (1,000,000). Previously, HostHeap::new skipped count + DYNAMIC whenever (count + DYNAMIC).max(HEAP_VIEWS) failed, and capped large heaps down to MIN_DYNAMIC (65,536) dynamic slots.

Because 2^16 dynamic slots can exhaust in seconds in the world (Marvisak#59) and high-index tables also spill into dynamic slots on capped heaps, draws can be dropped or trigger device removal. Furthermore, heavy scene churn benchmarks (Marvisak#747) demonstrated that 2^17 (131,072) dynamic slots still exhaust (refusing 944 tables a frame).

- Extract allocate_view_heap() to try count + DYNAMIC before capping.

- On capped heaps (PORTABLE_VIEWS = 1,000,000), prioritize reserving the full DYNAMIC (2^18 = 262,144) pool, leaving 737,856 title slots (PORTABLE_VIEWS - DYNAMIC). In hardware gameplay benchmarks (RTX 5070 Ti, fxceless/victory-fork), this split resulted in 0 dynamic tables refused across 3 runs of 210 s (~275k tables requested).

- Probe HEAP_VIEWS support in dynamic_slots_are_held_until_released so capped NVIDIA GPUs assert >= 4 + DYNAMIC instead of panicking on the 2M Tier-3 check.

- Add unit test view_heap_allocation_scales_on_capped_hosts covering Tier 3, NVIDIA capped layouts, and fallback behavior.
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.

2 participants