st/xorg: Fix depth stencil buffers on old X servers
authorJakob Bornecrantz <jakob@vmware.com>
Thu, 8 Oct 2009 11:05:55 +0000 (13:05 +0200)
committerJakob Bornecrantz <jakob@vmware.com>
Thu, 8 Oct 2009 11:42:31 +0000 (13:42 +0200)
Sanity checking is for the weak.

src/gallium/state_trackers/xorg/xorg_dri2.c

index 8a362596c751d21fd4af8b7b846d12562305eda5..c41a7cd639d5ddd028ea70526d8c254dbd043f67 100644 (file)
@@ -81,11 +81,14 @@ driDoCreateBuffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int format)
     case DRI2BufferStencil:
 #if defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION > 2
     case DRI2BufferDepthStencil:
+#else
+    /* Works on old X servers because sanity checking is for the weak */
+    case 9:
+#endif
        if (exa_priv->depth_stencil_tex &&
            !pf_is_depth_stencil(exa_priv->depth_stencil_tex->format))
            exa_priv->depth_stencil_tex = NULL;
         /* Fall through */
-#endif
     case DRI2BufferDepth:
        if (exa_priv->depth_stencil_tex)
            pipe_texture_reference(&tex, exa_priv->depth_stencil_tex);