Slow implementation of glMapBufferRange in the emulator

209 views
Skip to first unread message

star...@gmail.com

unread,
Sep 23, 2020, 10:58:19 AM9/23/20
to android-platform
The current implementation of glMapBufferRange in the emulator involves the following flow (for GL_MAP_WRITE_BIT),
1. call glMapBufferRange on the host
2. copy buffer data from mapped gpu poniter returned from 1
3. glUnmapBuffer on the host
4. send the copied buffer to guest through IOStream
5. guest update the buffer and calls glUnmapBuffer from guest
6. call glMapBufferRange on the host
7. copy updated buffer into mapped gpu pointer
8. glUnmapBuffer on host.

Step 2 is particularly slow since on the host, the buffer is mapped with GL_MAP_WRITE_BIT, but we are using it as a read buffer. From my measurment, it took 3-4ms for 1MB buffer range and 12ms for 6MB buffer range.

I saw emulator also has an implementation glMapBufferRangeDirect where it maps the host gpu_pointer to guest directly. But this is not used from the guest goldfish gl driver.

Is there a particular reason for that or any plan to enable that?

Thanks

Xiaoxing Zhu

unread,
Sep 24, 2020, 11:48:07 AM9/24/20
to android-...@googlegroups.com
I noticed the glMapBufferRangeDirect implementation was there until May 2019, was there any particular reason other than for snapshot feature? Any security concern mapping host pointer to guest directly?

--


You received this message because you are subscribed to the Google Groups "android-platform" group.


To unsubscribe from this group and stop receiving emails from it, send an email to android-platfo...@googlegroups.com.


To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/b2e8821f-f72d-4a5d-af03-958dd66d6013n%40googlegroups.com.


Reply all
Reply to author
Forward
0 new messages