29983a7e2c
glMapBufferRange is documented to fail with GL_INVALID_OPERATION if GL_MAP_INVALIDATE_BUFFER_BIT is set as well as GL_MAP_READ_BIT. I guess this makes sense when only read access is requested because there would be no point in reading back uninitialised data. However, Clutter requests read/write access with the discard hint when rendering to a CoglBitmap with Cairo. The data is new so the discard hint makes sense but it also needs read access so that it can read back the data it just wrote for blending. This patch works around the GL restriction by skipping the discard hints if read access is requested. If the buffer discard hint is set along with read access it will recreate the buffer store as an alternative way to discard the buffer as it does in the case where the GL_ARB_map_buffer_range extension is not supported. https://bugzilla.gnome.org/show_bug.cgi?id=694164 Reviewed-by: Robert Bragg <robert@linux.intel.com> (cherry picked from commit 986675d6043e8701f2d65415cf72ffc91734debd) |
||
---|---|---|
.. | ||
gl | ||
gles | ||
cogl-attribute-gl-private.h | ||
cogl-attribute-gl.c | ||
cogl-buffer-gl-private.h | ||
cogl-buffer-gl.c | ||
cogl-clip-stack-gl-private.h | ||
cogl-clip-stack-gl.c | ||
cogl-framebuffer-gl-private.h | ||
cogl-framebuffer-gl.c | ||
cogl-pipeline-fragend-fixed-private.h | ||
cogl-pipeline-fragend-fixed.c | ||
cogl-pipeline-fragend-glsl-private.h | ||
cogl-pipeline-fragend-glsl.c | ||
cogl-pipeline-opengl-private.h | ||
cogl-pipeline-opengl.c | ||
cogl-pipeline-progend-fixed-private.h | ||
cogl-pipeline-progend-fixed.c | ||
cogl-pipeline-progend-glsl-private.h | ||
cogl-pipeline-progend-glsl.c | ||
cogl-pipeline-vertend-fixed-private.h | ||
cogl-pipeline-vertend-fixed.c | ||
cogl-pipeline-vertend-glsl-private.h | ||
cogl-pipeline-vertend-glsl.c | ||
cogl-texture-2d-gl-private.h | ||
cogl-texture-2d-gl.c | ||
cogl-texture-gl-private.h | ||
cogl-texture-gl.c | ||
cogl-util-gl-private.h | ||
cogl-util-gl.c |