Don't use an alpha texture format for GLX_TEXTURE_FORMAT_RGB_EXT
authorOwen W. Taylor <otaylor@fishsoup.net>
Thu, 7 May 2009 02:42:50 +0000 (22:42 -0400)
committerAlex Deucher <alexdeucher@gmail.com>
Wed, 13 May 2009 23:04:18 +0000 (19:04 -0400)
In r300SetTexBuffer2(), 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/r300/r300_texstate.c

index 443fafe5e22bed5652ff376bbda1bf642e1e63d6..6d6a90aa88a288b02fe41519c042aa8e7454cd39 100644 (file)
@@ -449,7 +449,10 @@ void r300SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo
        pitch_val = rb->pitch;
        switch (rb->cpp) {
        case 4:
-               t->pp_txformat = R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8);
+               if (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT)
+                       t->pp_txformat = R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8);
+               else
+                       t->pp_txformat = R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8);
                t->pp_txfilter |= tx_table[2].filter;
                pitch_val /= 4;
                break;