summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel/intel_tex_copy.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2009-05-18 13:26:16 -0700
committerIan Romanick <ian.d.romanick@intel.com>2009-06-02 16:50:11 +0100
commit129f311673c99eb912d659023e50bc5f0ef53249 (patch)
tree10ed9682b9a5df9d8b6cb48740c4b6a8a6561a87 /src/mesa/drivers/dri/intel/intel_tex_copy.c
parenta945e203d4fe254593bc0c5c5d6caca45e65f9f7 (diff)
intel: Clip to window after calling Driver.TexImage2D
This prevents the width / height from being clipped to the window size before the texture is allocated. This matches intelCopyTexImage1D. This should fix bug #21227 Signed-off-by: Ian Romanick <ian.romanick@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_tex_copy.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_copy.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c
index 7c2b26ef1d..a25626ae28 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_copy.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c
@@ -231,6 +231,14 @@ intelCopyTexImage2D(GLcontext * ctx, GLenum target, GLint level,
if (border)
goto fail;
+ /* Setup or redefine the texture object, mipmap tree and texture
+ * image. Don't populate yet.
+ */
+ ctx->Driver.TexImage2D(ctx, target, level, internalFormat,
+ width, height, border,
+ GL_RGBA, CHAN_TYPE, NULL,
+ &ctx->DefaultPacking, texObj, texImage);
+
srcx = x;
srcy = y;
dstx = 0;
@@ -241,15 +249,6 @@ intelCopyTexImage2D(GLcontext * ctx, GLenum target, GLint level,
&width, &height))
return;
- /* Setup or redefine the texture object, mipmap tree and texture
- * image. Don't populate yet.
- */
- ctx->Driver.TexImage2D(ctx, target, level, internalFormat,
- width, height, border,
- GL_RGBA, CHAN_TYPE, NULL,
- &ctx->DefaultPacking, texObj, texImage);
-
-
if (!do_copy_texsubimage(intel_context(ctx), target,
intel_texture_image(texImage),
internalFormat, 0, 0, x, y, width, height))