[PR #165] [MERGED] shader_recompiler: Address some minor issues #1354

Closed
opened 2026-02-27 21:12:13 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/165
Author: @raphaelthegreat
Created: 6/5/2024
Status: Merged
Merged: 6/6/2024
Merged by: @georgemoralis

Base: mainHead: bad-phi


📝 Commits (3)

  • ae7e6da shader_recompiler: Add more instructions and fix a few thinhs
  • 705d326 kernel: Fix stack corruption from OrbisTimesec
  • 5aa3a4d shader: Fix block processing order in dead code elimination pass

📊 Changes

25 files changed (+307 additions, -155 deletions)

View changed files

📝 src/core/libraries/kernel/libkernel.h (+2 -2)
📝 src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp (+8 -3)
📝 src/shader_recompiler/frontend/control_flow_graph.h (+1 -0)
📝 src/shader_recompiler/frontend/structured_control_flow.cpp (+6 -4)
📝 src/shader_recompiler/frontend/translate/scalar_alu.cpp (+93 -14)
📝 src/shader_recompiler/frontend/translate/scalar_memory.cpp (+12 -23)
📝 src/shader_recompiler/frontend/translate/translate.cpp (+32 -16)
📝 src/shader_recompiler/frontend/translate/translate.h (+5 -2)
📝 src/shader_recompiler/frontend/translate/vector_alu.cpp (+26 -11)
📝 src/shader_recompiler/ir/ir_emitter.cpp (+2 -2)
📝 src/shader_recompiler/ir/ir_emitter.h (+1 -1)
📝 src/shader_recompiler/ir/opcodes.inc (+1 -1)
📝 src/shader_recompiler/ir/passes/dead_code_elimination_pass.cpp (+3 -3)
📝 src/shader_recompiler/ir/passes/ir_passes.h (+1 -1)
📝 src/shader_recompiler/ir/passes/resource_tracking_pass.cpp (+12 -12)
📝 src/shader_recompiler/ir/value.h (+0 -1)
📝 src/shader_recompiler/recompiler.cpp (+1 -1)
📝 src/video_core/amdgpu/liverpool.cpp (+21 -0)
📝 src/video_core/amdgpu/pm4_cmds.h (+11 -0)
📝 src/video_core/renderer_vulkan/liverpool_to_vk.cpp (+9 -0)

...and 5 more files

📄 Description

  • Add more instructions as usual
  • Fix a minor bug in structurizer that made it emit code for dummy merge blocks. Mark the block as dummy to avoid that.
  • Fix block search order in dead code elimination pass. Sometimes it would miss some unused phi's before and those phis might be misformed too
  • Fix stack guard corruption caused by a kernel function. Should allow games that called it to continue and not crash on stack guard

🔄 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/165 **Author:** [@raphaelthegreat](https://github.com/raphaelthegreat) **Created:** 6/5/2024 **Status:** ✅ Merged **Merged:** 6/6/2024 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `bad-phi` --- ### 📝 Commits (3) - [`ae7e6da`](https://github.com/shadps4-emu/shadPS4/commit/ae7e6dafd53038fba15caf30d0f8164bfd2e1056) shader_recompiler: Add more instructions and fix a few thinhs - [`705d326`](https://github.com/shadps4-emu/shadPS4/commit/705d326a6d29c94bfb55abeb33b82768b692e987) kernel: Fix stack corruption from OrbisTimesec - [`5aa3a4d`](https://github.com/shadps4-emu/shadPS4/commit/5aa3a4d4a00c720b1285c05a1b5bf6c85820c690) shader: Fix block processing order in dead code elimination pass ### 📊 Changes **25 files changed** (+307 additions, -155 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/kernel/libkernel.h` (+2 -2) 📝 `src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp` (+8 -3) 📝 `src/shader_recompiler/frontend/control_flow_graph.h` (+1 -0) 📝 `src/shader_recompiler/frontend/structured_control_flow.cpp` (+6 -4) 📝 `src/shader_recompiler/frontend/translate/scalar_alu.cpp` (+93 -14) 📝 `src/shader_recompiler/frontend/translate/scalar_memory.cpp` (+12 -23) 📝 `src/shader_recompiler/frontend/translate/translate.cpp` (+32 -16) 📝 `src/shader_recompiler/frontend/translate/translate.h` (+5 -2) 📝 `src/shader_recompiler/frontend/translate/vector_alu.cpp` (+26 -11) 📝 `src/shader_recompiler/ir/ir_emitter.cpp` (+2 -2) 📝 `src/shader_recompiler/ir/ir_emitter.h` (+1 -1) 📝 `src/shader_recompiler/ir/opcodes.inc` (+1 -1) 📝 `src/shader_recompiler/ir/passes/dead_code_elimination_pass.cpp` (+3 -3) 📝 `src/shader_recompiler/ir/passes/ir_passes.h` (+1 -1) 📝 `src/shader_recompiler/ir/passes/resource_tracking_pass.cpp` (+12 -12) 📝 `src/shader_recompiler/ir/value.h` (+0 -1) 📝 `src/shader_recompiler/recompiler.cpp` (+1 -1) 📝 `src/video_core/amdgpu/liverpool.cpp` (+21 -0) 📝 `src/video_core/amdgpu/pm4_cmds.h` (+11 -0) 📝 `src/video_core/renderer_vulkan/liverpool_to_vk.cpp` (+9 -0) _...and 5 more files_ </details> ### 📄 Description * Add more instructions as usual * Fix a minor bug in structurizer that made it emit code for dummy merge blocks. Mark the block as dummy to avoid that. * Fix block search order in dead code elimination pass. Sometimes it would miss some unused phi's before and those phis might be misformed too * Fix stack guard corruption caused by a kernel function. Should allow games that called it to continue and not crash on stack guard --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:12:13 +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#1354
No description provided.