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