[PR #3707] [MERGED] amdgpu: Split liverpool registers and cleanup #3674

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/3707
Author: @raphaelthegreat
Created: 10/5/2025
Status: Merged
Merged: 10/5/2025
Merged by: @squidbus

Base: mainHead: liverpool-split


📝 Commits (1)

  • 61588da amdgpu: Split liverpool registers and cleanup

📊 Changes

75 files changed (+2505 additions, -2641 deletions)

View changed files

📝 CMakeLists.txt (+12 -5)
📝 src/common/number_utils.cpp (+5 -11)
📝 src/core/debug_state.cpp (+10 -11)
📝 src/core/debug_state.h (+8 -7)
📝 src/core/devtools/widget/cmd_list.cpp (+126 -126)
📝 src/core/devtools/widget/cmd_list.h (+2 -3)
📝 src/core/devtools/widget/reg_popup.cpp (+54 -53)
📝 src/core/devtools/widget/reg_popup.h (+19 -13)
📝 src/core/devtools/widget/reg_view.cpp (+5 -6)
📝 src/core/devtools/widget/reg_view.h (+6 -5)
📝 src/core/libraries/videoout/driver.cpp (+1 -0)
📝 src/shader_recompiler/backend/spirv/emit_spirv.cpp (+7 -8)
📝 src/shader_recompiler/backend/spirv/emit_spirv_atomic.cpp (+2 -4)
📝 src/shader_recompiler/backend/spirv/emit_spirv_special.cpp (+2 -2)
📝 src/shader_recompiler/backend/spirv/spirv_emit_context.cpp (+3 -4)
src/shader_recompiler/exception.h (+0 -64)
📝 src/shader_recompiler/frontend/structured_control_flow.cpp (+2 -2)
📝 src/shader_recompiler/frontend/translate/export.cpp (+13 -13)
📝 src/shader_recompiler/frontend/translate/translate.cpp (+1 -1)
📝 src/shader_recompiler/frontend/translate/vector_interpolation.cpp (+1 -0)

...and 55 more files

📄 Description

This is something I've been wanting for a while but never found motivation to do so. The liverpool header has grown pretty huge over time and because all the register structures and enums are nested inside it, they cannot be forward declared, forcing users to include the full heavyweight header to just use a small part of it. So the proposed patch does the following:

  • Pull out and split register structures and enums into headers for every register category as defined in the AMD southern islands register reference manual: CB, DB, VGT, PA, TP, SPI/COMP (compute registers are just a single struct and share a lot of code with SPI)
  • With above done, attempt to replace liverpool.h includes with forward declarations or inclusions of specific necessary headers

While implementing that I've also done some additional cleanup where appropriate

  • Unified texture cache descriptors into a single ImageDesc with multiple constructors, simpler than a bunch of child classes.
  • Split out resource structures from info.h in recompiler so image_info doesn't need to include all of it
  • Replaced BitField usage in liverpool registers with normal bitfields. While the bitfield class has advantages, it is annoying not being able to see the values of bitfields when debugging
  • Removed exceptions from recompiler entirely. The initial plan for those was to catch exceptions when recompiling shaders and skip the draw if anything failed but this never materialized and isn't useful anymore
  • GetParams now avoids calling SearchBinaryInfo twice (on main, it gets called once from Code function and another from GetParams which also called Code.

Probably needs a ton of testing to ensure nothing broke


🔄 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/3707 **Author:** [@raphaelthegreat](https://github.com/raphaelthegreat) **Created:** 10/5/2025 **Status:** ✅ Merged **Merged:** 10/5/2025 **Merged by:** [@squidbus](https://github.com/squidbus) **Base:** `main` ← **Head:** `liverpool-split` --- ### 📝 Commits (1) - [`61588da`](https://github.com/shadps4-emu/shadPS4/commit/61588dab2498eda4dc295fc037c1880ec9985fd5) amdgpu: Split liverpool registers and cleanup ### 📊 Changes **75 files changed** (+2505 additions, -2641 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+12 -5) 📝 `src/common/number_utils.cpp` (+5 -11) 📝 `src/core/debug_state.cpp` (+10 -11) 📝 `src/core/debug_state.h` (+8 -7) 📝 `src/core/devtools/widget/cmd_list.cpp` (+126 -126) 📝 `src/core/devtools/widget/cmd_list.h` (+2 -3) 📝 `src/core/devtools/widget/reg_popup.cpp` (+54 -53) 📝 `src/core/devtools/widget/reg_popup.h` (+19 -13) 📝 `src/core/devtools/widget/reg_view.cpp` (+5 -6) 📝 `src/core/devtools/widget/reg_view.h` (+6 -5) 📝 `src/core/libraries/videoout/driver.cpp` (+1 -0) 📝 `src/shader_recompiler/backend/spirv/emit_spirv.cpp` (+7 -8) 📝 `src/shader_recompiler/backend/spirv/emit_spirv_atomic.cpp` (+2 -4) 📝 `src/shader_recompiler/backend/spirv/emit_spirv_special.cpp` (+2 -2) 📝 `src/shader_recompiler/backend/spirv/spirv_emit_context.cpp` (+3 -4) ➖ `src/shader_recompiler/exception.h` (+0 -64) 📝 `src/shader_recompiler/frontend/structured_control_flow.cpp` (+2 -2) 📝 `src/shader_recompiler/frontend/translate/export.cpp` (+13 -13) 📝 `src/shader_recompiler/frontend/translate/translate.cpp` (+1 -1) 📝 `src/shader_recompiler/frontend/translate/vector_interpolation.cpp` (+1 -0) _...and 55 more files_ </details> ### 📄 Description This is something I've been wanting for a while but never found motivation to do so. The liverpool header has grown pretty huge over time and because all the register structures and enums are nested inside it, they cannot be forward declared, forcing users to include the full heavyweight header to just use a small part of it. So the proposed patch does the following: * Pull out and split register structures and enums into headers for every register category as defined in the AMD southern islands register reference manual: CB, DB, VGT, PA, TP, SPI/COMP (compute registers are just a single struct and share a lot of code with SPI) * With above done, attempt to replace liverpool.h includes with forward declarations or inclusions of specific necessary headers While implementing that I've also done some additional cleanup where appropriate * Unified texture cache descriptors into a single ImageDesc with multiple constructors, simpler than a bunch of child classes. * Split out resource structures from info.h in recompiler so image_info doesn't need to include all of it * Replaced BitField usage in liverpool registers with normal bitfields. While the bitfield class has advantages, it is annoying not being able to see the values of bitfields when debugging * Removed exceptions from recompiler entirely. The initial plan for those was to catch exceptions when recompiling shaders and skip the draw if anything failed but this never materialized and isn't useful anymore * GetParams now avoids calling SearchBinaryInfo twice (on main, it gets called once from Code function and another from GetParams which also called Code. Probably needs a ton of testing to ensure nothing broke --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:04:34 +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#3674
No description provided.