mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-25 07:46:01 +03:00
[PR #3374] [MERGED] video_core: Rework tile manager #3424
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#3424
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/3374
Author: @raphaelthegreat
Created: 8/3/2025
Status: ✅ Merged
Merged: 8/8/2025
Merged by: @squidbus
Base:
main← Head:tiling-rework📝 Commits (10+)
a8b5b06video_core: Rework detilinga710487video_core: Support tiling and macrotile detiling1be60e7clang format6e55635image_info: Cleanups336e0b9resource: Revert some changes74484dctexture_cache: Fix small error52058c9image_info: Set depth flag on depth promote6e0a894buffer_cache: Remove level check7324929tile_manager: Handle case of staging buffer causing flush3a14843image_info: Add 2D thick array mode📊 Changes
30 files changed (+2001 additions, -799 deletions)
View changed files
📝
CMakeLists.txt(+2 -0)📝
src/core/devtools/widget/reg_popup.cpp(+1 -1)📝
src/shader_recompiler/info.h(+2 -2)📝
src/shader_recompiler/specialization.h(+1 -1)📝
src/video_core/amdgpu/liverpool.h(+14 -6)📝
src/video_core/amdgpu/pixel_format.cpp(+61 -10)📝
src/video_core/amdgpu/pixel_format.h(+7 -2)📝
src/video_core/amdgpu/resource.h(+39 -64)➕
src/video_core/amdgpu/tiling.cpp(+554 -0)➕
src/video_core/amdgpu/tiling.h(+149 -0)📝
src/video_core/buffer_cache/buffer_cache.cpp(+102 -134)📝
src/video_core/buffer_cache/buffer_cache.h(+6 -7)📝
src/video_core/host_shaders/CMakeLists.txt(+1 -0)➕
src/video_core/host_shaders/tiling.comp(+444 -0)📝
src/video_core/renderer_vulkan/vk_instance.cpp(+7 -0)📝
src/video_core/renderer_vulkan/vk_instance.h(+6 -0)📝
src/video_core/renderer_vulkan/vk_presenter.h(+1 -0)📝
src/video_core/renderer_vulkan/vk_rasterizer.cpp(+75 -17)📝
src/video_core/renderer_vulkan/vk_rasterizer.h(+1 -0)📝
src/video_core/texture_cache/image.cpp(+70 -55)...and 10 more files
📄 Description
This started with the goal of supporting Texture_Macrotiled detiling and turned into a rework of the tiling system
General changes
Tile manager changes
Detilers are now consistent in terms of padding. On main, 1D thin detilers would produce padded output, while volume detilers would produce packed output, because the latter would index the output buffer instead of input (side note, but on main the volume detiler is named macro which seems incorrect from my research, as volume textures are 1D thick not 2D tiled). Padded output was chosen because it is more convenient, as it allows to offset the linear surface using the mip info structures generated during image size calculation and removes the need for address bounds checking in shader (number of texels processed is always multiple of 64)
Support for tiling has been added as well with a simple macro parameter. This is used for macrotile handling (read below)
Textures with bpp < 32 now have better GPU occupancy during detiling as it can use the full subgroup length on AMD GPUs
Macrotile support changes
Since the original goal was this, support for detiling macrotile images is also added and I've verified it works from Knack, which uses Texture_Macrotile image for its fonts. However this isn't as simple because this path is also used by image copies with compute and it implicitly relies on the detiling failing (SynchronizeBufferFromImage copies the linear image data to buffers without any tiling). This is where tile shader comes in, now the buffer cache will tile the image data before copying it to the buffer, so texture cache can allow detiling of macrotile images. This adds some overhead so before merging I will add a fast path that detects image copies and uses vkCmdCopyImage but it's also more accurate to real hardware.
Note: This still doesn't handle degrading of macro tile mode to micro tile for mipmaps, but it should be easier to implement now
This fixes the font in Knack
TODO
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.