R1xx/r2xx: Don't use an alpha texture format for GLX_TEXTURE_FORMAT_RGB_EXT
authorAlex Deucher <alexdeucher@gmail.com>
Wed, 13 May 2009 23:43:04 +0000 (19:43 -0400)
committerAlex Deucher <alexdeucher@gmail.com>
Wed, 13 May 2009 23:43:04 +0000 (19:43 -0400)
In r*00SetTexBuffer2(), if the passed in text glx_texture_format
is GLX_TEXTURE_FORMAT_RGB_EXT, then we should use an RGB-only
texture format, even if the DRI buffer has four channels.

https://bugs.freedesktop.org/show_bug.cgi?id=21609

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

index eee54cd73bab70651beae379a14d6d29e98fce79..ed1995e147c3a099f5b76158086c68fe75f28cd1 100644 (file)
@@ -850,7 +850,10 @@ void r200SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo
        pitch_val = rb->pitch;
        switch (rb->cpp) {
        case 4:
-               t->pp_txformat = tx_table_le[MESA_FORMAT_ARGB8888].format;
+               if (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT)
+                       t->pp_txformat = tx_table_le[MESA_FORMAT_RGB888].format;
+               else
+                       t->pp_txformat = tx_table_le[MESA_FORMAT_ARGB8888].format;
                t->pp_txfilter |= tx_table_le[MESA_FORMAT_ARGB8888].filter;
                break;
        case 3:
index e4df33766eb763172b77011beb76f479fa9a2f90..279bcd4df6a3afc019ec59f624e0fb175681d6e0 100644 (file)
@@ -722,7 +722,10 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_
        pitch_val = rb->pitch;
        switch (rb->cpp) {
        case 4:
-               t->pp_txformat = tx_table[MESA_FORMAT_ARGB8888].format;
+               if (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT)
+                       t->pp_txformat = tx_table[MESA_FORMAT_RGB888].format;
+               else
+                       t->pp_txformat = tx_table[MESA_FORMAT_ARGB8888].format;
                t->pp_txfilter |= tx_table[MESA_FORMAT_ARGB8888].filter;
                break;
        case 3: