fix(gpu,wine): harden D3D12 alignment/RTV/copy-barrier paths and texevents byte accounting (#250) #447
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/gamingwithhomie--larp!447
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-447"
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?
@ZerefDragnee1l on GitHub · 2026-12-06 01:00 UTC · original
ZerefDragnee1l:fix/proton-vkd3d-alignment-rtv-copy-barrier→main· +172 −34 · 6 files · 2 commits · openHardens several D3D12 / vkd3d-proton call sites and texture upload accounting related to #250 and #285:
Changes
0x1000small-texture alignment probing on Wine/vkd3d-proton (d3d12ma/shim.cpp,texheap.rs):try_4ktoHeaps/larp_d3d12ma_createand sets it to!crate::host::on_wine(). Eliminates thed3d12_resource_validate_texture_alignment/GetResourceAllocationInfo3warning storm and thousands of redundant0x1000probes during streaming under Proton.pResourceAllocationInfo1toGetResourceAllocationInfo3(poolheap.rs):Some(&mut info1)instead ofNoneincastable_info().host.rs):Host::rtv, whenin_texture()demotesresourcetoNone, ensuresFormat/ViewDimensionare neverDXGI_FORMAT_UNKNOWN/D3D12_RTV_DIMENSION_UNKNOWNwhen creating typed null descriptors.host.rs):D3D12_BARRIER_ACCESS_COPY_SOURCEalongsideD3D12_BARRIER_ACCESS_COPY_DESTincopy_send_refs, and keeps the single-listlist7.Barriermerge off on Wine/vkd3d-proton (!on_wine()) so overlapping copy runs use separate copy lists.GetCachedBlob()pointers (pipeline/blobs.rs):!ptr.is_null() && len > 0viablob_bytes()before constructing slices.q.bytesleak intexevents::read_late(texevents.rs):f.totalfromq.byteswhen!by_drainandsettle(...)returnsfalsedue to concurrentrelease()dropping aBytes::Readingentry.Verification
cargo check -p larpon this branch (exited0, 0 errors, 0 warnings in modified files).Regression test update
cargo test -p larp-gpu --lib texevents->1 passed; 0 failed; 30 filtered out(texevents::tests::read_late_release_during_read_restores_queue_bytes_without_affecting_unrelated_uploads)@vanya890 on GitHub · 2026-12-06 01:28 UTC · original · reviewed
One useful regression test would cover the newly fixed release-during-read accounting path in read_late(): reserve f.total in q.bytes, let the release transition the entry out of Bytes::Reading before settle(), then assert the queue byte count returns to its prior value and unrelated uploads remain accounted for. The code path is subtle because release intentionally does not subtract bytes while the entry is still Reading; a focused test would protect against reintroducing the queue-budget leak.
@ZerefDragnee1l on GitHub · 2026-12-06 01:37 UTC · original
Added the focused unit test covering the
read_late()release-during-read byte accounting path via extracteddrop_for_release()andsettle_reading()helpers:texevents::tests::read_late_release_during_read_restores_queue_bytes_without_affecting_unrelated_uploads:f.totalalongside unrelated upload bytes inq.bytes, runsdrop_for_releasewhile the entry is inBytes::Reading(verifying it transitions toBytes::Droppedand returnsSome(0)soq.bytesstays unchanged untilsettle), then callssettle_reading(by_drain = false) and verifiesq.bytesreturns to the exact prior unrelated upload byte count.by_drain = truepath (never subtractsf.total) and the normal non-releasedReading -> Read -> Droppedpath.Verified with
cargo check -p larp(exited 0) andcargo test -p larp-gpu --lib texevents(1 passed; 0 failed; 30 filtered out).View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.