aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common/meta.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-09-19 13:37:28 -0600
committerBrian Paul <[email protected]>2009-09-19 16:43:16 -0600
commitb0e9ea60840b5161634767e391c601ad0cc935b2 (patch)
treee54ffd1d801990d05b0924c35dc970d4aaaf8fd6 /src/mesa/drivers/common/meta.c
parent651cffd626a82d9bf539437ca4bdf8ea4b396fab (diff)
mesa: fix some glCopyTex[Sub]Image regressions related to convolution
Diffstat (limited to 'src/mesa/drivers/common/meta.c')
-rw-r--r--src/mesa/drivers/common/meta.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index aa7c73ba36a..b1465d1fbac 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -38,6 +38,7 @@
#include "main/blend.h"
#include "main/bufferobj.h"
#include "main/buffers.h"
+#include "main/convolve.h"
#include "main/depth.h"
#include "main/enable.h"
#include "main/fbobject.h"
@@ -49,6 +50,7 @@
#include "main/readpix.h"
#include "main/scissor.h"
#include "main/shaders.h"
+#include "main/state.h"
#include "main/stencil.h"
#include "main/texobj.h"
#include "main/texenv.h"
@@ -2156,6 +2158,7 @@ copy_tex_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level,
struct gl_texture_unit *texUnit;
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
+ GLsizei postConvWidth = width, postConvHeight = height;
GLenum format, type;
GLint bpp;
void *buf;
@@ -2192,9 +2195,30 @@ copy_tex_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level,
_mesa_meta_end(ctx);
/*
+ * Prepare for new texture image size/data
+ */
+#if FEATURE_convolve
+ if (_mesa_is_color_format(internalFormat)) {
+ _mesa_adjust_image_for_convolution(ctx, 2,
+ &postConvWidth, &postConvHeight);
+ }
+#endif
+
+ if (texImage->Data) {
+ ctx->Driver.FreeTexImageData(ctx, texImage);
+ }
+
+ _mesa_init_teximage_fields(ctx, target, texImage,
+ postConvWidth, postConvHeight, 1,
+ border, internalFormat);
+
+ /*
* Store texture data (with pixel transfer ops)
*/
_mesa_meta_begin(ctx, META_PIXEL_STORE);
+
+ _mesa_update_state(ctx); /* to update pixel transfer state */
+
if (target == GL_TEXTURE_1D) {
ctx->Driver.TexImage1D(ctx, target, level, internalFormat,
width, border, format, type,
@@ -2282,6 +2306,8 @@ copy_tex_sub_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level,
format, type, &ctx->Pack, buf);
_mesa_meta_end(ctx);
+ _mesa_update_state(ctx); /* to update pixel transfer state */
+
/*
* Store texture data (with pixel transfer ops)
*/