[PR #1439] [MERGED] shader_recompiler: patch fmask access instructions #2107

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

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1439
Author: @LNDF
Created: 10/23/2024
Status: Merged
Merged: 11/5/2024
Merged by: @psucien

Base: mainHead: fmask-access


📝 Commits (5)

  • 9e2d21f Fix multisample texture fetch
  • 70a25b8 Patch some fmask reads
  • fe7406a clang-format
  • ad9507d Assert insteed of ignore, coordinate fixes
  • f501d13 Patch ImageQueryDimensions

📊 Changes

5 files changed (+93 additions, -4 deletions)

View changed files

📝 src/shader_recompiler/backend/spirv/emit_spirv_image.cpp (+1 -0)
📝 src/shader_recompiler/info.h (+13 -0)
📝 src/shader_recompiler/ir/passes/resource_tracking_pass.cpp (+56 -4)
📝 src/shader_recompiler/specialization.h (+18 -0)
📝 src/video_core/amdgpu/resource.h (+5 -0)

📄 Description

Patch some instructions that access fmask image bound to shader.

This PR patches those reads into constant values and removes the binding all together.

Probable we need to patch more opcodes and do some more testing.

Journey now doesn't assert on liverpool_to_vk.cpp. Insteed it crashes further on image.cpp::236 on the following line of code of the VideoCore::Image::Transit function:

ASSERT(subres_idx < subresource_states.size());

I don't think this is related to this PR bu I might be wrong.

More testing with more games that access fmask is needed.


🔄 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/1439 **Author:** [@LNDF](https://github.com/LNDF) **Created:** 10/23/2024 **Status:** ✅ Merged **Merged:** 11/5/2024 **Merged by:** [@psucien](https://github.com/psucien) **Base:** `main` ← **Head:** `fmask-access` --- ### 📝 Commits (5) - [`9e2d21f`](https://github.com/shadps4-emu/shadPS4/commit/9e2d21f8873cab268d8e4d9b8875139d5dff0706) Fix multisample texture fetch - [`70a25b8`](https://github.com/shadps4-emu/shadPS4/commit/70a25b87d303981f084179cc0d6a564f370bbb38) Patch some fmask reads - [`fe7406a`](https://github.com/shadps4-emu/shadPS4/commit/fe7406a4feaba1c33f7b2f340ee3ce75d95534ab) clang-format - [`ad9507d`](https://github.com/shadps4-emu/shadPS4/commit/ad9507dbfddf63b839d511cc466f4fbf8df3c761) Assert insteed of ignore, coordinate fixes - [`f501d13`](https://github.com/shadps4-emu/shadPS4/commit/f501d13c215b9fda638c8a2894dd81d0c4945963) Patch ImageQueryDimensions ### 📊 Changes **5 files changed** (+93 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/shader_recompiler/backend/spirv/emit_spirv_image.cpp` (+1 -0) 📝 `src/shader_recompiler/info.h` (+13 -0) 📝 `src/shader_recompiler/ir/passes/resource_tracking_pass.cpp` (+56 -4) 📝 `src/shader_recompiler/specialization.h` (+18 -0) 📝 `src/video_core/amdgpu/resource.h` (+5 -0) </details> ### 📄 Description Patch some instructions that access fmask image bound to shader. This PR patches those reads into constant values and removes the binding all together. Probable we need to patch more opcodes and do some more testing. Journey now doesn't assert on liverpool_to_vk.cpp. Insteed it crashes further on image.cpp::236 on the following line of code of the VideoCore::Image::Transit function: ```c++ ASSERT(subres_idx < subresource_states.size()); ``` I don't think this is related to this PR bu I might be wrong. More testing with more games that access fmask is needed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:15: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#2107
No description provided.