copyteximage: Use Driver's AllocTextureImageBuffer instead of TexImage
authorJordan Justen <jordan.l.justen@intel.com>
Sat, 12 Jan 2013 22:56:49 +0000 (14:56 -0800)
committerJordan Justen <jordan.l.justen@intel.com>
Tue, 15 Jan 2013 04:50:31 +0000 (20:50 -0800)
Call Driver.AllocTextureImageBuffer rather than calling
Driver.TexImage with NULL data, format=GL_NONE and type=GL_NONE.

This avoids setting ctx->Unpack, which can lead to incorrectly
trying to upload data.

The GLES3 GTF program's packed_pixels_pbo test was triggering
an error for i965 with the previous code.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/teximage.c

index d62fea6e4f512a1e01c58807a504062c757f3730..5e451e235d47df5da4923469ef8935e1a233e076 100644 (file)
@@ -3365,9 +3365,7 @@ copyteximage(struct gl_context *ctx, GLuint dims,
                                     border, internalFormat, texFormat);
 
          /* Allocate texture memory (no pixel data yet) */
-         ctx->Driver.TexImage(ctx, dims, texImage,
-                              GL_NONE, GL_NONE,
-                              NULL, &ctx->Unpack);
+         ctx->Driver.AllocTextureImageBuffer(ctx, texImage);
 
          if (_mesa_clip_copytexsubimage(ctx, &dstX, &dstY, &srcX, &srcY,
                                         &width, &height)) {