renderer: track native image clears for linear readback #1092
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!1092
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1092/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?
@Fayberr on GitHub · 2026-10-06 00:45 UTC · original
Fayberr:fix/linear-image-readback→main· +350 −13 · 4 files · 5 commits · closed without mergingWhen linear image readback is enabled, native image clears can leave guest memory holding old data after GPU completion.
ClearImagemarks the image as GPU-written, but neither clear path registers it for download.This registers both clear paths with the existing download mechanism. It also cancels queued image downloads when a newer CPU write invalidates the same range, so a delayed callback cannot overwrite the CPU's data. Pending downloads remain valid after image eviction unless their range is invalidated or unmapped.
The regression covers repeated clears, CPU writes before and after queueing, eviction, unmap and address reuse, download-buffer reuse, format aliases, array layers and padding. Devices without rasterization support skip only the format-alias subcase.
Testing performed:
Modal also intermittently failed existing fatal-exit checks on both baseline and candidate. Those failures are retained; the full baseline comparison remains blocked by that harness issue.
Upstream GitHub Actions still requires maintainer approval. No game compatibility improvement has been verified.
AI assistance: Developed with Codex, including investigation, implementation and automated testing.
@coderabbitai[bot] on GitHub · 2026-10-06 00:55 UTC · original · edited 2026-10-08 10:18 UTC
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
31cebaf4-7e2d-48d6-a5dc-052c079dcc99📥 Commits
Reviewing files that changed from the base of the PR and between
eeba795b18and5095f8e64c.📒 Files selected for processing (4)
CMakeLists.txtsrc/graphics/host_gpu/renderer/cache/textureCache.cppsrc/graphics/host_gpu/renderer/cache/textureCache.htests/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
Walkthrough
TextureCache::ClearImagenow tracks images for download after aliased-view and transfer clears. Pending downloads are recorded and cancelled when CPU-alias invalidation or unmapping overlaps their ranges. Deferred callbacks skip guest-memory writes for cancelled downloads. The compute tests cover linear-image clear readback, including repeated clears, CPU writes, buffer reuse, eviction, unmapping, format aliases, tiled-image exclusion, and padded rows. The tests also add a command-line selector and a CTest entry.Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
5095fClearing native images now registers them for linear readback. A pending download is cancelled when a newer CPU write or an unmap covers its memory range. The new tests cover repeated clears, CPU writes, buffer reuse, eviction, unmapping, format aliases, and padded rows. No outstanding defects were identified, so the change looks ready to merge.
Security Architecture Review
Security architecture risk: 🔵 Low · up to
91756The change improves protection against stale readbacks overwriting newer memory contents. The examined paths preserve existing memory boundaries and completion ordering. No introduced security vulnerability was established, but some ownership interleavings and failure states remain incompletely verified.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❓ 1
❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
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 8 functions across 2 files. (2 skipped: 1 unsupported, 1 too large.)
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.@coderabbitai[bot] on GitHub · 2026-10-06 00:55 UTC · original · edited 2026-10-06 03:08 UTC
On
tests/ShaderRecompilerComputeTests.cppline 5229 (outdated):🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Keep the transfer-clear test runnable without rasterization.
If a device supports the compute harness but lacks production rasterization features,
--linear-clear-readback-onlyreaches thisRequireand aborts. The full-suite guard does not apply to that selector, which is also registered as a CTest test. Run the format-alias case only whenRasterizationSupported()is true. Keep the transfer-clear and padding checks active on other supported devices. (raw.githubusercontent.com)✅ Addressed in commit
91756a2@coderabbitai[bot] on GitHub · 2026-10-06 00:55 UTC · original · reviewed
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
fcf1ed22-28e7-440e-96bb-82c7cdb1cba5📥 Commits
Reviewing files that changed from the base of the PR and between
cdb64bfd4fandff35e8011b.📒 Files selected for processing (3)
CMakeLists.txtsrc/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.
Pull request closed