From c2e8a89ccbc38926fa026ae8604bd84e370065cc Mon Sep 17 00:00:00 2001 From: turanszkij Date: Fri, 18 Aug 2017 21:48:37 +0200 Subject: [PATCH] better hardware utilization of depthstencil resources --- WickedEngine/wiDepthTarget.cpp | 3 ++- WickedEngine/wiGraphicsDevice_DX11.cpp | 6 ++++++ WickedEngine/wiVersion.cpp | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/WickedEngine/wiDepthTarget.cpp b/WickedEngine/wiDepthTarget.cpp index 0c8d125d0..7d1e6765c 100644 --- a/WickedEngine/wiDepthTarget.cpp +++ b/WickedEngine/wiDepthTarget.cpp @@ -31,7 +31,8 @@ void wiDepthTarget::Initialize(int width, int height, UINT MSAAC) depthDesc.Height = height; depthDesc.MipLevels = 1; depthDesc.ArraySize = 1; - depthDesc.Format = FORMAT_R24G8_TYPELESS; + //depthDesc.Format = FORMAT_R24G8_TYPELESS; + depthDesc.Format = FORMAT_R32G8X24_TYPELESS; // better utilization of hardware depthDesc.SampleDesc.Count = MSAAC; // depthDesc.SampleDesc.Quality = 0; // auto-filll in device depthDesc.Usage = USAGE_DEFAULT; diff --git a/WickedEngine/wiGraphicsDevice_DX11.cpp b/WickedEngine/wiGraphicsDevice_DX11.cpp index 0e295b434..d0388b3d3 100644 --- a/WickedEngine/wiGraphicsDevice_DX11.cpp +++ b/WickedEngine/wiGraphicsDevice_DX11.cpp @@ -1954,6 +1954,9 @@ HRESULT GraphicsDevice_DX11::CreateShaderResourceView(Texture2D* pTexture) case FORMAT_R24G8_TYPELESS: shaderResourceViewDesc.Format = DXGI_FORMAT_R24_UNORM_X8_TYPELESS; break; + case FORMAT_R32G8X24_TYPELESS: + shaderResourceViewDesc.Format = DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS; + break; default: shaderResourceViewDesc.Format = _ConvertFormat(pTexture->desc.Format); break; @@ -2289,6 +2292,9 @@ HRESULT GraphicsDevice_DX11::CreateDepthStencilView(Texture2D* pTexture) case FORMAT_R24G8_TYPELESS: depthStencilViewDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; break; + case FORMAT_R32G8X24_TYPELESS: + depthStencilViewDesc.Format = DXGI_FORMAT_D32_FLOAT_S8X24_UINT; + break; default: depthStencilViewDesc.Format = _ConvertFormat(pTexture->desc.Format); break; diff --git a/WickedEngine/wiVersion.cpp b/WickedEngine/wiVersion.cpp index e0878c2ca..b4bd8998a 100644 --- a/WickedEngine/wiVersion.cpp +++ b/WickedEngine/wiVersion.cpp @@ -9,7 +9,7 @@ namespace wiVersion // minor features, major updates const int minor = 12; // minor bug fixes, alterations, refactors, updates - const int revision = 4; + const int revision = 5; long GetVersion()