graphics: cache memory at DMA base addresses before dispatch #2190
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!2190
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2190/head"
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?
@theantipopau on GitHub · 2026-11-10 02:26 UTC · original
theantipopau:fix/rage-dma-base-cache→main· +228 −2 · 8 files · 1 commits · closed without mergingSummary
GTA V's RAGE boot/legal-notice glyph compute shader reads staging pages through a 64-bit DMA base held in a user-data register pair. The buffer cache only created those pages after a shader fault, so the first glyphs of each 16 KiB page read zero.
This records the low user-data register of each 64-bit DMA base pair during resource tracking and materializes the mapped 16 KiB window at that base before
PrepareBda()synchronizes buffers. It is wired into graphics binding preparation and both direct and indirect compute dispatch. Composite-built base pairs keep the provenance of their individual dwords.This is an adaptation of the closed PR #925, which was closed by its author rather than rejected. It does not enable global linear image readback.
Verification
cmake --build ../../amd-stability-perf-build --target resource_tracking_tests kyty_emulator --parallel 16succeeds.resource_tracking_tests.exepasses, includingTestDmaBaseRegistersfor FLAT/GLOBAL base pairs, composite extracts, the 256-instruction traversal boundary, and shader-plan serialization round-tripping.git diff --checkis clean, and the touched files remain CRLF with no bare LF lines.Not run: GTA V in-game. No installation was available on the build host, so the visual glyph result is unverified.
@coderabbitai[bot] on GitHub · 2026-11-10 02:36 UTC · original
Walkthrough
Shader resource tracking now records DMA base-register pairs for FLAT and GLOBAL address accesses and includes them in serialization. The renderer uses those registers to cache buffers for mapped portions of each base window during graphics binding preparation and direct or indirect compute dispatch.
Suggested reviewers:
nmzikChange: Bug fix
Merge Risk:
Minimal · up to
ac1e5No concrete issue currently blocks merging. The GTA V glyph result has not been tested on the reported game.
Pre-merge checks:
4 ·
1
Full details: Docstring Coverage
Explanation
Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 12 functions across 8 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
@coderabbitai[bot] on GitHub · 2026-11-10 02:37 UTC · original · reviewed
33303061-2970-48cc-b8f9-ed4c7a6bf4c9Reviewing files that changed from the base of the PR and between
782a85c621andac1e53ff63.src/graphics/host_gpu/renderer/pipeline/descriptors.cppsrc/graphics/host_gpu/renderer/renderCompute.cppsrc/graphics/host_gpu/renderer/renderContext.cppsrc/graphics/host_gpu/renderer/renderContext.hsrc/graphics/shader/recompiler/ir/Serialize.hsrc/graphics/shader/recompiler/ir/ShaderIR.hsrc/graphics/shader/recompiler/ir/passes/ResourceTracking.cpptests/ResourceTrackingTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
@Nawid3333 on GitHub · 2026-11-10 04:22 UTC · original
@theantipopau Two things from reading this next to current main:
Main already has a sibling of this from
c174ade18("renderer: back global load base pages before compute dispatches").ResourceTracking.cpprecordsaddress_basesfor FLAT/GLOBAL accesses whose two base words areReadConstloads from the flattened SRT, a few lines below the newCollectDmaBasecall, andBackAddressBasesinrenderCompute.cppbacks those pages inDispatchDirectandDispatchIndirect, shortly before the newCacheDmaBasescalls. This PR covers the other source, a base held directly in a user-data register pair (thes[12:13]case of #925), with its own list and its own backing function. Could both kinds share one backing function and one window policy, with the source kind kept in each recorded entry? Called from the graphics binding path as well, it would also back the SRT-table bases for graphics stages.The window:
CacheDmaBasesrequests[base, base + 16 KiB), which buffer creation rounds out to one 16 KiB page for an aligned base or two for an unaligned one, whileBackAddressBasesrequests the pages containingbase,base + 16 KiBandbase + 32 KiB. A load that reaches a page still missing from the BDA table records a fault and reads zero on that dispatch, so it would help to check that the glyph staging offsets stay within the pages backed here.Pull request closed