mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-25 07:46:01 +03:00
[PR #2991] [MERGED] shader_recompiler: Patch SRT walker on segfault #3133
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#3133
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/2991
Author: @LNDF
Created: 5/26/2025
Status: ✅ Merged
Merged: 6/9/2025
Merged by: @georgemoralis
Base:
main← Head:walker-acces-violation📝 Commits (5)
c1cca20Patch srt walker access violations01ce538Fix ranged3f2aedclang-format lolz20b9e8cLower log from warning to debugffdbcb0Merge branch 'shadps4-emu:main' into walker-acces-violation📊 Changes
2 files changed (+64 additions, -0 deletions)
View changed files
📝
src/core/signals.h(+1 -0)📝
src/shader_recompiler/ir/passes/flatten_extended_userdata_pass.cpp(+63 -0)📄 Description
This PR introduces patching the SRT walker when an access violation happens. Access violation can happen because SRT wlker is not 100% accurate to the base shader (for example, arithmetic operations between base ReadConst/UserData are omited). This can lead to a situiation where the SRT waslker reads junk data or, when indirection happens, can even cause access violation. Additionaly, we omit ReadConst with non.immediate offset from the SRT walker, increesing the cnances of an access violation.
As far as I know, flatbuf is used in 3 instances.
The goal of this PR is to let the emulation continue if an access violation occurs on SRT walker, providing a fallback value (0). The idea is that most games that use this level of indirection that could lead to an access violation fall into the first case, meaning that we would only (maybe) get an artifact for a frame.
This lets Until Dawn go further.
Note that this doesn't aim to fix not being able to track resources flatbuf inaccuracies (case 3). This happens on Persona 3 (which is a UE game).
Note that this is my first time dynamic-patching instructions, so I might have done something horribly wrong :)
Draft because I would like to be tested first.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.