gallium: use PIPE_FORMAT_X8Z24_UNORM for 24-bit Z but no stencil
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 7 Aug 2008 21:11:54 +0000 (15:11 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 7 Aug 2008 21:14:52 +0000 (15:14 -0600)
src/gallium/winsys/xlib/xm_api.c

index 8a32c54349be6704e4a3353f078fef8284b81fb9..4e5441a13d21c0afd3b65340b4571a6c6b07301d 100644 (file)
@@ -363,7 +363,12 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type,
          stencilFormat = PIPE_FORMAT_S8_UNORM;
    }
    else {
+      /* no stencil */
       stencilFormat = PIPE_FORMAT_NONE;
+      if (depthFormat == PIPE_FORMAT_S8Z24_UNORM) {
+         /* use 24-bit Z, undefined stencil channel */
+         depthFormat = PIPE_FORMAT_X8Z24_UNORM;
+      }
    }