qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MacOS cocoa/OpenGL


From: Akihiko Odaki
Subject: Re: MacOS cocoa/OpenGL
Date: Sat, 5 Mar 2022 09:20:05 +0900
User-agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 2022/03/05 0:34, R Kim wrote:
Hello Guys,

Looks like we haven't yet official support for OpenGL on MacOS? I need to apply third-party patches to make it work. It would be great if these parts are imported to qemu and be official. Nowaways, it's really needed Acceleration on VMs for who uses Graphical interfaces browsing, eg, chrome.


I have found it:
https://mail.gnu.org/archive/html/qemu-devel/2021-02/msg04235.html <https://mail.gnu.org/archive/html/qemu-devel/2021-02/msg04235.html>

It uses Angle from Google and the developer seems to be creating you own branch, with a lot of patches in https://github.com/akihikodaki/qemu/tree/macos <https://github.com/akihikodaki/qemu/tree/macos>

Another it this one, did small changes, but uses SDL instead of cocoa:
Based on initial work "Virgil 3D on macOS" by 小田喜陽彦 akihikodaki. https://mail.gnu.org/archive/html/qem... >
<https://www.youtube.com/redirect?event=video_description&redir_token=QUFFLUhqa3FxTDVuaWhiSFZkWWRkbHZkeTRTckc0bTJIQXxBQ3Jtc0trY3kza3JQT1dPS09vWmhCZktYSTRuWUdJMzB5MGdmV01DYUN4UGpOVTFWS3RwLUNZVGw5MzE3Zzg3WXZLNlJqNVNFZkM5QUZwRUN3UnJfOU5kVWxQaUJLdGo4N0IxVXd3X3pIb1lQUThMcmpJVktfWQ&q=https%3A%2F%2Fmail.gnu.org%2Farchive%2Fhtml%2Fqemu-devel%2F2021-02%2Fmsg04235.html>With
improvements: - Get rid of ANGLE as EGL libraries. Virgil 3D solely uses OpenGL Core backend through SDL2 which wraps to NSOpenGL. - No patch to "cocoa" display of QEMU. Minimal modification to SDL2 display to support Virgil 3D on macOS. QEMU cannot have both "cocoa" and "sdl2" display in the same build. - Minimal change to libepoxy and virglrenderer, basically only have to make sure they built without libdrm and libEGL. - Fix known issues with OpenGL Core - Performance comparable to ANGLE OpenGL ES backend. WebGL Aquarium at 60 FPS. Chromium web rendering is accelerated. The accelerated ArchLinux ARM is very snappy & usable with Apple HVF virtualization. It matches or even exceeds the performance of typical ARM Linux flavors running on RK3399 or RPi4 bare-metal. It probably makes M1 MacBooks the world fastest (... most expensive) Linux ARM laptops. Nested VM is possible, and there is a demo of qemu-3dfx Glide passthrough from nested QEMU i386 instance running Blood 1.2 3Dfx DOS game.

https://www.youtube.com/watch?v=FVv8UjGhYPU <https://www.youtube.com/watch?v=FVv8UjGhYPU>


What should we do to have this changes in?

Sent with ProtonMail <https://protonmail.com/> Secure Email.

Hi,

I'm adding KJ Liew, the author of the implementation with Apple's OpenGL and sdl2, to Cc. I found the email address at:
https://github.com/kjliew/qemu-3dfx/commit/e01af020580afe172237dfeb471643aa0b6ea60b

https://github.com/akihikodaki/qemu/tree/macos is my tree. My aim is to have a decent Linux desktop experience, and it has changes irrelevant with graphics acceleration. The patches I thought ready for submission are submitted to the mailing list, but the patch to support Virgil 3D is not because the dependent change for libepoxy is somewhat stuck:
https://github.com/anholt/libepoxy/pull/239

It also contains patches posted on the mailing list I am reviewing and testing.

I choose cocoa instead of sdl2 to implement Cocoa-specific code like HiDPI support and cursor composition.

I decided to use ANGLE because the OpenGL implementation by Apple is deprecated and possible bugs in the implementation would not be (promptly) fixed. Such bugs may require workarounds in virglrenderer, but they are not really great for submitting to the upstream.

Those does not mean, however, it is not appropriate to the other implementation you mentioned, which uses Apple's OpenGL with sdl2. It is reasonable to choose sdl2 if you don't need features provided by (my modified) cocoa. The deprecation of Apple's OpenGL may not matter much since there are many other programs which still rely on it. ANGLE is also one of them although it is switching to Metal with Apple's help:
https://bugs.chromium.org/p/angleproject/issues/detail?id=5505

The best option to get the patches for Apple OpenGL/sdl2 in is to ask the author for that. However, the author may not be willing to spend or cannot afford necessary efforts. In that case, you still need to ask the author if it is fine to add Signed-off-by line for the patches. The implication of the line is described at:
https://www.qemu.org/docs/master/devel/submitting-a-patch.html#patch-emails-must-include-a-signed-off-by-line

If you are going to submit patches, please add me to Cc. I'll review and propose necessary changes.

Regards,
Akihiko Odaki



reply via email to

[Prev in Thread] Current Thread [Next in Thread]