Add support for more depth buffer formats in our EGLConfigs.
This includes no depth buffer and 16-bit depth buffer with no stencil buffer.
TRAC #22496
Signed-off-by: Geoff Lang
Signed-off-by: Shannon Woods
Author: Jamie Madill
git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1851 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/renderer/Renderer11.cpp b/src/libGLESv2/renderer/Renderer11.cpp
index 4b4169e..f9369d5 100644
--- a/src/libGLESv2/renderer/Renderer11.cpp
+++ b/src/libGLESv2/renderer/Renderer11.cpp
@@ -49,7 +49,9 @@
static const DXGI_FORMAT DepthStencilFormats[] =
{
- DXGI_FORMAT_D24_UNORM_S8_UINT
+ DXGI_FORMAT_UNKNOWN,
+ DXGI_FORMAT_D24_UNORM_S8_UINT,
+ DXGI_FORMAT_D16_UNORM
};
enum
@@ -286,10 +288,16 @@
{
DXGI_FORMAT depthStencilFormat = DepthStencilFormats[depthStencilIndex];
- UINT formatSupport = 0;
- HRESULT result = mDevice->CheckFormatSupport(depthStencilFormat, &formatSupport);
+ bool depthStencilFormatOK = true;
- if (SUCCEEDED(result) && (formatSupport & D3D11_FORMAT_SUPPORT_DEPTH_STENCIL))
+ if (depthStencilFormat != DXGI_FORMAT_UNKNOWN)
+ {
+ UINT formatSupport = 0;
+ result = mDevice->CheckFormatSupport(depthStencilFormat, &formatSupport);
+ depthStencilFormatOK = SUCCEEDED(result) && (formatSupport & D3D11_FORMAT_SUPPORT_DEPTH_STENCIL);
+ }
+
+ if (depthStencilFormatOK)
{
ConfigDesc newConfig;
newConfig.renderTargetFormat = d3d11_gl::ConvertBackBufferFormat(renderTargetFormat);