From: Brian Paul Date: Thu, 7 Aug 2008 21:11:54 +0000 (-0600) Subject: gallium: use PIPE_FORMAT_X8Z24_UNORM for 24-bit Z but no stencil X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c1c4ff28f0af0b14ae64eb01ef1d087b987af2c1;p=mesa.git gallium: use PIPE_FORMAT_X8Z24_UNORM for 24-bit Z but no stencil --- diff --git a/src/gallium/winsys/xlib/xm_api.c b/src/gallium/winsys/xlib/xm_api.c index 8a32c54349b..4e5441a13d2 100644 --- a/src/gallium/winsys/xlib/xm_api.c +++ b/src/gallium/winsys/xlib/xm_api.c @@ -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; + } }