meta: Pass null pointer for the pixel data to avoid unnecessary data upload
authorAnuj Phogat <anuj.phogat@gmail.com>
Mon, 23 Feb 2015 18:56:14 +0000 (10:56 -0800)
committerAnuj Phogat <anuj.phogat@gmail.com>
Wed, 25 Feb 2015 22:11:28 +0000 (14:11 -0800)
to a temporary pbo created in _mesa_meta_pbo_GetTexSubImage().

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
src/mesa/drivers/common/meta_tex_subimage.c

index 2aa3a4ce281006516ebd9385122143810fb343a2..a8513573b1b1813dc256ad6af862d66f66255557 100644 (file)
@@ -89,8 +89,11 @@ create_texture_for_pbo(struct gl_context *ctx, bool create_pbo,
        */
       _mesa_BindBuffer(pbo_target, *tmp_pbo);
 
+      /* In case of GL_PIXEL_PACK_BUFFER, pass null pointer for the pixel
+       * data to avoid unnecessary data copying in _mesa_BufferData().
+       */
       if (is_pixel_pack)
-         _mesa_BufferData(pbo_target, row_stride * height, pixels,
+         _mesa_BufferData(pbo_target, row_stride * height, NULL,
                           GL_STREAM_READ);
       else
          _mesa_BufferData(pbo_target, row_stride * height, pixels,