Repository navigation
D3D12.X: fix sparse buffer uncommitted holes, sub-tile VRAM reclaim, query delta, and heap/DMA leaks - #99
Merged
ivall merged 1 commit intoNov 23, 2026
Conversation
…ent buffer sanitization, descriptor copies, and DMA list release
Collaborator
|
Merged together with #95–#102 and checked on Windows 11 with an RX 9070: |
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.
Summary
Fixes 6 bugs in sparse UMA page tracking, placed-buffer offsets, descriptor heap remapping, and DMA command list cleanup in
crates/xcl/src/hle/d3d12x/{sparse.rs, list_x.rs, real.rs}:sparse::place_bufferuncommitted page hole mask (sparse.rs):place_bufferpreviously calledensure_mappedwithholes = 0for all 64 KiB tiles covering[start, va + bytes), even when pages in that range were still uncommitted (MEM_RESERVE/PAGE_NOACCESS), causingreadback_now/readback_rangesto access-violate on uncommitted pages.query_tile_holes(tile)viaVirtualQueryover each 64 KiB tile forplace_buffer, whilecommitted()initializes newly mapped tiles to0xFFFFand clears holes for[a, a + n).sparse::decommittedsub-tile VRAM pool tile reclamation (sparse.rs):decommit_tiles()so incremental sub-tile decommits (e.g. 2 × 32 KiB or 16 × 4 KiB) reclaim and unmap the 64 KiB pool tile back tos.freeas soon asentry.holes == 0xFFFF, pruning stales.to_zeroentries.ResolveQueryData(RPF9: reject conflicting probe options #30) applyingbuffer_delta(dest)(list_x.rs):real::buffer_delta(dest)tooffsetinresolve_query_data_xfor both PCResolveQueryDataand nested occlusionWriteBufferImmediatewritebacks, fixing misaligned query writes on non-64 KiB-aligned placed buffers.place_console_buffercoherent fallback state & flags sanitization (real.rs):sanitize_coherent_buffer()to maskd.Flagswith0xFFbefore OR-ingALLOW_CROSS_ADAPTERand maskstatewithPC_RESOURCE_STATESon the coherent fallback path (matching the sparse path).CopyDescriptors/CopyDescriptorsSimpleremappingXBOX_EXTRA_CBV_SRV_UAV(real.rs):pc_heap_type(ty)mappingXBOX_EXTRA_CBV_SRV_UAV(4) ->CBV_SRV_UAV(0) acrossdev_create_descriptor_heap_x,dev_increment_size_x,copy_console_slots,dev_copy_descriptors_simple_x, anddev_copy_descriptors_x.Kind::DmaListRelease/Close/Resetoverrides (real.rs):Kind::DmaListtooverrides()so releasing a DMA command list removes itslist_x::LISTSentry and decrements fast-path counters instead of leaking permanently.Testing
query_tile_holes_detects_reserved_noaccess_and_committed_pagesensure_mapped_with_query_holes_skips_uncommitted_pages_on_readbackdecommit_sub_tile_reclaims_pool_tile_when_all_pages_become_holesresolve_query_data_applies_buffer_delta_to_pc_resolve_and_occlusion_writebackcoherent_buffer_sanitizes_console_flags_and_statecopy_descriptors_remaps_xbox_extra_cbv_srv_uav_to_pc_enumdma_list_release_cleans_up_list_state32.0.32015.2008(sparse/coherence D3D12 tests verified on AMD only).origin/main(60599a9):cargo build --workspaceandcargo test --workspace -- --test-threads=4pass (466 passed, 0 failed, 36 ignored, 0 new warnings).