diff options
author | Brian Paul <[email protected]> | 2010-11-18 16:15:33 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-11-18 16:15:38 -0700 |
commit | 83e93b6008213ad86607027e8434ecaccc8b1a2c (patch) | |
tree | 5817bc1a52086eea884e93b1eaf2cb60e90f66f7 /src/mesa/main/texobj.c | |
parent | 3dcc3153b087a2ec42e6177d965dd8b2c95779c2 (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/main/texobj.c')
-rw-r--r-- | src/mesa/main/texobj.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 495903df556..72dbf10cc4b 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -719,6 +719,7 @@ _mesa_get_fallback_texture(struct gl_context *ctx) static GLubyte texels[8 * 8][4]; struct gl_texture_object *texObj; struct gl_texture_image *texImage; + gl_format texFormat; GLuint i; for (i = 0; i < 8 * 8; i++) { @@ -737,12 +738,13 @@ _mesa_get_fallback_texture(struct gl_context *ctx) /* create level[0] texture image */ texImage = _mesa_get_tex_image(ctx, texObj, GL_TEXTURE_2D, 0); + texFormat = ctx->Driver.ChooseTextureFormat(ctx, GL_RGBA, GL_RGBA, + GL_UNSIGNED_BYTE); + /* init the image fields */ _mesa_init_teximage_fields(ctx, GL_TEXTURE_2D, texImage, - 8, 8, 1, 0, GL_RGBA); + 8, 8, 1, 0, GL_RGBA, texFormat); - texImage->TexFormat = - ctx->Driver.ChooseTextureFormat(ctx, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE); ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); /* set image data */ |