summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_texture.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-11-18 16:15:33 -0700
committerBrian Paul <brianp@vmware.com>2010-11-18 16:15:38 -0700
commit83e93b6008213ad86607027e8434ecaccc8b1a2c (patch)
tree5817bc1a52086eea884e93b1eaf2cb60e90f66f7 /src/mesa/state_tracker/st_cb_texture.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/state_tracker/st_cb_texture.c')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 4c2f7d7896..15e69e1fa0 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -549,14 +549,18 @@ st_TexImage(struct gl_context * ctx,
/* switch to "normal" */
if (stObj->surface_based) {
+ gl_format texFormat;
+
_mesa_clear_texture_object(ctx, texObj);
pipe_resource_reference(&stObj->pt, NULL);
/* oops, need to init this image again */
+ texFormat = _mesa_choose_texture_format(ctx, texObj, target, level,
+ internalFormat, format, type);
+
_mesa_init_teximage_fields(ctx, target, texImage,
- width, height, depth, border, internalFormat);
- _mesa_choose_texture_format(ctx, texObj, texImage, target, level,
- internalFormat, format, type);
+ width, height, depth, border,
+ internalFormat, texFormat);
stObj->surface_based = GL_FALSE;
}
@@ -1950,7 +1954,7 @@ st_get_default_texture(struct st_context *st)
_mesa_init_teximage_fields(st->ctx, target, texImg,
16, 16, 1, 0, /* w, h, d, border */
- GL_RGBA);
+ GL_RGBA, MESA_FORMAT_RGBA8888);
st_TexImage(st->ctx, 2, target,
0, GL_RGBA, /* level, intformat */