mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-25 15:56:00 +03:00
[PR #3056] [MERGED] texture_cache: Handle compressed views of uncompressed images #3184
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#3184
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/3056
Author: @raphaelthegreat
Created: 6/8/2025
Status: ✅ Merged
Merged: 6/8/2025
Merged by: @georgemoralis
Base:
main← Head:block-view📝 Commits (6)
b60f821pixel_format: Remove unused tables, refactor70c7fd4host_compatibilty: Cleanup and support uncompressed views of compressed formatsa7f91d8texture_cache: Handle compressed views of uncompressed imagesa82f3cetile_manager: Bump max supported mips to 16e9672ffoopsd8f28cctexture_cache: Fix order of format compat check📊 Changes
17 files changed (+434 additions, -609 deletions)
View changed files
📝
CMakeLists.txt(+1 -0)📝
src/shader_recompiler/ir/passes/lower_buffer_format_to_raw.cpp(+1 -1)📝
src/video_core/amdgpu/liverpool.h(+1 -1)📝
src/video_core/amdgpu/pixel_format.cpp(+92 -122)📝
src/video_core/amdgpu/pixel_format.h(+2 -4)📝
src/video_core/host_shaders/detilers/micro_128bpp.comp(+1 -1)📝
src/video_core/host_shaders/detilers/micro_16bpp.comp(+1 -1)📝
src/video_core/host_shaders/detilers/micro_32bpp.comp(+1 -1)📝
src/video_core/host_shaders/detilers/micro_64bpp.comp(+1 -1)📝
src/video_core/host_shaders/detilers/micro_8bpp.comp(+1 -1)➕
src/video_core/texture_cache/host_compatibility.cpp(+220 -0)📝
src/video_core/texture_cache/host_compatibility.h(+2 -378)📝
src/video_core/texture_cache/image.cpp(+6 -59)📝
src/video_core/texture_cache/image_info.cpp(+76 -3)📝
src/video_core/texture_cache/image_info.h(+7 -18)📝
src/video_core/texture_cache/texture_cache.cpp(+15 -10)📝
src/video_core/texture_cache/tile_manager.cpp(+6 -8)📄 Description
Fixes the missing car colors in Driveclub (CUSA00093). The game renders the car paint textures as R32G32B32A32 and then uses a compute shader to write to another texture of the same format. It turns out this is a BC3 compression shader, as the game will later request the that storage image as BC3. The texture cache considered this a bad match and threw out the generated one, in favor of an empty black image.
This is fixed by relaxing the mismatch check to use dimention in blocks instead of texels and checking bits per block as a rough estimate of compatibility. Then an image copy is issued in the uncompressed -> compressed conversion. On AMD GPUs having a compressed view of an uncompressed image works just fine, but on NVIDIA it doesn't, so the copy is required.
The vulkan compatibility rule table has also been expanded to handle size compatibility, when VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT is enabled which is used now. This ensures that if the image is requested in uncompressed format again, the cache can use an image view on the compressed image instead of creating a new image again.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.