mirror of
https://github.com/brl/mutter.git
synced 2025-06-14 01:09:30 +00:00
pixel-array: Allow passing of hints to cogl_buffer_map
This allows you to tell Cogl that you are planning to replace all the buffer's data once it is mapped with cogl_buffer_map. This means if the buffer is currently being accessed by the GPU then the driver doesn't have to stall and wait for it to finish before it can access it from the CPU and can instead potentially allocate a new buffer with undefined data and map that.
This commit is contained in:
@ -22,6 +22,7 @@
|
||||
*
|
||||
* Authors:
|
||||
* Damien Lespiau <damien.lespiau@intel.com>
|
||||
* Robert Bragg <robert@linux.intel.com>
|
||||
*/
|
||||
|
||||
/* For an overview of the functionality implemented here, please see
|
||||
@ -228,8 +229,9 @@ cogl_buffer_get_update_hint (CoglBuffer *buffer)
|
||||
}
|
||||
|
||||
guint8 *
|
||||
cogl_buffer_map (CoglBuffer *buffer,
|
||||
CoglBufferAccess access)
|
||||
cogl_buffer_map (CoglBuffer *buffer,
|
||||
CoglBufferAccess access,
|
||||
CoglBufferMapHint hints)
|
||||
{
|
||||
if (!cogl_is_buffer (buffer))
|
||||
return NULL;
|
||||
@ -237,7 +239,7 @@ cogl_buffer_map (CoglBuffer *buffer,
|
||||
if (COGL_BUFFER_FLAG_IS_SET (buffer, MAPPED))
|
||||
return buffer->data;
|
||||
|
||||
buffer->data = buffer->vtable->map (buffer, access);
|
||||
buffer->data = buffer->vtable->map (buffer, access, hints);
|
||||
return buffer->data;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user