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>
This commit is contained in:
Ian Romanick 2009-05-18 13:26:16 -07:00
parent a945e203d4
commit 129f311673
1 changed files with 8 additions and 9 deletions

View File

@ -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))