summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/swrast
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/swrast')
-rw-r--r--src/mesa/drivers/dri/swrast/swrast.c11
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 52ba3acf65..c7aaafcee8 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);