aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common
diff options
context:
space:
mode:
authorAnuj Phogat <[email protected]>2015-02-23 10:56:14 -0800
committerAnuj Phogat <[email protected]>2015-02-25 14:11:28 -0800
commit688309374d6e2ec8af10907e36f30f0028f16d55 (patch)
tree063d5091ad507678d5557431e0514ad2014053f2 /src/mesa/drivers/common
parent068ba4ac78a62d2d07300a54e6585e16a2c747d5 (diff)
meta: Pass null pointer for the pixel data to avoid unnecessary data upload
to a temporary pbo created in _mesa_meta_pbo_GetTexSubImage(). Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Neil Roberts <[email protected]>
Diffstat (limited to 'src/mesa/drivers/common')
-rw-r--r--src/mesa/drivers/common/meta_tex_subimage.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/drivers/common/meta_tex_subimage.c b/src/mesa/drivers/common/meta_tex_subimage.c
index 2aa3a4ce281..a8513573b1b 100644
--- a/src/mesa/drivers/common/meta_tex_subimage.c
+++ b/src/mesa/drivers/common/meta_tex_subimage.c
@@ -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,