summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_manager.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/state_tracker/st_manager.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_manager.c')
-rw-r--r--src/mesa/state_tracker/st_manager.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index 15e7b8921c3..98e95e239e5 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -556,6 +556,8 @@ st_context_teximage(struct st_context_iface *stctxi, enum st_texture_type target
texImage = _mesa_get_tex_image(ctx, texObj, target, level);
stImage = st_texture_image(texImage);
if (tex) {
+ gl_format texFormat;
+
/*
* XXX When internal_format and tex->format differ, st_finalize_texture
* needs to allocate a new texture with internal_format and copy the
@@ -573,11 +575,13 @@ st_context_teximage(struct st_context_iface *stctxi, enum st_texture_type target
internalFormat = GL_RGBA;
else
internalFormat = GL_RGB;
+
+ texFormat = st_ChooseTextureFormat(ctx, internalFormat,
+ GL_RGBA, GL_UNSIGNED_BYTE);
+
_mesa_init_teximage_fields(ctx, target, texImage,
- tex->width0, tex->height0, 1, 0, internalFormat);
- texImage->TexFormat = st_ChooseTextureFormat(ctx, internalFormat,
- GL_RGBA, GL_UNSIGNED_BYTE);
- _mesa_set_fetch_functions(texImage, 2);
+ tex->width0, tex->height0, 1, 0,
+ internalFormat, texFormat);
width = tex->width0;
height = tex->height0;