diff options
author | Neil Roberts <neil@linux.intel.com> | 2012-03-22 11:40:16 +0000 |
---|---|---|
committer | Neil Roberts <neil@linux.intel.com> | 2012-04-05 13:51:56 +0100 |
commit | ec5009fa23b11f9df9ffeead7bdf0de3fa12cd07 (patch) | |
tree | 962cf3c8eed7599a056ebd38ce96fc08cf09a71f /cogl/cogl-texture-private.h | |
parent | d54111795fee3fd0618c448c5279f2421396a154 (diff) | |
download | cogl-ec5009fa23b11f9df9ffeead7bdf0de3fa12cd07.tar.gz |
Use GL_PACK_ALIGNMENT of 1 whenever possible
The Intel driver currently has an optimisation when calling
glReadPixels into a PBO so that it will use a blit instead of the Mesa
fallback path. However this only works if the GL_PACK_ALIGNMENT is
exactly 1, even if this would be equivalent to a higher alignment
value because the bpp*width is already aligned. To make it more likely
to hit this fast path, we now detect this situation and explicitly use
an alignment of 1. To make this work the texture driver needs to be
passed down the bpp*width as well as the rowstride when configuring
the alignment.
Reviewed-by: Robert Bragg <robert@linux.intel.com>
Diffstat (limited to 'cogl/cogl-texture-private.h')
-rw-r--r-- | cogl/cogl-texture-private.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cogl/cogl-texture-private.h b/cogl/cogl-texture-private.h index 1fd6bb16..8cec89f0 100644 --- a/cogl/cogl-texture-private.h +++ b/cogl/cogl-texture-private.h @@ -246,7 +246,9 @@ void _cogl_texture_prep_gl_alignment_for_pixels_upload (int pixels_rowstride); void -_cogl_texture_prep_gl_alignment_for_pixels_download (int pixels_rowstride); +_cogl_texture_prep_gl_alignment_for_pixels_download (int bpp, + int width, + int rowstride); /* Utility function to use as a fallback for getting the data of any texture via the framebuffer */ |