[PR #2402] [CLOSED] shader_recompiler: Use shared memory buffer for non-compute shared memory. #2703

Closed
opened 2026-02-27 22:00:55 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2402
Author: @squidbus
Created: 2/12/2025
Status: Closed

Base: mainHead: fs-shared-mem


📝 Commits (1)

  • cf47738 shader_recompiler: Use shared memory buffer for non-compute shared memory.

📊 Changes

8 files changed (+16 additions, -51 deletions)

View changed files

📝 CMakeLists.txt (+0 -1)
📝 src/shader_recompiler/backend/spirv/spirv_emit_context.cpp (+5 -6)
📝 src/shader_recompiler/info.h (+2 -2)
📝 src/shader_recompiler/ir/passes/ir_passes.h (+0 -1)
src/shader_recompiler/ir/passes/lower_shared_mem_to_registers.cpp (+0 -38)
📝 src/shader_recompiler/recompiler.cpp (+0 -3)
📝 src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp (+8 -0)
📝 src/video_core/renderer_vulkan/vk_rasterizer.cpp (+1 -0)

📄 Description

Wires up the shared memory buffer emulation to also be used for non-compute shared memory, instead of the current lower-to-registers pass, as it does not take into account the possibility of shared memory stores within branches. I've also fixed a few issues I ran into related to binding the shared memory buffer.

Should improve a few shaders in CUSA28193 that use shared memory in fragment shaders with branching write logic. I didn't see much in the way of visual changes, although a validation error at the title screen about non-dominating variable usage that resulted from the lowering pass is now gone.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/2402 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 2/12/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fs-shared-mem` --- ### 📝 Commits (1) - [`cf47738`](https://github.com/shadps4-emu/shadPS4/commit/cf47738da87de4ef1555fefa3336c98d47dabbc0) shader_recompiler: Use shared memory buffer for non-compute shared memory. ### 📊 Changes **8 files changed** (+16 additions, -51 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+0 -1) 📝 `src/shader_recompiler/backend/spirv/spirv_emit_context.cpp` (+5 -6) 📝 `src/shader_recompiler/info.h` (+2 -2) 📝 `src/shader_recompiler/ir/passes/ir_passes.h` (+0 -1) ➖ `src/shader_recompiler/ir/passes/lower_shared_mem_to_registers.cpp` (+0 -38) 📝 `src/shader_recompiler/recompiler.cpp` (+0 -3) 📝 `src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp` (+8 -0) 📝 `src/video_core/renderer_vulkan/vk_rasterizer.cpp` (+1 -0) </details> ### 📄 Description Wires up the shared memory buffer emulation to also be used for non-compute shared memory, instead of the current lower-to-registers pass, as it does not take into account the possibility of shared memory stores within branches. I've also fixed a few issues I ran into related to binding the shared memory buffer. Should improve a few shaders in CUSA28193 that use shared memory in fragment shaders with branching write logic. I didn't see much in the way of visual changes, although a validation error at the title screen about non-dominating variable usage that resulted from the lowering pass is now gone. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:00:55 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#2703
No description provided.