st/dri: Add missing front buffer case in dri_get_buffers().
authorMichel Dänzer <daenzer@vmware.com>
Wed, 7 Oct 2009 14:36:39 +0000 (16:36 +0200)
committerMichel Dänzer <daenzer@vmware.com>
Wed, 7 Oct 2009 14:36:39 +0000 (16:36 +0200)
This seems to help for compiz at least with some drivers.

Also add an assert(0) to catch unhandled cases in the future.

src/gallium/state_trackers/dri/dri_drawable.c

index 3f8dc8df75ecb652641e26b06551feba765411dd..c67cc8dacb61f60fb4d932153fe521555c999132 100644 (file)
@@ -213,6 +213,7 @@ dri_get_buffers(__DRIdrawablePrivate * dPriv)
                                        dri_drawable->h, buffers[i].pitch);
 
       switch (buffers[i].attachment) {
+      case __DRI_BUFFER_FRONT_LEFT:
       case __DRI_BUFFER_FAKE_FRONT_LEFT:
       case __DRI_BUFFER_BACK_LEFT:
         drawable->color_format = surface->format;
@@ -222,6 +223,9 @@ dri_get_buffers(__DRIdrawablePrivate * dPriv)
       case __DRI_BUFFER_STENCIL:
         drawable->depth_stencil_format = surface->format;
         break;
+      case __DRI_BUFFER_ACCUM:
+      default:
+        assert(0);
       }
 
       st_set_framebuffer_surface(drawable->stfb, index, surface);