Repository navigation
Fix skinned MV stalls from reading mapped upload memory - #15
Merged
Merged
Conversation
Avoid the legacy full per-draw geometry snapshot in the injected motion-vector path and classify skinned draws from only the current shader, constant buffer, and index buffer. Proxy known WRITE_DISCARD bone buffers through cached CPU memory, then copy the cached bytes into the real mapped upload pointer at Unmap. This preserves exact previous-bone motion vectors without reading from slow write-combined mapped memory.
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
WRITE_DISCARDbone constant buffers.CaptureGeometry=1behavior.Root cause
Diagnostic builds isolated the character-dependent performance collapse to the shadow copy performed between
MapandUnmap.The previous implementation saved the pointer returned by:
At
Unmap, it copied from that mapped pointer into a CPU shadow buffer. On the affected system, reading this upload-oriented memory was extremely slow. Such mapped memory is commonly write-combined: CPU writes are efficient, but CPU reads can be pathological.Classification, the required D3D state queries, pose matching, constant-buffer upload, and the skinned shader path retained normal performance when tested separately. Enabling the old mapped-memory read alone reproduced the collapse.
Fix
For known skinned bone buffers, the new path:
pData.Unmap, copies the cached RAM to the real mapped pointer.The game still uploads exactly the data it wrote, but Dust never reads from the
WRITE_DISCARDmapping.The injected path also identifies skinned draws using only the current vertex shader, bone constant buffer, and index buffer instead of constructing the legacy full
CapturedDrawreplay state.Test results
Tested in the same character-heavy scene with approximately 15 visible characters and FSR3/4 temporal AA enabled, using a 9060 XT at 2560x1440:
CaptureGeometry=0in INI shows near identical performanceCaptureGeometryabsent from the INI, therefore using its default value of1: approximately 47 FPSRendering and exact character motion vectors remained correct.