-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Package]: Requesting new versions of angle-android & virglrenderer-android. #19529
Comments
Newer does not always mean better... |
@twaik It seems that GPU acceleration is really difficult for SoCs other than Adreno GPU.... Especially in the case of Exynos 2400 and I'm hoping to see compatibility and performance improvements in the latest commits to angle or virglrenderer. |
@licy183 what do you think about that? |
I don't know how much performance will lose or gain from the latest version. More tests should be done about the performance... |
I think I can improve performance for termux-x11 in the case if virpipe will report drawable it for textures. I mean I can make virglrenderer use |
Patching |
I did not mean patch It is possible to make Of course, this change will work only in the case of termux-x11, but I may try to port it to Xvfb or TigerVNC servers (only in termux, not in proot/chroot). |
I'll explain why virglrenderer-android+virpipe is so bad.
It is waste of resources.
More details about 3.Currently My idea is to implement some kind of simple IPC to make In this case This solution may be the best one because it should work with But it will require from me to do a goddamn big work on that. And it will require some time. I did not implement anything similar before. |
Probably I've got some roadmap for this.
@licy183 @tareksander maybe you can suggest something? Do you have any additions or corrections? |
Probably it would be good to make virglrenderer use ahardwarebuffers to avoid cpu swizzling rgba->bgra so we will save some cpu time. |
@licy183 Can you please take a look? |
Interesting thing. Not very much, but it is 33% of performance improvement, or it will be 50% of improvement in the case we fix rendering for @tareksander maybe you can help to fix |
What is there to fix? |
@tareksander #19529 (comment) |
Emmm... I'll check it next weekend. I'm looking for an internship these days... |
Hello. Any updates? |
Sorry for my late reply. I have no idea about why it happens... |
Can you please please investigate it a bit? Probably in the case there is no solution I will try to make shader and some additional code for pixel swizzling and drawing it to rgba texture, but it will do some overhead which may be avoided with bgra textures. |
Emmm... According to the Android docs, https://developer.android.com/ndk/reference/struct/a-hardware-buffer-desc
https://developer.android.google.cn/ndk/reference/group/a-hardware-buffer#ahardwarebuffer_format
|
Yeah but 0x5 works in the case if it is regular texture. I know it because it works pretty much well in termux-x11. But not in virglrenderer in the case if it is bound to framebuffer and it is a rendering target (but I may be wrong here, and I am not sure if it is called renderbuffer). |
In case 0x5 can't be made to work with virglrenderer, since you're already doing custom code in Termux:X11 to support it, couldn't you just use an |
Yeah, I can make additional shader copying with swapping colors, but it will not be zero-copy solution like in the case with BGRA textures... I'll just do the same thing virglrenderer does on CPU but on the GPU side. The main idea is to avoid it at all. |
The GPU side is highly efficient for these kinds of things though, it's what GPUs were made for after all. The bitshifts happen in parallel like everything else, and swapping the Y axis in a texture lookup is also trivial. |
Ok, I ran glmark2 normally, with hardware buffers with and without glFinish, with and without blitting to compare performance. I've got intriguing results.
Blitting+swizzling is an additional step where current framebuffer is blitted to AHB with shader, flipping BGRA to RGBA. Without this AHB is simply filled with black (not an active action, filled by system at allocation step) and outputted. I did it intentionally to check performance hit of blitting/swizzling itself. It seems like in the cases without glFinish we get outdated frame (like last frame before current iteration) but the performance is much better (rendering is done async?). And I do not know why AHB+glFinish+blitting gives results the worst result (it should be normal run since it uses glReadPixels). |
glFinish should be a fallback, the best performance possible would be with the Android native sync EGL extension, which allows you to create a sync object with a fd, send that fd to another process and reconstruct a sync object there. That sync object would then be waited for before rendering (or the last image would be displayed until rendering is finished). That also needs X server support though. With thta you'd have async rendering and the correct frame data. Of course the additional blitting+swizzling step makes a performance hit, you're essentially writing double the memory. The question is, is it faster than doing that step on the CPU? |
I want to make virglrenderer support AHardwareBuffers before making it support direct writing to X server (without drawing through virpipe).
|
How can I check if rendering is finished or not? Without waiting. |
EGL can wait on a sync object, though that blocks the entire thread. There's an extension that inserts the wait into the client command steam, so you can issue further GL calls an be sure they'll happen after the sync completed. For implementation in the X server (which renders at predefined intervals, I think?) just polling the sync object before drawing the next frame would be enough. |
Do you mean invoking |
tareksander may be referring this API EGL_ANDROID_native_fence_sync, but I don't actually know how to use this... |
Exactly. You need to create a sync object with type Then you can use |
Wait, so I need to use eglCreateSyncKHR after using |
No, before flush. And flush is not finish: Flush makes sure the commands are delivered to the GL implementation, finish waits until the commands have finished executing. |
Yeah, you are right, I was confused with some other stuff. |
So can I use waiting for sync instead of using glFinish? |
That depends on how you want the graphics pipelining: If you just want to chew out frames as fast as possible (like a game maybe would), no synchronization could be fine. If you want to ensure the most recent frame is definitely drawn, you need some synchronization. The waiting would be an optimization on the server side: The server would accept a new buffer to be displayed, uses a client sync to ensure the buffer is finished writing and issues the GL commands to draw it into the compositor space, then flushes. The GPU will then wait for the buffer to be available on its own before continuing to draw, so the application and server can both continue to queue up more commands. |
Why is it worth to add this package?
@licy183
I understand that quite a bit of time has passed since the angle-android package was released last year.
For currently released
angle-android & virglrenderer-android
Adreno GPU, Mali GPU, Xclipes GPU all
Satisfactory compatibility or performance is not achieved.
I am requesting this because I believe that compatibility and performance will improve slightly in angle-android & virglrenderer-android that reflect the latest src.
and
I wonder if glvnd related compatibility may have been added in Angle latest src.
Home page URL
https://github.com/google/angle
Source code URL
https://github.com/google/angle
Packaging policy acknowledgement
Additional information
No response
The text was updated successfully, but these errors were encountered: