GPU: host descriptor heaps, depth twin copies, frame timing #2547
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2547
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2547/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Therecalloftheonion on GitHub · 2026-11-25 15:34 UTC · original
Therecalloftheonion:gpu/descriptor-heaps-and-depth-twins→main· +484 −101 · 9 files · 8 commits · closed without mergingSummary
GPU-host fixes found while working toward the world running on a host GPU.
HEAP_VIEWSrestores more title descriptors at more memory.TIMER_MODIFY_STATEonly, soWaitForSingleObjectfailed and sub-tick waits fell back to the 15.6 ms system sleep. It also testedINVALID_HANDLE_VALUEalthough the API returns NULL, and one timer was shared by every thread. It is now per-thread withTIMER_ALL_ACCESS.*.logfiles are ignored so the asset-policy test is not tripped by a log left in the tree.Testing
cargo test -p victory-gpu --lib: 196 passed, including the new hardware copy testcargo test -p victory-shader --lib: 268 passed; two pre-existing hardware assertions on the RX 6700 XT still fail (emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride,emit::synthetic_tests::gathers_at_a_level_match_the_hardware), outside the paths changed here. The suite no longer aborts atemit::memory_tests::heap_direct_texture_reads_mark_their_heap_index; that zero-constant crash is fixed here.cargo test -p victory-hle --lib: passed repeatedlycargo clippy --workspace --all-targets --all-features --locked -- -D warnings: cleancargo xtask policy: 182 files okNo game files are included; all input remains the user's own dump.
This does not make the world playable yet. It removes descriptor/device-removal hazards, restores a depth feature that was silently dropped, and reduces avoidable GPU memory; the remaining world frame cost needs profiling on a real dump.
@Marvisak on GitHub · 2026-11-25 18:35 UTC · original
Automated triage for the maintainers.
This PR bundles eight unrelated changes. They need to be split, and the headline one is not right as it stands.
8a4f310a). The commit message says every heap "fell back to 65,536 slots". That does not matchmain:HostHeap::newasks for(count + DYNAMIC).max(HEAP_VIEWS)and falls back tocount + MIN_DYNAMIC, then to thePORTABLE_VIEWScap. With this PR,HEAP_VIEWSbecomes 2^18, and the new code setscount = count.min(NULL_BUFFER_VIEW - 1)andextra = room - count. For the title's 1,245,184-slot heap, that keeps 262,141 title slots and givessplit_extra(0) = (0, 0): zero dynamic slots and zero copy pairs. Every draw that needs a dynamic table would then be dropped. Please drop this commit or rework it.84ae09ba). The change toCargo.toml(lto = "thin",codegen-units = 1) needs the maintainer's decision. Please put it in a PR of its own, with measured numbers.e4f59c9a).sleep_preciseadds a per-thread high-resolution waitable timer. Recent Ruststd::thread::sleepon Windows already uses a high-resolution waitable timer where one is available. Please show a measured difference againstmain, or drop this.4d200fa4), the deterministic dstorage late-list test (04ce281c) and theuser_data_dwords().max(1)test fix (d22cef91) look like separate, reviewable fixes. Please open each as its own PR. The*.log.gitignoreentry is not needed.CI is passing.
Generated by Claude Code
@welisonzika14-jpg on GitHub · 2026-11-25 19:18 UTC · original
Measured
sleep_preciseagainststd::thread::sleep(rustc 1.98.1, the std that ships with it), as the triage asked. Windows 11 Pro, release build, 100 sleeps per row, run twice. "Late" is real elapsed time minus the requested time. Thesleep_precisecode from this PR is copied into a stand-alone program outside the repo; no VIctory build was involved.Result: no measurable difference. The two methods differ by under 0.1 ms in the mean and the order flips between runs. Plain
std::thread::sleepis already about 0.3 to 0.5 ms late here, not 15.6 ms, so on this machine it already uses a high-resolution timer. That matches the triage note. (This machine only; I did not test an older std or an older Windows.)Written with AI help (Claude/Kiro); the numbers are from runs on my machine.
@Therecalloftheonion on GitHub · 2026-11-25 19:24 UTC · original
Thanks for the triage. Split and withdrawn as requested.
HEAP_VIEWS = 2^18the cap leavesextra = 0, so zero dynamic slots and zero copy pairs, and every draw needing a dynamic table would be dropped. The 2^21 request and the 1M fallback need a separate design; not in this PR.std::thread::sleepalready uses a high-resolution timer on this Windows, so there is no measured gain.*.login.gitignore: withdrawn.The three reviewable pieces are now separate:
Closing this one. Thanks.
Pull request closed