aboutsummaryrefslogtreecommitdiffstats
path: root/host/include/libOpenglRender
diff options
context:
space:
mode:
authorDavid Reveman <reveman@google.com>2019-06-28 10:32:41 -0400
committerDavid Reveman <reveman@google.com>2019-06-28 19:09:01 -0400
commit8bc3255903eb1697e721c4dcb14410f1820e72bf (patch)
treea56d12b388a1f96f15db99c6015690ec486e682e /host/include/libOpenglRender
parent87f11962406fa7ea1f733012e85e8a266a44c847 (diff)
downloaddevice_generic_goldfish-opengl-8bc3255903eb1697e721c4dcb14410f1820e72bf.tar.gz
device_generic_goldfish-opengl-8bc3255903eb1697e721c4dcb14410f1820e72bf.tar.bz2
device_generic_goldfish-opengl-8bc3255903eb1697e721c4dcb14410f1820e72bf.zip
[vulkan] Improve pipe performance on Fuchsia.
This makes use of the new Call method to write and readback using a single IPC call. The IOStream interface has been updated to allow for this optimization. It also implements buffered reads. Each time we readback data on Fuchsia we attempt to read a larger fixed size, which we consume until another read is needed. Change-Id: Ia7aabb5849c651f6d777da996e9d6d271722d0c8
Diffstat (limited to 'host/include/libOpenglRender')
-rw-r--r--host/include/libOpenglRender/IOStream.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/host/include/libOpenglRender/IOStream.h b/host/include/libOpenglRender/IOStream.h
index d06440e6..ad820724 100644
--- a/host/include/libOpenglRender/IOStream.h
+++ b/host/include/libOpenglRender/IOStream.h
@@ -33,6 +33,7 @@ public:
virtual void *allocBuffer(size_t minSize) = 0;
virtual int commitBuffer(size_t size) = 0;
virtual const unsigned char *readFully( void *buf, size_t len) = 0;
+ virtual const unsigned char *commitBufferAndReadFully(size_t size, void *buf, size_t len) = 0;
virtual const unsigned char *read( void *buf, size_t *inout_len) = 0;
virtual int writeFully(const void* buf, size_t len) = 0;
@@ -79,7 +80,12 @@ public:
}
const unsigned char *readback(void *buf, size_t len) {
- flush();
+ if (m_buf && m_free != m_bufsize) {
+ size_t size = m_bufsize - m_free;
+ m_buf = NULL;
+ m_free = 0;
+ return commitBufferAndReadFully(size, buf, len);
+ }
return readFully(buf, len);
}