r100: fix texture_from_pixmap and compiz.
authorDave Airlie <airlied@redhat.com>
Fri, 20 Nov 2009 01:45:43 +0000 (11:45 +1000)
committerDave Airlie <airlied@itt42.(none)>
Fri, 20 Nov 2009 01:47:00 +0000 (11:47 +1000)
r100 state emission has separate rect and non-rect states,
if we are doing TFP for a TEXTURE_2D we shouldn't use the rect
states as they won't get emitted properly.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/drivers/dri/radeon/radeon_texstate.c

index 4d9eb73d2068a8f41dd2564ad89bbae06f46fb8d..3cbe3b472548b792a532c4c8895fadb92dc32044 100644 (file)
@@ -714,8 +714,6 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_
        t->tile_bits = 0;
        t->image_override = GL_TRUE;
        t->override_offset = 0;
-       t->pp_txpitch &= (1 << 13) -1;
-       pitch_val = rb->pitch;
        switch (rb->cpp) {
        case 4:
                if (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT)
@@ -734,12 +732,17 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_
                t->pp_txfilter |= tx_table[MESA_FORMAT_RGB565].filter;
                break;
        }
-        t->pp_txsize = ((rb->base.Width - 1) << RADEON_TEX_USIZE_SHIFT)
-                  | ((rb->base.Height - 1) << RADEON_TEX_VSIZE_SHIFT);
-        t->pp_txformat |= RADEON_TXFORMAT_NON_POWER2;
-       t->pp_txpitch = pitch_val;
-        t->pp_txpitch -= 32;
 
+       t->pp_txpitch &= (1 << 13) -1;
+       pitch_val = rb->pitch;
+
+        t->pp_txsize = ((rb->base.Width - 1) << RADEON_TEX_USIZE_SHIFT)
+               | ((rb->base.Height - 1) << RADEON_TEX_VSIZE_SHIFT);
+       if (target == GL_TEXTURE_RECTANGLE_NV) {
+               t->pp_txformat |= RADEON_TXFORMAT_NON_POWER2;
+               t->pp_txpitch = pitch_val;
+               t->pp_txpitch -= 32;
+       }
        t->validated = GL_TRUE;
        _mesa_unlock_texture(radeon->glCtx, texObj);
        return;