radeon: set gl_texture_image::TexFormat field in radeonSetTexBuffer2()
authorBrian Paul <brianp@vmware.com>
Mon, 15 Nov 2010 16:15:33 +0000 (09:15 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 15 Nov 2010 16:18:40 +0000 (09:18 -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/radeon/radeon_texstate.c

index dd8ecdd500a39bf162744cdc6db6041b25cc3553..7409aeeeaa8cd5eba4b7391fe34540c7d63bdb92 100644 (file)
@@ -705,18 +705,24 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_form
        t->override_offset = 0;
        switch (rb->cpp) {
        case 4:
-               if (texture_format == __DRI_TEXTURE_FORMAT_RGB)
+               if (texture_format == __DRI_TEXTURE_FORMAT_RGB) {
                        t->pp_txformat = tx_table[MESA_FORMAT_RGB888].format;
-               else
+                       texImage->TexFormat = MESA_FORMAT_RGB888;
+               }
+               else {
                        t->pp_txformat = tx_table[MESA_FORMAT_ARGB8888].format;
+                       texImage->TexFormat = MESA_FORMAT_ARGB8888;
+               }
                t->pp_txfilter |= tx_table[MESA_FORMAT_ARGB8888].filter;
                break;
        case 3:
        default:
+               texImage->TexFormat = MESA_FORMAT_RGB888;
                t->pp_txformat = tx_table[MESA_FORMAT_RGB888].format;
                t->pp_txfilter |= tx_table[MESA_FORMAT_RGB888].filter;
                break;
        case 2:
+               texImage->TexFormat = MESA_FORMAT_RGB565;
                t->pp_txformat = tx_table[MESA_FORMAT_RGB565].format;
                t->pp_txfilter |= tx_table[MESA_FORMAT_RGB565].filter;
                break;