Open gandalth opened 1 week ago
https://github.com/shadps4-emu/shadPS4/blob/main/src/shader_recompiler/frontend/translate/scalar_memory.cpp#L41
Can you debug what is smrd
at the time of the unreachable?
Sure, happy to help!
Would I have to recompile in order to do that? My current build (on Linux Debian Testing) has been compiled like this:
cmake .. -DCMAKE_C_COMPILER=clang-19 -DCMAKE_CXX_COMPILER=clang++-19 -DENABLE_DISCORD_RPC=OFF -DENABLE_QT_GUI=ON
Can I use gdb to debug or do you recommend something else?
I'm not quite knowledgeable about Linux, but I'd recommend setting up Visual Studio Code and GDB to make debugging (and most things over all) easier
I recompiled with -DCMAKE_BUILD_TYPE=DEBUG and used ddd/gdb to add a breakpoint.
In ddd, shadps4 receives a SEGFAULT in GAME_MainThread before I reach the UNREACHABLE(). The last smrd I see before that (but does not lead to the UNREACHABLE()) has offset=0, imm=1, count=8.
That one looks correct, but I'm interested in the one that leads to the UNREACHABLE()
This one leads to UNREACHABLE():
smrd.offset = 1 smrd.imm = 0 smrd.count = 4
SQ_SRC_LITERAL = 255
@polybiusproxy : can I help more in finding how we got into the incorrect smrd? I can easily add more debug output in my local copy.
CUSA16194 DIRT 5: shadps4 crashes on startup with this debug information:
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:405: Compiling cs shader 0xf69de71c
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:405: Compiling cs shader 0x394fe8e8
[Core] stubs.cpp:CommonStub:42: Stub: scePthreadSetaffinity (nid: bt3CTBKmGyI) called, returning zero to 0x90068ae09
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:405: Compiling cs shader 0x385a8cf7
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:405: Compiling cs shader 0x385a8cf7
[Debug] \<Critical> scalar_memory.cpp:operator():49: Unreachable code! Trace/breakpoint trap