evergreen: set gl_texture_image::TexFormat field in evergreenSetTexBuffer()
authorBrian Paul <brianp@vmware.com>
Mon, 15 Nov 2010 16:25:32 +0000 (09:25 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 15 Nov 2010 16:31:33 +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/r600/evergreen_tex.c

index 58420ed12390a6920a62ebaef2a852b751723028..65b71c80164e5684128319e02ab3bababafbcaa4 100644 (file)
@@ -1205,6 +1205,7 @@ void evergreenSetTexBuffer(__DRIcontext *pDRICtx, GLint target, GLint glx_textur
        switch (rb->cpp) {
        case 4:
                if (glx_texture_format == __DRI_TEXTURE_FORMAT_RGB) {
+                       texImage->TexFormat = MESA_FORMAT_RGB888;
                        SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8_8_8,
                                     EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, 
                      EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask);
@@ -1218,6 +1219,7 @@ void evergreenSetTexBuffer(__DRIcontext *pDRICtx, GLint target, GLint glx_textur
                        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_RESOURCE7, FMT_8_8_8_8,
                                     EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, 
                      EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask);
@@ -1236,6 +1238,7 @@ void evergreenSetTexBuffer(__DRIcontext *pDRICtx, GLint target, GLint glx_textur
        case 3:
        default:
                // FMT_8_8_8 ???
+               texImage->TexFormat = MESA_FORMAT_RGB888;
                SETfield(t->SQ_TEX_RESOURCE7, FMT_8_8_8_8,
                             EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, 
                  EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask);
@@ -1251,6 +1254,7 @@ void evergreenSetTexBuffer(__DRIcontext *pDRICtx, GLint target, GLint glx_textur
                pitch_val /= 4;
                break;
        case 2:
+               texImage->TexFormat = MESA_FORMAT_RGB565;
                SETfield(t->SQ_TEX_RESOURCE7, FMT_5_6_5,
                             EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift, 
                  EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask);