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/drivers/dri/swrast | |
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/drivers/dri/swrast')
-rw-r--r-- | src/mesa/drivers/dri/swrast/swrast.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index 52ba3acf658..c7aaafcee8c 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -69,6 +69,7 @@ static void swrastSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, struct gl_texture_object *texObj; struct gl_texture_image *texImage; uint32_t internalFormat; + gl_format texFormat; dri_ctx = pDRICtx->driverPrivate; @@ -82,15 +83,13 @@ static void swrastSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, sPriv->swrast_loader->getDrawableInfo(dPriv, &x, &y, &w, &h, dPriv->loaderPrivate); - _mesa_init_teximage_fields(&dri_ctx->Base, target, texImage, - w, h, 1, 0, internalFormat); - if (texture_format == __DRI_TEXTURE_FORMAT_RGB) - texImage->TexFormat = MESA_FORMAT_XRGB8888; + texFormat = MESA_FORMAT_XRGB8888; else - texImage->TexFormat = MESA_FORMAT_ARGB8888; + texFormat = MESA_FORMAT_ARGB8888; - _mesa_set_fetch_functions(texImage, 2); + _mesa_init_teximage_fields(&dri_ctx->Base, target, texImage, + w, h, 1, 0, internalFormat, texFormat); sPriv->swrast_loader->getImage(dPriv, x, y, w, h, (char *)texImage->Data, dPriv->loaderPrivate); |