Repository navigation
D3D12.X: sampled textures go without their top mips while video memory fills up - #2385
NWProgramming00 wants to merge 1 commit into
Conversation
61b2f2c to
d790a29
Compare
…y fills up When the device's local video memory passes 75 % of its budget, a new sampled title texture gets no pool tiles for its largest mips (the largest side kept: 2048 from 75 %, 1024 from 85 %, 512 from 92 %). Those tiles stay unmapped and every view of the texture is clamped to the first mip that has memory (ResourceMinLODClamp, which counts from the resource's first mip). With lazy levels (XCL_TEXTURE_LEVEL_PAGES=1) those levels never get pages. XCL_TEXTURE_BUDGET=0 turns it off; XCL_TEXTURE_MAX caps every new texture. Part of xcl-dev#1773. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent AMD RDNA4 (native wave64) test report on exact head Tested
Regression run (60 s retail-title smoke, (Matched Not tested
AI use
|
d790a29 to
005a442
Compare
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
…#2404, xcl-dev#2405 Integrates VRAM top-mip pressure shedding (xcl-dev#2385), DXC wanted-compile prioritization & worker headroom (xcl-dev#2423), inline split pipeline foreground path (xcl-dev#2424), ExecuteIndirect split program dispatch (xcl-dev#2404), and hosted view heap exhaustion null-pair fallback (xcl-dev#2405). Assisted-by: Antigravity (Gemini 4 Neon)
|
Two contributors checked independently and found that #640 solves the same problem (for #1773) in a different way: #1607, group D111. You may want to compare them with the other author and agree on one, or say in the PR why both are needed. This is a hint from the community triage in #1607, not a maintainer decision. AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table. |
…#2404, xcl-dev#2405 Integrates VRAM top-mip pressure shedding (xcl-dev#2385), DXC wanted-compile prioritization & worker headroom (xcl-dev#2423), inline split pipeline foreground path (xcl-dev#2424), ExecuteIndirect split program dispatch (xcl-dev#2404), and hosted view heap exhaustion null-pair fallback (xcl-dev#2405). Assisted-by: Antigravity (Gemini 4 Neon)
bmjask
left a comment
There was a problem hiding this comment.
No concrete code defect found, and the mapping/SRV clamping coverage is useful. Before merge, please provide low-VRAM (8-12 GB) title and visual/image validation, since this deliberately changes texture fidelity in the scenario it targets. The disclosed Load/mip-query zeros for skipped mips and discarded CPU detiling should remain explicit. Also reconcile intended coexistence with #640, which targets the same #1773 VRAM-pressure problem, to avoid competing strategies.
…extures) Integrates xcl-dev#2436 cleanly alongside xcl-dev#2385 (top-mip shedding) and xcl-dev#2474 (foreign-thread release_cleanup). Assisted-by: Antigravity (Gemini 4 Neon)
|
CPU coverage on exact head Tested
The 97-line companion commit adds:
Negative controls, restored before the final passing run: limiting the mask to the first slice fails the array cases; replacing the LOD clamp instead of taking its maximum fails the existing-clamp cases. Not tested
The companion commit is authored as RTX 3060 12 GB manual title follow-up, 25 November One manual run on Windows 10 22H2, release head At approximately the same elapsed time (~764 s), XCL's memory lines report the following (MB as logged):
The budget run was closed manually after about 50 min 25 s: exit 0, The black screen remains. The last nonzero presents activity sample is at 501.816 s. Another 582 logged driver calls finish after it; a read-only, non-suspending stack snapshot finds Limits: one run per profile, different cache warm-up and the wanted-limit change, so this does not isolate your patch's effect. No visual correctness or playability established; no image-quality comparison was possible. Raw title logs, stack dumps and proprietary files are not uploaded. |
|
Tested
Not tested
AI use
|
|
Independent NVIDIA check of #2385 head Tested
I read the patch's sampled-texture placement, skipped-tile mapping, remap and release paths and found no concrete source blocker. The GPU fixture verifies sampling from the first resident mip and zero reads from an unmapped top mip. It does not simulate an 8–12 GB retail memory-pressure run or judge visual quality. #640 offers a different policy for related pressure, as the D111 coordination note records. Not tested: a retail title under pressure, visual fidelity, AMD hardware, skipped native wave64/per-lane features, or a rebase onto current main. A rebase and clean full-suite run are still needed. AI-assisted: Codex (GPT-6, exact variant unavailable) reviewed the code, ran the tests, and drafted this report. |
|
Linux (Wine + vkd3d-proton) + NVIDIA, the title, 3 runs with the budget (default) and 3 with Setup:
Not tested: the image quality (no frames); AI use: Claude Code (Claude Opus 5.5) ran the title and wrote this comment. Posted without review by a person: the account owner was away and reads replies later. |
When the device's video memory fills up, new sampled title textures get no memory for their largest mips. Every view of such a texture is clamped to the first mip it has. A texture then gets less sharp up close instead of pushing the card past its budget. Part of #1773.
What it does
QueryVideoMemoryInfo, at most every 100 ms. Past 75 % of the budget, a new sampled texture keeps a largest side of at most:ResourceMinLODClamp= the mips left out, so sampling never reaches them. The clamp counts from the resource's first mip, not the view's; the new GPU test checks this.XCL_TEXTURE_BUDGET=0turns it off.XCL_TEXTURE_MAX=<texels>caps every new sampled texture at that size, whatever the fill. It is meant for tests and measurements.XCL_ACTIVITY'smemory:line gives the textures alive now without their top mips, and the MB of tiles they leave unmapped.What is in it
crates/xcl/src/hle/d3d12x/vram.rs:texture_cap,cap_for_fill,mips_to_skip);top_mip_tiles,top_mip_mask);Pages::bind/bind_rangemap all tiles but the masked ones; the mask is kept forremap_if_unmapped;XCL_TEXTURE_LEVEL_PAGES=1, D3D12.X: video memory use is high, title memory and textures are mirrored into VRAM #1773) the left-out levels never get pages inmap_levels(groups_to_map);clamp_skipped_mips.crates/xcl/src/hle/d3d12x/real.rs:dev_create_srv_xclamps the views of such a texture. When the title passes no description, it builds the default 2D view first.crates/xcl/src/host.rs: the counts on thememory:line.vram.rs:the_cap_follows_how_full_video_memory_isandtop_mips_go_until_the_largest_side_fits_and_one_tiled_mip_stays.lazy_levels_never_map_the_top_mips_left_out: with lazy levels, the left-out levels never get pages, the others once.gpu_a_texture_without_its_top_mip_samples_the_first_it_has, a GPU test. It binds a 512×512 4-mip reserved texture without mip 0 throughPages::bindand uploads every mip. Then it samples through three views:Tested
XCL_ADAPTER=radeon), AMD Ryzen 7 9700X, drivers 32.0.16.2124 (NVIDIA) and 32.0.21042.62 (AMD), Rust 1.100 MSVC, release.bind;cargo build --release --workspace, thencargo test --release --workspace --no-fail-fast -- --test-threads=4, with and withoutXCL_DIRECT_DXIL=all, against basee44af70on the same machine:e44af70005a442)XCL_DIRECT_DXIL=allXCL_DIRECT_DXIL=allThe +4 are the new tests. The failing tests are the same on base and PR:
fuzz_validate_and_gpu_0..3on NVIDIA (#1905),fuzz_validate_and_gpu_1on RDNA2 (#2115, #2170),offline_compute_pipeline_is_reused_by_a_second_processwith direct DXIL (#1674), anda_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrieron both adapters in both modes (it came with254a058and fails on base too).SKIPPEDlines: 37 on NVIDIA, 19 on the Radeon, the same on base and PR.XCL_ACTIVITY=1, A pressed at 15–65 s, RTX 5070 Ti; made before the rebase ontoe44af70, on base06c9f55):main06c9f55XCL_TEXTURE_MAX=1024mainrun on the Radeon iGPU reached it too, and the frames then stop at the known wait afterListX #101(Newer retail title (TitleID 7952987A): reaches world loading, then the title's GPU watchdog ("GPU Loc Sig") after ListX #101 stub #505). So I do not claim that this PR gets the title further.Regression run
Base (
main), NVIDIA GeForce RTX 5070 Ti:This PR, same card:
These 60 s runs end in the title's menus, before any texture is left without its top mips (video memory stays far under 75 % of the budget there), so they check that nothing else changed; the 300 s runs above are the ones that reach this code.
Not tested
title_memory_budget_mbis 13,824 MB regardless of the adapter's memory #1337, Retail Game potentially overcomitting VRAM - feasibility for 8GB VRAM cards? #320) would settle it.Load,mipsqueries). They are not clamped by a view, and read zero there.AI use
🤖 Generated with Claude Code