[PR #2123] [MERGED] shader_recompiler: Improvements to buffer addressing implementation. #2500

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/2123
Author: @squidbus
Created: 1/11/2025
Status: Merged
Merged: 1/17/2025
Merged by: @squidbus

Base: mainHead: buffers


📝 Commits (1)

  • c55647c shader_recompiler: Improvements to buffer addressing implementation.

📊 Changes

5 files changed (+149 additions, -83 deletions)

View changed files

📝 src/shader_recompiler/frontend/translate/vector_memory.cpp (+55 -41)
📝 src/shader_recompiler/ir/passes/constant_propagation_pass.cpp (+9 -3)
📝 src/shader_recompiler/ir/passes/resource_tracking_pass.cpp (+64 -39)
📝 src/shader_recompiler/specialization.h (+11 -0)
📝 src/video_core/amdgpu/resource.h (+10 -0)

📄 Description

Adds a new common buffer addressing implementation, accounting for all of the different components:

  • Fixes handling of index_stride and element_size which need to be converted into their actual value from bit field.
  • Texture buffers still have some limitations, asserted on specially before calling this new function.
  • Parameters from sharp needed for swizzle_enable added to specialization.

And misc related improvements:

  • Add multiply by 1 case to constant propagation pass to help optimize new buffer address logic.
  • Clean up buffer load/store instructions to pass through all the MUBUF/MTBUF flags and let the tracking pass take care of what is and isn't supported in one place.

Fixes some shaders in CUSA05637 that use swizzle addressing.


🔄 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/2123 **Author:** [@squidbus](https://github.com/squidbus) **Created:** 1/11/2025 **Status:** ✅ Merged **Merged:** 1/17/2025 **Merged by:** [@squidbus](https://github.com/squidbus) **Base:** `main` ← **Head:** `buffers` --- ### 📝 Commits (1) - [`c55647c`](https://github.com/shadps4-emu/shadPS4/commit/c55647c4c77a7c1924fdfaa1b22764cb46431290) shader_recompiler: Improvements to buffer addressing implementation. ### 📊 Changes **5 files changed** (+149 additions, -83 deletions) <details> <summary>View changed files</summary> 📝 `src/shader_recompiler/frontend/translate/vector_memory.cpp` (+55 -41) 📝 `src/shader_recompiler/ir/passes/constant_propagation_pass.cpp` (+9 -3) 📝 `src/shader_recompiler/ir/passes/resource_tracking_pass.cpp` (+64 -39) 📝 `src/shader_recompiler/specialization.h` (+11 -0) 📝 `src/video_core/amdgpu/resource.h` (+10 -0) </details> ### 📄 Description Adds a new common buffer addressing implementation, accounting for all of the different components: * Fixes handling of `index_stride` and `element_size` which need to be converted into their actual value from bit field. * Texture buffers still have some limitations, asserted on specially before calling this new function. * Parameters from sharp needed for `swizzle_enable` added to specialization. And misc related improvements: * Add multiply by 1 case to constant propagation pass to help optimize new buffer address logic. * Clean up buffer load/store instructions to pass through all the MUBUF/MTBUF flags and let the tracking pass take care of what is and isn't supported in one place. Fixes some shaders in CUSA05637 that use swizzle addressing. --- <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:09 +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#2500
No description provided.