st/glx: added PIPE_FORMAT_Z24S8_UNORM code
authorBrian Paul <brianp@vmware.com>
Wed, 24 Feb 2010 01:23:15 +0000 (18:23 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 24 Feb 2010 01:57:18 +0000 (18:57 -0700)
src/gallium/state_trackers/glx/xlib/xm_api.c

index 4aac08a1084245dd3e2511afba013e018e84aa98..1798faa0f315b5474e81e230ae9c6634846f4d6e 100644 (file)
@@ -376,7 +376,8 @@ create_xmesa_buffer(Drawable d, BufferType type,
 #endif
 
    if (vis->mesa_visual.stencilBits == 8) {
-      if (depthFormat == PIPE_FORMAT_S8Z24_UNORM)
+      if (depthFormat == PIPE_FORMAT_S8Z24_UNORM ||
+          depthFormat == PIPE_FORMAT_Z24S8_UNORM)
          stencilFormat = depthFormat;
       else
          stencilFormat = PIPE_FORMAT_S8_UNORM;
@@ -388,6 +389,10 @@ create_xmesa_buffer(Drawable d, BufferType type,
          /* use 24-bit Z, undefined stencil channel */
          depthFormat = PIPE_FORMAT_X8Z24_UNORM;
       }
+      else if (depthFormat == PIPE_FORMAT_Z24S8_UNORM) {
+         /* use 24-bit Z, undefined stencil channel */
+         depthFormat = PIPE_FORMAT_Z24X8_UNORM;
+      }
    }