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:
Robert Bragg
2010-07-05 16:14:00 +01:00
parent 0273b13d75
commit 82ba7220af
5 changed files with 49 additions and 11 deletions

View File

@ -78,7 +78,9 @@ create_map_tile (TestTile *tile)
==,
COGL_BUFFER_UPDATE_HINT_DYNAMIC);
map = cogl_buffer_map (buffer, COGL_BUFFER_ACCESS_WRITE);
map = cogl_buffer_map (buffer,
COGL_BUFFER_ACCESS_WRITE,
COGL_BUFFER_MAP_HINT_DISCARD);
g_assert (map);
line = g_alloca (TILE_SIZE * 4);