From b3f56ccb4858f4f62ee53c74be1a2233bb608cae Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 29 Aug 2012 14:10:57 +0100 Subject: [PATCH] tex-driver-gles: Fix subregion uploads without GL_EXT_unpack_subimage When the GL_EXT_unpack_subimage extension is not available and a subregion of a texture is uploaded then it should first copy the subregion to a newly allocated bitmap. However it was then later still trying to prepare the upload using the original src_x and src_y values which would cause an assertion failure. This patch fixes it to just reset those to zero if the subregion is first copied. Reviewed-by: Robert Bragg (cherry picked from commit 6f9a62db6f846f1d76e3ca16d9d8cdadf82a7009) --- cogl/driver/gles/cogl-texture-driver-gles.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cogl/driver/gles/cogl-texture-driver-gles.c b/cogl/driver/gles/cogl-texture-driver-gles.c index d4d2b5d08..e19721c89 100644 --- a/cogl/driver/gles/cogl-texture-driver-gles.c +++ b/cogl/driver/gles/cogl-texture-driver-gles.c @@ -206,6 +206,8 @@ _cogl_texture_driver_upload_subregion_to_gl (CoglContext *ctx, src_x, src_y, 0, 0, /* dst_x/y */ width, height); + + src_x = src_y = 0; } else slice_bmp = prepare_bitmap_alignment_for_upload (ctx, source_bmp);