Repository navigation
Conversation
…acements A sampled texture the shared 64 KiB pages do not take (vram::place_pages refuses it; a 1D texture cannot be a reserved resource) was a committed resource, which takes at least 64 KiB of video memory. On the title the committed fallback held 8,361 x 64 KiB = 523 MiB (XCL_COMMITTED_AUDIT), mostly ~5k Texture1D RGBA8_SRGB textures of 4 KiB or less. With the switch, such a texture goes on a 4 KiB placement in a 4 MiB DEFAULT heap of XCL's own (ALLOW_ONLY_NON_RT_DS_TEXTURES), made through the adopting CreatePlacedResource. Only when the PC allows it: no RT/DS/UAV flags, one sample, and GetResourceAllocationInfo returning 4 KiB alignment for the description asking for it (most detailed level within 64 KiB). Otherwise, and when no heap can take it, it is committed as before. Its units are free again where late_release lets its last reference go (the queues are past the work before it); with XCL_LATE_RELEASE=0 the switch does nothing (logged once), as uploads of XCL's into a texture could still be in flight at the title's release. XCL asks no residency priority for the heaps, as for a committed texture (logged per heap). Measured on the title (RTX 5070 Ti, one 480 s run per arm, same base and env, with and without the switch): 8,192 small textures live in 58 MiB of 15 heaps, against at least 512 MiB as committed resources; local video memory over 250-310 s 18,332 vs 18,793 MB (-461 MB) with equal sparse pools and target pages. Still 3.1 GB over the budget there, and the frame rate did not move. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A sampled texture of the title that the shared 64 KiB pages do not take (
vram::place_pagesrefuses it; a 1D texture cannot be a reserved resource) is made a committed resource, and a committed resource takes at least 64 KiB of video memory. On the title we run, that fallback held thousands of tiny textures (mostlyTexture1DRGBA8 lookup tables of a few hundred bytes), at 64 KiB each. WithXCL_SMALL_TEXTURES=1such a texture goes on a 4 KiB placement in a heap of XCL's own instead. Off by default. Part of #2688.What is in it
hle/d3d12x/small_tex.rs(new): the PC's rules decide. No render target, depth or UAV flag, one sample, andGetResourceAllocationInforeturning 4 KiB alignment for the description withAlignment = D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT(its most detailed level fits in 64 KiB). Such a texture is placed first-fit in 4 KiB units of 4 MiBDEFAULTheaps (ALLOW_ONLY_NON_RT_DS_TEXTURES), made through the adoptingCreatePlacedResource. Anything else, and a texture no heap can take, is committed as before. Its units are free again wherelate_releaselets the texture go (the queues are past the work before it). WithXCL_LATE_RELEASE=0the switch does nothing (logged once): XCL's uploads into a texture could still be in flight at the title's release. XCL asks no residency priority for the heaps, as for a committed texture. Heaps are kept once made.device_x.rs: the committed fallback ofCreatePlacedResourceXtries it first.real.rs,late_release.rs:small_tex::gonenext toplacements::gone.units_are_taken_first_fit_and_given_back(the allocator),only_textures_the_pc_places_on_4_kib_are_taken(the rules, against the PC'sGetResourceAllocationInfo).Tested
XCL_DXC_DIR.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4on 24fdb7b (withCARGO_PROFILE_DEV_DEBUG=0: no debug info, for disk space): 1826 passed, 8 failed, 48 ignored. The same command onnvidia-deva5e2d851: 1822 passed, 10 failed, 48 ignored.a5e2d851as well:async_compute_pso_registers_real_pso_and_not_standin,console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly,hle::d3d12x::texture_upload::tests::gpu_parts_of_a_texture_go_up_and_the_rest_stays,hle::d3d12x::texture_upload::tests::pieces_hold_the_texels_of_their_levels,split_compute_prefers_the_offline_whole_pipeline,two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs.SKIPPED: 8 no wave64; 1 const_mask, wave64: no wave64; 1 f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's)); 1 f16 arithmetic, wave64: no wave64; 1 f32 arithmetic, wave64: no wave64; 1 f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's)); 1 f16 packed, wave64: no wave64; 1 f32 compares, wave64: no wave64; 1 f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's)); 1 f32 conversions, wave64: no wave64; 1 f64, wave64: no wave64; 1 integer arithmetic, wave64: no wave64; 1 f32 rounding, wave64: no wave64; 1 mask_ff0_flbit, wave64: no wave64; 1 integer carries, wave64: no wave64; 1 f32 transcendentals, wave64: no wave64; 1 f32 three-source, wave64: no wave64; 1 no heap windows (opt-in: XCL_HEAP_WINDOWS=1); 1 no heap windows.Build and test (Windows, no GPU)is red onnvidia-devitself and on every PR into it, this one included: the lib test process ends with0x887a0020in a sparse test on the runner's software adapter, with no test reported failed. Tests: sparse tests take CI's Basic Render Driver for a software device #2837 fixes that test; nothing here touches it.Regression run
150 s runs, same title, same env (
XCL_HEAP_WINDOWS=1 XCL_DIRECT_DXIL=all XCL_DIRECT_SPLIT_INSTRUCTIONS=0 XCL_PSO_JOURNAL=0 XCL_DRED=1 XCL_GPU_WAIT_TIMEOUT_MS=120000, DXC 1.9); the head withXCL_SMALL_TEXTURES=1as well. Themainrun from a hard-link copy of our team branch's DXIL cache; the base and head runs from hard-link copies of one cache warmed onnvidia-deva5e2d851(on this branch the title starts after about 75-90 s of startup shader preparation, so 60 s would end inside it).A commit of
main(b49be183, the last one before the shader preparation screen of #2555):The base,
nvidia-deva5e2d851:This PR's head:
The head run reached the switch: by 171 s its log counted 4,096 small textures on 4 KiB placements, 4,096 live in 28,108 KiB of 7 heaps (at least 262,144 KiB as committed resources); 8 heaps were made by the end of the run.
Not tested
XCL_LATE_RELEASE=0(the switch is off then, by design).AI use
🤖 Generated with Claude Code