Slow implementation of glMapBufferRange in the emulator

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Slow implementation of glMapBufferRange in the emulator

Xiaoxing Zhu
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

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/b2e8821f-f72d-4a5d-af03-958dd66d6013n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Slow implementation of glMapBufferRange in the emulator

Xiaoxing Zhu
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?

On Wed, Sep 23, 2020 at 7:57 AM [hidden email] <[hidden email]> wrote:
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








--


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 [hidden email].


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


--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/CAAJ738sqM8d1%2BVREXuXyBaDdygfraA21WfFC7kA5NdW0zHzzwQ%40mail.gmail.com.