[Mesa-dev] [PATCH 07/14] meta: Pass null pointer for the pixel data to avoid unnecessary data upload

Anuj Phogat anuj.phogat at gmail.com
Mon Feb 23 14:36:44 PST 2015


to a temporary pbo created in _mesa_meta_pbo_GetTexSubImage().

Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
 src/mesa/drivers/common/meta_tex_subimage.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/common/meta_tex_subimage.c b/src/mesa/drivers/common/meta_tex_subimage.c
index 4bf7cd6..8b26ba7 100644
--- a/src/mesa/drivers/common/meta_tex_subimage.c
+++ b/src/mesa/drivers/common/meta_tex_subimage.c
@@ -91,8 +91,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,
-- 
1.9.3



More information about the mesa-dev mailing list