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.
This commit is contained in:
Brian Paul
2010-11-18 16:15:33 -07:00
parent 3dcc3153b0
commit 83e93b6008
18 changed files with 261 additions and 186 deletions

View File

@@ -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 */