Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The way to Unity, pt.2 #1671

Merged
merged 1 commit into from
Dec 6, 2024
Merged

The way to Unity, pt.2 #1671

merged 1 commit into from
Dec 6, 2024

Conversation

polybiusproxy
Copy link
Collaborator

@polybiusproxy polybiusproxy commented Dec 5, 2024

A big roadblock for Unity on Windows is the use of exceptions, and to implement those, we need to do some preparations.
The idea is to use APCs—for this, we must switch our code to use alertable waits with Win32 wrappers on:

  • Pthread condition waits
  • Pthread mutexes
  • Orbis and POSIX semaphores
  • Thread sleeps
  • Event flags (was not seen on Unity, thus not a priority)

This will allow us to properly implement exceptions later on.

@StevenMiller123

This comment was marked as resolved.

@ElBread3

This comment was marked as resolved.

@gandalfthewhite19890404

This comment was marked as resolved.

@polybiusproxy
Copy link
Collaborator Author

This PR noticably regresses performance in UE4 titles. This is especially noticable in Dragon Ball Z Kakarot. A severe performance regression is also noticable in updated versions of Hatsune Miku Project Diva X.

And Touhou Luna Nights takes my CPU again

This might be due to the fact that we're using WaitForSingleObjectEx now (just as we did previously with winpthreads), which uses quite the whole thread on infinite waits. This was removed with the pthread rewrite where we moved to STL semaphores which use atomics and WaitOnAddress and WakeByAddressAll/WakeByAddressSingle on Windows.

Unfortunately, I don't see a way of resolving this as, to my knowledge, there is no other documented method of having alertable waits.

@polybiusproxy polybiusproxy force-pushed the unity-pt2 branch 3 times, most recently from 8d2bfc2 to b876722 Compare December 6, 2024 11:47
@StevenMiller123
Copy link
Contributor

My reported performance regressions are solved after the latest pushes. Both Diva X v1.02 and Dragon Ball Z Kakarot are performing as they do on current main builds now.

@polybiusproxy polybiusproxy force-pushed the unity-pt2 branch 5 times, most recently from cd1c7a4 to 8ddaf42 Compare December 6, 2024 20:30
@polybiusproxy polybiusproxy merged commit 7ffa581 into main Dec 6, 2024
20 checks passed
@polybiusproxy polybiusproxy deleted the unity-pt2 branch December 6, 2024 21:09
@GHU7924
Copy link

GHU7924 commented Dec 6, 2024

I found a couple of Unity games for the test, but they failed at startup.

Build e1ecfb8

CUSA05297 INSIDE

[Debug] exception.cpp:sceKernelInstallExceptionHandler:77: Unreachable code!
Missing exception implementation

CUSA23081 Untitled Goose Game

[Debug] exception.cpp:sceKernelInstallExceptionHandler:77: Unreachable code!
Missing exception implementation

rainmakerv3 pushed a commit to rainmakerv3/shadPS4 that referenced this pull request Dec 6, 2024
lucashartmann added a commit to lucashartmann/shadPS4 that referenced this pull request Dec 9, 2024
MajorP93 added a commit to MajorP93/shadPS4 that referenced this pull request Dec 10, 2024
Xcedf pushed a commit to Xcedf/shadPS4 that referenced this pull request Dec 10, 2024
Xcedf pushed a commit to Xcedf/shadPS4 that referenced this pull request Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants