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

Implement loading custom drivers on Android #11867

Merged
merged 2 commits into from Jun 11, 2023
Merged

Conversation

K0bin
Copy link
Contributor

@K0bin K0bin commented Jun 1, 2023

I had experimented with this months ago but wasn't confident with shipping it.
Now that Yuzu has successfully demonstrated that shipping libadrenotools on the Play Store is fine, I decided to finish it.

The necessary changes to shared C++ code are thankfully fairly unintrusive.

The UI is heavily inspired by Yuzus implementation rather than the one in Skyline, simply because it's simpler and less work.
Screenshot_2023-06-01-16-28-23-61_cf67db6494b18582489a109fa6c1616d

Big thanks to @bylaws.

@K0bin K0bin marked this pull request as ready for review June 1, 2023 19:21
@K0bin K0bin force-pushed the adrenotools branch 4 times, most recently from d7fca7c to 623fd0a Compare June 1, 2023 20:07
@K0bin K0bin force-pushed the adrenotools branch 2 times, most recently from db744b4 to 04212a2 Compare June 1, 2023 20:38
Copy link
Contributor

@iwubcode iwubcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outside of my one minor nit. Graphics wise LGTM

@K0bin
Copy link
Contributor Author

K0bin commented Jun 1, 2023

For a future progress report:

Old 2020 Qualcomm proprietary driver:
image

Turnip 23.1:
image

Copy link

@bylaws bylaws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adrenotools continues on its plan for world domination

Copy link
Contributor

@t895 t895 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be most of my comments. Please let me know if anything looks wrong to you.

@@ -122,7 +124,7 @@ android {
abiFilters "arm64-v8a", "x86_64" //, "armeabi-v7a", "x86"

// Remove the line below if you want to build the C++ unit tests
targets "main"
//targets "main", "hook_impl", "main_hook", "gsl_alloc_hook", "file_redirect_hook"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this commented out? Is the comment above this true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right. I forgot about this.

The problem is that some of those only build on ARM64 and they are necessary for the ARM64 build.

Do you perhaps know how to handle this in Gradle?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't know how to check for that, gradle is a mess. And are these necessary for the change? We could just hold off on it for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And are these necessary for the change?

Yes, they are part of adrenotools and necessary to load the actual drivers. The downside of removing the targets line is that it builds the unit tests which isn't too bad IMO.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Building the unit tests increases the time it takes to make an incremental build by over a minute on my machine, due to the need to re-link all the unit test executables. But if we have no other option, I guess we have to do it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to fix it but I really don't know how.

Source/Android/app/src/main/AndroidManifest.xml Outdated Show resolved Hide resolved
@K0bin K0bin force-pushed the adrenotools branch 3 times, most recently from 83e55a6 to 35aaf98 Compare June 3, 2023 00:59
@JMC47
Copy link
Contributor

JMC47 commented Jun 3, 2023

This is actually interesting on my Pixel 3a. Vulkan in general is just improved versus my default driver, but vs OpenGL it varies.

I know that doesn't matter, but games like Super Mario Galaxy are just much faster, but some simpler games are still slower than OpenGL. The biggest benefit is just having a driver I kind of trust versus my default driver.

@K0bin
Copy link
Contributor Author

K0bin commented Jun 3, 2023

@JMC47 OpenGL is not impacted at all. It only replaces the Vulkan driver.

@K0bin K0bin force-pushed the adrenotools branch 2 times, most recently from 051659e to 987a016 Compare June 3, 2023 21:20
@K0bin K0bin force-pushed the adrenotools branch 5 times, most recently from 325915d to 657e1df Compare June 8, 2023 22:38
@K0bin K0bin force-pushed the adrenotools branch 7 times, most recently from 7791474 to a15e314 Compare June 9, 2023 20:22
@K0bin
Copy link
Contributor Author

K0bin commented Jun 10, 2023

Go home FIFOCI, you're drunk.

@JMC47
Copy link
Contributor

JMC47 commented Jun 10, 2023

Tested and working, and has reviews. FifoCI is unrelated.

@brujo5
Copy link

brujo5 commented Jun 10, 2023

Screenshot_20230610-130749_Vulkan Caps Viewer
Screenshot_20230610-131529_Dolphin Debug

Hello, I've been testing for a few days and this AMDvlk driver works great for me with dolphin

@K0bin K0bin force-pushed the adrenotools branch 2 times, most recently from 088518b to 61fcb58 Compare June 11, 2023 09:59
@JMC47 JMC47 merged commit 5c0581e into dolphin-emu:master Jun 11, 2023
14 checks passed
@AlexS2412

This comment was marked as abuse.

@K0bin K0bin deleted the adrenotools branch June 11, 2023 20:22
@K0bin
Copy link
Contributor Author

K0bin commented Jun 11, 2023

@AlexS2412 There's nothing preventing this from working on Mali GPUs aside from the fact that nobody has written an open source Vulkan driver for those GPUs.

Besides that, Mali GPUs are simply missing a lot of hardware and driver features that emulators need.

@dolphin-emu dolphin-emu locked as resolved and limited conversation to collaborators Jun 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
10 participants