r600: set gl_texture_image::TexFormat field in r600SetTexBuffer2()
authorBrian Paul <brianp@vmware.com>
Mon, 15 Nov 2010 16:16:31 +0000 (09:16 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 15 Nov 2010 16:18:47 +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/r600/r600_texstate.c

index 3869768bf0ec654e163466ba9f19de827d762ac6..20fe32ae9ec7f275784437fd4391fc0875bbbe67 100644 (file)
@@ -1060,6 +1060,7 @@ void r600SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo
        switch (rb->cpp) {
        case 4:
                if (glx_texture_format == __DRI_TEXTURE_FORMAT_RGB) {
+                       texImage->TexFormat = MESA_FORMAT_RGB888;
                        SETfield(t->SQ_TEX_RESOURCE1, FMT_8_8_8_8,
                                 SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask);
 
@@ -1072,6 +1073,7 @@ void r600SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo
                        SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_1,
                                 SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask);
                } else {
+                       texImage->TexFormat = MESA_FORMAT_ARGB8888;
                        SETfield(t->SQ_TEX_RESOURCE1, FMT_8_8_8_8,
                                 SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask);
 
@@ -1089,6 +1091,7 @@ void r600SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo
        case 3:
        default:
                // FMT_8_8_8 ???
+               texImage->TexFormat = MESA_FORMAT_RGB888;
                SETfield(t->SQ_TEX_RESOURCE1, FMT_8_8_8_8,
                         SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask);
 
@@ -1103,6 +1106,7 @@ void r600SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo
                pitch_val /= 4;
                break;
        case 2:
+               texImage->TexFormat = MESA_FORMAT_RGB565;
                SETfield(t->SQ_TEX_RESOURCE1, FMT_5_6_5,
                         SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask);