st/dri: Support 24bit formats in dri2_allocate_buffer
authorBenjamin Franzke <benjaminfranzke@googlemail.com>
Sun, 29 Jan 2012 16:28:50 +0000 (17:28 +0100)
committerBenjamin Franzke <benjaminfranzke@googlemail.com>
Mon, 30 Jan 2012 16:15:44 +0000 (17:15 +0100)
Prior commit 576161289df68eedade591fbca4013329c9e5ded,
the parameter format was bpp, thus both 24bit and 32bit formats were
requested with format set to 32. Handle 24bit seperately now.

Fixes RGBX formats in wayland platform for egl_dri2 (EGL_ALPHA_SIZE=0).

Note: This is a candidate for the 8.0 branch.

src/gallium/state_trackers/dri/drm/dri2.c

index afd91ee27a18ffd4245789898a0426f8bea0a7d5..4c08a025ed22d7f5c8e4d8040acf3f55173d6cde 100644 (file)
@@ -316,6 +316,9 @@ dri2_allocate_buffer(__DRIscreen *sPriv,
 
    switch (format) {
       case 32:
+         pf = PIPE_FORMAT_B8G8R8A8_UNORM;
+         break;
+      case 24:
          pf = PIPE_FORMAT_B8G8R8X8_UNORM;
          break;
       case 16: