aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/intel/intel_tex_image.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-11-18 16:15:33 -0700
committerBrian Paul <[email protected]>2010-11-18 16:15:38 -0700
commit83e93b6008213ad86607027e8434ecaccc8b1a2c (patch)
tree5817bc1a52086eea884e93b1eaf2cb60e90f66f7 /src/mesa/drivers/dri/intel/intel_tex_image.c
parent3dcc3153b087a2ec42e6177d965dd8b2c95779c2 (diff)
mesa: pass gl_format to _mesa_init_teximage_fields()
This should prevent the field going unset in the future. See bug http://bugs.freedesktop.org/show_bug.cgi?id=31544 for background. Also remove unneeded calls to clear_teximage_fields(). Finally, call _mesa_set_fetch_functions() from the _mesa_init_teximage_fields() function so callers have one less thing to worry about.
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_tex_image.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_image.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index 50fe9bd9f33..41cdbfd2cbd 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -682,6 +682,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
int level = 0, internalFormat;
+ gl_format texFormat;
texObj = _mesa_get_current_tex_object(ctx, target);
intelObj = intel_texture_object(texObj);
@@ -700,10 +701,14 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
if (rb->region == NULL)
return;
- if (texture_format == __DRI_TEXTURE_FORMAT_RGB)
+ if (texture_format == __DRI_TEXTURE_FORMAT_RGB) {
internalFormat = GL_RGB;
- else
+ texFormat = MESA_FORMAT_XRGB8888;
+ }
+ else {
internalFormat = GL_RGBA;
+ texFormat = MESA_FORMAT_ARGB8888;
+ }
mt = intel_miptree_create_for_region(intel, target,
internalFormat,
@@ -724,16 +729,13 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
intel_miptree_release(intel, &intelObj->mt);
intelObj->mt = mt;
+
_mesa_init_teximage_fields(&intel->ctx, target, texImage,
rb->region->width, rb->region->height, 1,
- 0, internalFormat);
+ 0, internalFormat, texFormat);
intelImage->face = target_to_face(target);
intelImage->level = level;
- if (texture_format == __DRI_TEXTURE_FORMAT_RGB)
- texImage->TexFormat = MESA_FORMAT_XRGB8888;
- else
- texImage->TexFormat = MESA_FORMAT_ARGB8888;
texImage->RowStride = rb->region->pitch;
intel_miptree_reference(&intelImage->mt, intelObj->mt);
@@ -789,11 +791,10 @@ intel_image_target_texture_2d(struct gl_context *ctx, GLenum target,
intelObj->mt = mt;
_mesa_init_teximage_fields(&intel->ctx, target, texImage,
image->region->width, image->region->height, 1,
- 0, image->internal_format);
+ 0, image->internal_format, image->format);
intelImage->face = target_to_face(target);
intelImage->level = 0;
- texImage->TexFormat = image->format;
texImage->RowStride = image->region->pitch;
intel_miptree_reference(&intelImage->mt, intelObj->mt);