r200: set gl_texture_image::TexFormat field in r200SetTexBuffer2()
authorBrian Paul <brianp@vmware.com>
Mon, 15 Nov 2010 16:23:59 +0000 (09:23 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 15 Nov 2010 16:31:21 +0000 (09:31 -0700)
See https://bugs.freedesktop.org/show_bug.cgi?id=31544

Note: this is a candidate for the 7.9 branch.

src/mesa/drivers/dri/r200/r200_texstate.c

index 690bec640bd2f7606fa24b34a99286f91634477d..ee968d69f66c522b65181a657c2e068b6d110e20 100644 (file)
@@ -832,18 +832,24 @@ void r200SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_format
        pitch_val = rb->pitch;
        switch (rb->cpp) {
        case 4:
-               if (texture_format == __DRI_TEXTURE_FORMAT_RGB)
+               if (texture_format == __DRI_TEXTURE_FORMAT_RGB) {
+                       texImage->TexFormat = MESA_FORMAT_RGB888;
                        t->pp_txformat = tx_table_le[MESA_FORMAT_RGB888].format;
-               else
+               }
+               else {
+                       texImage->TexFormat = MESA_FORMAT_ARGB8888;
                        t->pp_txformat = tx_table_le[MESA_FORMAT_ARGB8888].format;
+               }
                t->pp_txfilter |= tx_table_le[MESA_FORMAT_ARGB8888].filter;
                break;
        case 3:
        default:
+               texImage->TexFormat = MESA_FORMAT_RGB888;
                t->pp_txformat = tx_table_le[MESA_FORMAT_RGB888].format;
                t->pp_txfilter |= tx_table_le[MESA_FORMAT_RGB888].filter;
                break;
        case 2:
+               texImage->TexFormat = MESA_FORMAT_RGB565;
                t->pp_txformat = tx_table_le[MESA_FORMAT_RGB565].format;
                t->pp_txfilter |= tx_table_le[MESA_FORMAT_RGB565].filter;
                break;