graphics: stage oversized image readbacks in a temporary buffer #1587
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!1587
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1587/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?
@Nawid3333 on GitHub · 2026-10-17 08:47 UTC · original
Nawid3333:renderer/stage-oversized-image-readbacks→main· +129 −9 · 2 files · 1 commits · closed without mergingRed Dead Redemption (PPSA30528) crashes after the developers' intro video with this error, reported in #191 (build
027433f, RTX 2060 Super):DownloadImageMemoryreserves each readback in the 64 MiB reusable download buffer and exits when it does not fit, so any image larger than 64 MiB stops the emulator on every GPU.Change: apply the fallback you added for buffer readbacks in
18a5f04dto images: whenMapfails, allocate a temporary download buffer for this readback and move it into the deferred operation. It gets the stream buffer's usage flags, becauseDownloadImagemay detile into it with a compute shader. #845 by @theantipopau proposed this for images, and #780 by @itsmemac has a similar fallback.Tests
OversizedImageReadback: a 4096 x 2304 RGBA16F render target (72 MiB), cleared on the GPU and read back to guest memory. Before the change it exits with the error above on the RX 9070 XT and on the Ryzen 7600X iGPU, also with the harness forced to 32-wide subgroups (a local switch). After it, every texel reaches guest memory in all four configurations, with no validation-layer messages.ba8b0c85: all 716 compute-suite entries in both subgroup modes and the 30 graphics cases keep their status.If you'd like this done differently, tell me and I'll change it.
Written with Claude Code (AI): it wrote the change and ran the tests on my PC (driver 26.8.1, Windows 11). I reviewed the diff and this description before opening the PR.
🤖 Generated with Claude Code
DownloadImageMemory exited when an image did not fit the 64 MiB reusable download buffer ("TextureCache: failed to map reusable download buffer"), as in Red Dead Redemption (PPSA30528, #191). Allocate a temporary download buffer instead and keep it alive until the deferred write-back, like the buffer readback fallback in18a5f04d. Co-Authored-By: Claude Opus 5.5 <[email protected]>@coderabbitai[bot] on GitHub · 2026-10-17 08:52 UTC · original
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
34157a81-2be1-4324-9a48-07bca93c9fb5📥 Commits
Reviewing files that changed from the base of the PR and between
b82512be06and07ce98e551.📒 Files selected for processing: 2
src/graphics/host_gpu/renderer/cache/textureCache.cpptests/ShaderRecompilerComputeTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
📝 Walkthrough
DownloadImageMemorynow uses a temporary download buffer if it cannot map the reusable buffer. The deferred operation invalidates the buffer used for the mapping and writes the downloaded bytes to guest backing memory. A new oversized-image readback check validates returned texels and runs in three test paths.Suggested reviewers:
nmzikPriority: ⬆️ High
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
07ce9No unresolved issue identified in the oversized image readback change; it is ready to merge after normal checks.
Pre-merge checks:
4 ·
1
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 too large.)
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
Comment
@coderabbitai helpto get the list of available commands.@Nawid3333 on GitHub · 2026-11-07 18:47 UTC · original
Superseded by
96b251749, which reads back images larger than the download ring through a temporary buffer with the same usage flags, so main no longer exits with "failed to map reusable download buffer". Closing this one.Pull request closed