diff options
Diffstat (limited to 'src')
-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; |