diff options
author | José Fonseca <[email protected]> | 2009-03-06 18:03:50 +0000 |
---|---|---|
committer | José Fonseca <[email protected]> | 2009-03-06 18:04:25 +0000 |
commit | 0bbcb47901c16661e39a1c586c19b58e5eb73d45 (patch) | |
tree | fd8f94fec3e27c77df27ad22e6cc808e51cb3d45 /src/gallium | |
parent | 78071fe7676adfcab44983505b0f64a31aa823b5 (diff) |
wgl: Check support for all other depth/stencil formats.
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/state_trackers/wgl/shared/stw_framebuffer.c | 25 |
1 files 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; |