-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Subpar OpenGL performance in higher resolutions (on a mac) #12728
Comments
IIRC Avalonia OpenGL renderer on macOS is quite limited in terms of performance. And Avalonia Metal renderer is able to freely render without any additional UI thread synchronization. You can enable metal with AppBuilder extension |
cc @kekekeks to confirm |
I also tried it, but unfortunately it looks like now OpenGl is not supported when using Metal backend (black screen, no error). May I ask if there is any chance for adding support for it any time soon(ish)? (Ultimately one day I would love to switch to Vulkan via MotelVK and I guess this somehow is related to supporting opengl with metal) |
We are planning to add support for importing Metal textures via our generic GPU interop API. It would then be possible render OpenGL content into a Metal texture using CVPixelBuffer. Unfortunately no ETA yet, we are a bit busy in other areas |
Understandable, thanks anyway! |
@maxkatz6 Thanks! Using the Metal renderer almost halved CPU usage on my old Macbook with custom controls overriding Render. The only problem is the DPI is off and everything is huge using Metal. Is there any sort of option to correct that? |
I am afraid there is none. Metal backend is experimental still and might have this sort of issues. |
Any updates on the DPI issue ? @bitkidinc |
Sorry, no. It was for a hobby project I haven't looked at since then. |
Describe the bug
(I wasn't sure if I should report it as a bug or just start a discussion, but I've decided to go with an issue).
For some reason, when the OpenGL control render viewport is big enough, the performance lowers down significantly, i.e.:
As you can see on the screenshots, there is no drawing involved, in the
render
method there is just agl.Clear
call:Maybe I am using
RequestNextFrameRendering
incorrectly? I have tried both different dispatcher priorities AND I tried to directly callRequestNextFrameRendering
(without usingDispatcher.Post
) - no difference.I tried to increase
MaxGpuResourceSizeBytes
, but even settinglong.MaxValue
doesn't make any difference (With(new SkiaOptions{ MaxGpuResourceSizeBytes = long.MaxValue })
)I have no idea if similar behaviour can be observed on Windows. I will appreciate if anybody with windows and a high resolution monitor could run it.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I believe there is no reason why the fps should drop when there is no advanced drawing involved.
Desktop:
The text was updated successfully, but these errors were encountered: