From 0bbcb47901c16661e39a1c586c19b58e5eb73d45 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 6 Mar 2009 18:03:50 +0000 Subject: [PATCH] wgl: Check support for all other depth/stencil formats. --- .../wgl/shared/stw_framebuffer.c | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/gallium/state_trackers/wgl/shared/stw_framebuffer.c b/src/gallium/state_trackers/wgl/shared/stw_framebuffer.c index 2b9f7ab7bd7..17c96c411f7 100644 --- a/src/gallium/state_trackers/wgl/shared/stw_framebuffer.c +++ b/src/gallium/state_trackers/wgl/shared/stw_framebuffer.c @@ -109,7 +109,8 @@ framebuffer_create( if (visual->depthBits == 0) depthFormat = PIPE_FORMAT_NONE; - else if (visual->depthBits <= 16) + else if (visual->depthBits <= 16 && + stw_is_supported_depth_stencil(PIPE_FORMAT_Z16_UNORM)) depthFormat = PIPE_FORMAT_Z16_UNORM; else if (visual->depthBits <= 24 && visual->stencilBits != 8 && stw_is_supported_depth_stencil(PIPE_FORMAT_X8Z24_UNORM)) { @@ -127,14 +128,24 @@ framebuffer_create( stw_is_supported_depth_stencil(PIPE_FORMAT_Z24S8_UNORM)) { depthFormat = PIPE_FORMAT_Z24S8_UNORM; } - else + else if(stw_is_supported_depth_stencil(PIPE_FORMAT_Z32_UNORM)) { depthFormat = PIPE_FORMAT_Z32_UNORM; + } + else if(stw_is_supported_depth_stencil(PIPE_FORMAT_Z32_FLOAT)) { + depthFormat = PIPE_FORMAT_Z32_FLOAT; + } + else { + assert(0); + depthFormat = PIPE_FORMAT_NONE; + } - if (visual->stencilBits == 8) { - if (depthFormat == PIPE_FORMAT_S8Z24_UNORM || depthFormat == PIPE_FORMAT_Z24S8_UNORM) - stencilFormat = depthFormat; - else - stencilFormat = PIPE_FORMAT_S8_UNORM; + if (depthFormat == PIPE_FORMAT_S8Z24_UNORM || + depthFormat == PIPE_FORMAT_Z24S8_UNORM) { + stencilFormat = depthFormat; + } + else if (visual->stencilBits == 8 && + stw_is_supported_depth_stencil(PIPE_FORMAT_S8_UNORM)) { + stencilFormat = PIPE_FORMAT_S8_UNORM; } else { stencilFormat = PIPE_FORMAT_NONE; -- 2.30.2