mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-25 15:56:00 +03:00
[PR #2245] [MERGED] renderer_vulkan: use LDS buffer as SSBO on unsupported shared memory size #2592
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#2592
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/2245
Author: @polybiusproxy
Created: 1/26/2025
Status: ✅ Merged
Merged: 1/31/2025
Merged by: @georgemoralis
Base:
main← Head:lds-ssbo📝 Commits (2)
4e59a1erenderer_vulkan: use LDS buffer as SSBO on unsupported shared memory sizea0a1adfshader_recompiler: addv_trunc_f64on inst format table📊 Changes
14 files changed (+147 additions, -36 deletions)
View changed files
📝
src/shader_recompiler/backend/spirv/emit_spirv_shared_memory.cpp(+58 -16)📝
src/shader_recompiler/backend/spirv/spirv_emit_context.cpp(+35 -10)📝
src/shader_recompiler/backend/spirv/spirv_emit_context.h(+2 -2)📝
src/shader_recompiler/frontend/decode.cpp(+2 -2)📝
src/shader_recompiler/frontend/format.cpp(+3 -1)📝
src/shader_recompiler/info.h(+2 -0)📝
src/shader_recompiler/profile.h(+1 -0)📝
src/shader_recompiler/runtime_info.h(+0 -1)📝
src/shader_recompiler/specialization.h(+9 -0)📝
src/video_core/buffer_cache/buffer_cache.cpp(+4 -2)📝
src/video_core/buffer_cache/buffer_cache.h(+6 -0)📝
src/video_core/renderer_vulkan/vk_compute_pipeline.cpp(+8 -0)📝
src/video_core/renderer_vulkan/vk_pipeline_cache.cpp(+1 -1)📝
src/video_core/renderer_vulkan/vk_rasterizer.cpp(+16 -1)📄 Description
To emulate LDS, a workgroup shared variable is made, however, this can't be done if the GPU has insufficient amounts of shared memory to meet the needs of the shader. Before PR https://github.com/shadps4-emu/shadPS4/pull/2175, if this was the case, there would be device losses.
To avoid this, if the GPU doesn't have enough shared memory size, LDS is emulated using a device local buffer bound as SSBO. This is not as optimal as a workgroup shared variable would be, but it is the only way.
This PR mainly aims to resolve one of the issues present on Gran Turismo Sport (https://github.com/shadps4-emu/shadPS4/issues/2181).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.