mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-26 00:05:58 +03:00
[PR #3103] [MERGED] texture_cache: Implement color to multisampled depth blit pass #3226
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#3226
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/3103
Author: @raphaelthegreat
Created: 6/16/2025
Status: ✅ Merged
Merged: 6/16/2025
Merged by: @georgemoralis
Base:
main← Head:color-ms-depth📝 Commits (1)
05f9c6dtexture_cache: Implement color to multisampled depth blit pass📊 Changes
9 files changed (+356 additions, -10 deletions)
View changed files
📝
CMakeLists.txt(+4 -2)📝
src/video_core/host_shaders/CMakeLists.txt(+1 -0)➕
src/video_core/host_shaders/color_to_ms_depth.frag(+15 -0)📝
src/video_core/renderer_vulkan/vk_scheduler.h(+1 -0)➕
src/video_core/texture_cache/blit_helper.cpp(+256 -0)➕
src/video_core/texture_cache/blit_helper.h(+55 -0)📝
src/video_core/texture_cache/image_info.h(+1 -0)📝
src/video_core/texture_cache/texture_cache.cpp(+21 -8)📝
src/video_core/texture_cache/texture_cache.h(+2 -0)📄 Description
This fixes the snow and rain particles covering all of the screen inside the car in Driveclub (CUSA00093). It also fixes the windshield and other depth related bugs in Cayoosh Point race.
It is yet another silly aliasing case between color and depth buffers, but a little more complicated than just R32 and D32 images. The color is an R32G32B32A32 texture written by a compute shader and the depth is 4x multi-sampled D32 image. The guest essentially utilizes the hardware layout of the samples to avoid doing a conversion pass and alias the memory instead.
Vulkan doesn't' allow buffer->image copies when the image has more than 1 sample. Also since the target is a depth buffer we can't bind it as a multi-sampled storage image and write to it. So to implement the conversion this PR add a helper blit pass with a fullscreen pass that reads from the input texture channels and writes to gl_FragDepth.
Also because this depth buffer is bound alongside an HTILE buffer (something that didn't happen in previous case), I've also added some code to prevent initialize HTILE meta to cleared state when the depth buffer is created through overlap, so the conversion done isn't lost to a clear
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.