[PR #3150] [CLOSED] liverpool: Flush buffer cache on rewind packet and async download of small buffers #3264

Closed
opened 2026-02-27 22:03:03 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3150
Author: @raphaelthegreat
Created: 6/22/2025
Status: Closed

Base: mainHead: rewind-flush


📝 Commits (10+)

  • 9298533 liverpool: Flush buffers on Rewind packet
  • 2ca34c4 video_core: Improve some data validity
  • 21f5d8e buffer_cache: Simplify download copy generation
  • c0e6c42 buffer_cache: More precise image alias check
  • 6534008 clang format
  • 35c6e57 buffer_cache: Use copy instead of move
  • e580073 liverpool: Use pending downloads API for rewind
  • f03d0c8 buffer_cache: Backing memory write fixes
  • bc148d0 buffer_cache: Dont create buffers on ReadMemory
  • ec6fc48 buffer_cache: Make ReadMemory thread-safe

📊 Changes

15 files changed (+497 additions, -137 deletions)

View changed files

📝 src/core/memory.cpp (+17 -8)
📝 src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp (+14 -7)
📝 src/shader_recompiler/ir/passes/shader_info_collection_pass.cpp (+4 -0)
📝 src/video_core/amdgpu/liverpool.cpp (+67 -42)
📝 src/video_core/amdgpu/liverpool.h (+7 -1)
📝 src/video_core/amdgpu/pm4_cmds.h (+2 -2)
📝 src/video_core/buffer_cache/buffer_cache.cpp (+273 -49)
📝 src/video_core/buffer_cache/buffer_cache.h (+45 -9)
📝 src/video_core/buffer_cache/memory_tracker.h (+9 -0)
📝 src/video_core/buffer_cache/range_set.h (+5 -0)
📝 src/video_core/page_manager.cpp (+1 -0)
📝 src/video_core/renderer_vulkan/vk_rasterizer.cpp (+31 -5)
📝 src/video_core/renderer_vulkan/vk_rasterizer.h (+3 -0)
📝 src/video_core/renderer_vulkan/vk_scheduler.cpp (+15 -14)
📝 src/video_core/renderer_vulkan/vk_scheduler.h (+4 -0)

📄 Description

This is essentially a readbacks-lite, which tries to give most of the benefits of readbacks without the steep performance cost. It also appears to fix the brightness problems in Driveclub.

It's still highly WIP and prone to instability so opening as draft. Also @LNDF your PR seems to break something in the region manager when messing with GPU bits, so I have your PR reverted here until its fixed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/3150 **Author:** [@raphaelthegreat](https://github.com/raphaelthegreat) **Created:** 6/22/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `rewind-flush` --- ### 📝 Commits (10+) - [`9298533`](https://github.com/shadps4-emu/shadPS4/commit/929853321be5e5b8cbe09199eeea05ad2f4b5ba2) liverpool: Flush buffers on Rewind packet - [`2ca34c4`](https://github.com/shadps4-emu/shadPS4/commit/2ca34c4d94a2b7f8d6d6e6fd08de3b1b26f799f5) video_core: Improve some data validity - [`21f5d8e`](https://github.com/shadps4-emu/shadPS4/commit/21f5d8e60822a039494454dfe495ded15f55b1e3) buffer_cache: Simplify download copy generation - [`c0e6c42`](https://github.com/shadps4-emu/shadPS4/commit/c0e6c42d945c8e69c4084c3c05bd1eefbe882117) buffer_cache: More precise image alias check - [`6534008`](https://github.com/shadps4-emu/shadPS4/commit/6534008e7000ff4185ae0cc33a68098098326e76) clang format - [`35c6e57`](https://github.com/shadps4-emu/shadPS4/commit/35c6e574692690a604440063bcf6200e272cbf0f) buffer_cache: Use copy instead of move - [`e580073`](https://github.com/shadps4-emu/shadPS4/commit/e580073430d1857a70c566dffc1378f6f2bdcce1) liverpool: Use pending downloads API for rewind - [`f03d0c8`](https://github.com/shadps4-emu/shadPS4/commit/f03d0c841e163c49f8a165eae9b1515d3757a2f1) buffer_cache: Backing memory write fixes - [`bc148d0`](https://github.com/shadps4-emu/shadPS4/commit/bc148d070131d67ff44e32bfa6de766b890fd968) buffer_cache: Dont create buffers on ReadMemory - [`ec6fc48`](https://github.com/shadps4-emu/shadPS4/commit/ec6fc48049ae257ed4ad1c1d5598f68a62cef49f) buffer_cache: Make ReadMemory thread-safe ### 📊 Changes **15 files changed** (+497 additions, -137 deletions) <details> <summary>View changed files</summary> 📝 `src/core/memory.cpp` (+17 -8) 📝 `src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp` (+14 -7) 📝 `src/shader_recompiler/ir/passes/shader_info_collection_pass.cpp` (+4 -0) 📝 `src/video_core/amdgpu/liverpool.cpp` (+67 -42) 📝 `src/video_core/amdgpu/liverpool.h` (+7 -1) 📝 `src/video_core/amdgpu/pm4_cmds.h` (+2 -2) 📝 `src/video_core/buffer_cache/buffer_cache.cpp` (+273 -49) 📝 `src/video_core/buffer_cache/buffer_cache.h` (+45 -9) 📝 `src/video_core/buffer_cache/memory_tracker.h` (+9 -0) 📝 `src/video_core/buffer_cache/range_set.h` (+5 -0) 📝 `src/video_core/page_manager.cpp` (+1 -0) 📝 `src/video_core/renderer_vulkan/vk_rasterizer.cpp` (+31 -5) 📝 `src/video_core/renderer_vulkan/vk_rasterizer.h` (+3 -0) 📝 `src/video_core/renderer_vulkan/vk_scheduler.cpp` (+15 -14) 📝 `src/video_core/renderer_vulkan/vk_scheduler.h` (+4 -0) </details> ### 📄 Description This is essentially a readbacks-lite, which tries to give most of the benefits of readbacks without the steep performance cost. It also appears to fix the brightness problems in Driveclub. It's still highly WIP and prone to instability so opening as draft. Also @LNDF your PR seems to break something in the region manager when messing with GPU bits, so I have your PR reverted here until its fixed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:03:03 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#3264
No description provided.