st/dri2: Fake frontbuffer changes
authorJakob Bornecrantz <wallbraker@gmail.com>
Tue, 3 Mar 2009 23:36:59 +0000 (00:36 +0100)
committerJakob Bornecrantz <wallbraker@gmail.com>
Tue, 3 Mar 2009 23:39:59 +0000 (00:39 +0100)
Front buffer rendering works as it stands but it completely
wrong. But as it stands fake front buffer rendering is
completely broken. So we keep it as it is. But lets atleast
handle it in the get buffers code.

src/gallium/state_trackers/dri2/dri_drawable.c

index 8a00c6caf1a032541959213f907f1b002e961081..2f6913ec5cbf095c46acbbe3d7bd73eb96007085 100644 (file)
@@ -153,6 +153,10 @@ dri_get_buffers(__DRIdrawablePrivate *dPriv)
             index = ST_SURFACE_FRONT_LEFT;
             format = PIPE_FORMAT_A8R8G8B8_UNORM;
             break;
+         case __DRI_BUFFER_FAKE_FRONT_LEFT:
+            index = ST_SURFACE_FRONT_LEFT;
+            format = PIPE_FORMAT_A8R8G8B8_UNORM;
+            break;
          case __DRI_BUFFER_BACK_LEFT:
             index = ST_SURFACE_BACK_LEFT;
             format = PIPE_FORMAT_A8R8G8B8_UNORM;
@@ -275,7 +279,12 @@ dri_create_buffer(__DRIscreenPrivate *sPriv,
    /* setup dri2 buffers information */
    i = 0;
    drawable->attachments[i++] = __DRI_BUFFER_FRONT_LEFT;
-   drawable->attachments[i++] = __DRI_BUFFER_BACK_LEFT;
+#if 0
+   /* TODO incase of double buffer visual, delay fake creation */
+   drawable->attachments[i++] = __DRI_BUFFER_FAKE_FRONT_LEFT;
+#endif
+   if (visual->doubleBufferMode)
+      drawable->attachments[i++] = __DRI_BUFFER_BACK_LEFT;
    if (visual->depthBits)
       drawable->attachments[i++] = __DRI_BUFFER_DEPTH;
    if (visual->stencilBits)