mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-27 08:46:03 +03:00
[PR #3066] [MERGED] texture_cache: Basic handling of partially resident images #3191
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#3191
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/3066
Author: @raphaelthegreat
Created: 6/9/2025
Status: ✅ Merged
Merged: 6/9/2025
Merged by: @squidbus
Base:
main← Head:prt-init📝 Commits (3)
d279dfatexture_cache: Avoid gpu tracking assert on sparse image1db18c9tile_manager: Downgrade assert to error79daebafix macos📊 Changes
6 files changed (+73 additions, -3 deletions)
View changed files
📝
src/core/libraries/kernel/memory.cpp(+3 -0)📝
src/core/memory.cpp(+40 -0)📝
src/core/memory.h(+16 -0)📝
src/video_core/buffer_cache/buffer_cache.cpp(+5 -2)📝
src/video_core/buffer_cache/buffer_cache.h(+5 -0)📝
src/video_core/texture_cache/tile_manager.cpp(+4 -1)📄 Description
This allows Driveclub (CUSA00093) to go in-game without any hacks.
The game setups a PRT area, maps only some pages inside it and creates a render target covering all of it causing a gpu tracking assert to kick in. To avoid this the memory manager will register active PRT areas and map those areas to gpu, so the page manager can track any image inside the region. Meanwhile access to cpu memory will be handled via a new function CopySparseMemory which behaves the same as a memcpy, except when source address is a PRT area, where it will copy only mapped regions, while zeroing unmapped areas.
Using host sparse feature would be ideal, but its very inconvenient as host sparse page size and alignment might differ a lot from the guest. So its a lot easier to eat the extra memory cost of creating the non sparse version of the full image. This can also be expanded in the future with subresource uploads, on every gpu map we can invalidate the texture cache and reupload parts of PRT that were mapped. This isn't done here as that would trash the entire thing (due to unimplemented subres upload) and DC uses it as a render target
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.