Skip to content

Commit f3e5352

Browse files
authored
D3D12: fix depth buffer optimized clear color for typeless formats (#691)
1 parent aa582a9 commit f3e5352

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Graphics/GraphicsEngineD3D12/src/SwapChainD3D12Impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void SwapChainD3D12Impl::InitBuffersAndViews()
112112
DepthBufferDesc.Usage = USAGE_DEFAULT;
113113
DepthBufferDesc.BindFlags = BIND_DEPTH_STENCIL;
114114

115-
DepthBufferDesc.ClearValue.Format = DepthBufferDesc.Format;
115+
DepthBufferDesc.ClearValue.Format = GetDefaultTextureViewFormat(DepthBufferDesc.Format, TEXTURE_VIEW_DEPTH_STENCIL, DepthBufferDesc.BindFlags);
116116
DepthBufferDesc.ClearValue.DepthStencil.Depth = m_SwapChainDesc.DefaultDepthValue;
117117
DepthBufferDesc.ClearValue.DepthStencil.Stencil = m_SwapChainDesc.DefaultStencilValue;
118118
DepthBufferDesc.Name = "Main depth buffer";

0 commit comments

Comments
 (0)