mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 08:15:59 +03:00
[PR #757] [MERGED] video_core: Improve handling of image buffer aliases #1754
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#1754
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/757
Author: @raphaelthegreat
Created: 9/3/2024
Status: ✅ Merged
Merged: 9/5/2024
Merged by: @raphaelthegreat
Base:
main← Head:inv-fixes📝 Commits (10+)
f2b714ftexture_cache: Use invalidate threshhold0f2892avideo_core: Allow using texture cache to validate texture bufferse2b63bftexture_cache: Use buffer cache in all cases for data source36a515ftexture_cache: Fix depth pitch99b8dc5kernel: Remove missed codee6325d2clang formatcb66b92video_core: Adjust depth format3c0e11fbuffer_cache: Do not cache buffer viewsa871390thread_management: Do not call createMutex on unlocke887992temp: Revert this when pr is done📊 Changes
18 files changed (+248 additions, -191 deletions)
View changed files
📝
src/core/libraries/kernel/thread_management.cpp(+1 -7)📝
src/video_core/buffer_cache/buffer.cpp(+12 -24)📝
src/video_core/buffer_cache/buffer.h(+5 -13)📝
src/video_core/buffer_cache/buffer_cache.cpp(+91 -16)📝
src/video_core/buffer_cache/buffer_cache.h(+7 -3)📝
src/video_core/renderer_vulkan/vk_compute_pipeline.cpp(+7 -6)📝
src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp(+14 -9)📝
src/video_core/renderer_vulkan/vk_instance.cpp(+1 -0)📝
src/video_core/renderer_vulkan/vk_platform.cpp(+2 -0)📝
src/video_core/renderer_vulkan/vk_rasterizer.cpp(+1 -1)📝
src/video_core/texture_cache/host_compatibility.h(+5 -4)📝
src/video_core/texture_cache/image.cpp(+3 -2)📝
src/video_core/texture_cache/image_info.cpp(+2 -2)📝
src/video_core/texture_cache/image_view.cpp(+2 -1)📝
src/video_core/texture_cache/texture_cache.cpp(+51 -63)📝
src/video_core/texture_cache/texture_cache.h(+36 -25)📝
src/video_core/texture_cache/tile_manager.cpp(+7 -14)📝
src/video_core/texture_cache/tile_manager.h(+1 -1)📄 Description
Tldr, these fixes allow Bloodborne character creator to show graphics on main, improve lighting on main game and fix the distorted motion blur
Fixes the pitch being wrongly set to the width of the image for depth buffer specifically.
Implements a new method of the buffer cache to validate buffers, SynchronizeBufferFromImage. This is specifically used for texture buffers as those are the only resources observed to rely on this aliasing so far. Bloodborne specifically uses compute shader to copy framebuffers (both depth and color) so with this change it will now work properly and without hacks.
Use buffer cache for not just macro tiled images but for any type of image. This means if a game uses compute to write texture data it will work and detile shader will automatically use already available GPU buffer.
Added a max invalidation distance heuristic. This avoid unnecessary copies by avoiding invalidating render targets far away from invalidation base address. If a shader intends to modify an image it is much more likely it will be bound exactly at or close to the image guest address.
Before this is merged the additional validation path needs to be expanded to allow for more copies inside the heuristic range, instead of looking of 1 match
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.