Revert "st/xorg/dri: Pass texture formats via the DRI2 protocol flags."
authorJakob Bornecrantz <jakob@vmware.com>
Fri, 28 Aug 2009 09:43:19 +0000 (11:43 +0200)
committerJakob Bornecrantz <jakob@vmware.com>
Fri, 28 Aug 2009 10:35:42 +0000 (12:35 +0200)
This reverts commit a33e9ea3b9b7ac98d6e9bc385bbbe7eac2eb73d0.

As this change breaks both radeon and nouveau

src/gallium/state_trackers/dri/dri_drawable.c
src/gallium/state_trackers/xorg/xorg_dri2.c

index c092afe56af1f190369afd733937c01691a38e7b..200b4bd3766a21d2c56c58dc1f3ae7e9052715b3 100644 (file)
@@ -183,25 +183,27 @@ dri_get_buffers(__DRIdrawablePrivate * dPriv)
    drawable->is_pixmap = dri2_check_if_pixmap(buffers, count);
 
    for (i = 0; i < count; i++) {
+      enum pipe_format format = 0;
       int index = 0;
 
       switch (buffers[i].attachment) {
       case __DRI_BUFFER_FRONT_LEFT:
+        continue;
       case __DRI_BUFFER_FAKE_FRONT_LEFT:
         index = ST_SURFACE_FRONT_LEFT;
-        drawable->color_format = buffers[i].flags;
+        format = drawable->color_format;
         break;
       case __DRI_BUFFER_BACK_LEFT:
         index = ST_SURFACE_BACK_LEFT;
-        drawable->color_format = buffers[i].flags;
+        format = drawable->color_format;
         break;
       case __DRI_BUFFER_DEPTH:
         index = ST_SURFACE_DEPTH;
-        drawable->depth_format = buffers[i].flags;
+        format = drawable->depth_format;
         break;
       case __DRI_BUFFER_STENCIL:
         index = ST_SURFACE_DEPTH;
-        drawable->stencil_format = buffers[i].flags;
+        format = drawable->stencil_format;
         break;
       case __DRI_BUFFER_ACCUM:
       default:
@@ -218,7 +220,7 @@ dri_get_buffers(__DRIdrawablePrivate * dPriv)
       surface = dri_surface_from_handle(api,
                                        screen,
                                        buffers[i].name,
-                                       buffers[i].flags,
+                                       format,
                                        dri_drawable->w,
                                        dri_drawable->h, buffers[i].pitch);
 
@@ -248,7 +250,9 @@ void dri2_set_tex_buffer2(__DRIcontext *pDRICtx, GLint target,
    st_get_framebuffer_surface(drawable->stfb, ST_SURFACE_FRONT_LEFT, &ps);
 
    st_bind_texture_surface(ps, target == GL_TEXTURE_2D ? ST_TEXTURE_2D :
-                           ST_TEXTURE_RECT, 0, drawable->color_format);
+                           ST_TEXTURE_RECT, 0,
+                           format == GLX_TEXTURE_FORMAT_RGBA_EXT ?
+                           PIPE_FORMAT_R8G8B8A8_UNORM : PIPE_FORMAT_R8G8B8X8_UNORM);
 }
 
 void dri2_set_tex_buffer(__DRIcontext *pDRICtx, GLint target,
index 1a4677b50e523283b19659117ad1c2b646796d5d..3aea37a06fb8cfe2dd4652ce648d36b81ab619ee 100644 (file)
@@ -141,7 +141,7 @@ driCreateBuffers(DrawablePtr pDraw, unsigned int *attachments, int count)
        buffers[i].pitch = stride;
        buffers[i].cpp = 4;
        buffers[i].driverPrivate = &privates[i];
-       buffers[i].flags = tex->format;
+       buffers[i].flags = 0; /* not tiled */
        privates[i].pPixmap = pPixmap;
        privates[i].buf = buf;
        privates[i].tex = tex;