mirror of
https://github.com/brl/mutter.git
synced 2025-06-14 01:09:30 +00:00
cogl-pixel-buffer: Add a fallback path
First, let's add a new public feature called, surprisingly, COGL_FEATURE_PBOS to check the availability of PBOs and provide a fallback path when running on older GL implementations or on OpenGL ES In case the underlying OpenGL implementation does not provide PBOs, we need a fallback path (a malloc'ed buffer). The CoglPixelBufer constructors will instanciate a subclass of CoglBuffer that handles map/unmap and set_data() with a malloc'ed buffer. The public feature is useful to check before using set_data() on a buffer as it will mean doing a memcpy() when not supporting PBOs (in that case, it's better to create the texture directly instead of using a CoglBuffer).
This commit is contained in:
@ -99,6 +99,11 @@ COGL_FEATURE_FUNCTION (void, glRenderbufferStorageMultisample,
|
||||
GLsizei width,
|
||||
GLsizei height))
|
||||
COGL_FEATURE_END ()
|
||||
COGL_FEATURE_BEGIN (read_pixels_async, 2, 1,
|
||||
"EXT\0",
|
||||
"pixel_buffer_object\0",
|
||||
COGL_FEATURE_PBOS)
|
||||
COGL_FEATURE_END ()
|
||||
|
||||
/* The function names in OpenGL 2.0 are different so we can't easily
|
||||
just check for GL 2.0 */
|
||||
|
Reference in New Issue
Block a user