From f3cd5069e32a7621019f3c40d87b4809c31cc21d Mon Sep 17 00:00:00 2001 From: assiduous Date: Sat, 8 Aug 2020 17:35:39 -0700 Subject: D3D12 backend: fixed load op for depth-stencil attachments --- Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Graphics/GraphicsEngineD3D12') diff --git a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp index 1902ff45..7750c4be 100644 --- a/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp @@ -1184,6 +1184,11 @@ void DeviceContextD3D12Impl::CommitSubpassRenderTargets() RenderPassDS.DepthBeginningAccess.Type = AttachmentLoadOpToD3D12BeginningAccessType(DSAttachmentDesc.LoadOp); RenderPassDS.StencilBeginningAccess.Type = AttachmentLoadOpToD3D12BeginningAccessType(DSAttachmentDesc.StencilLoadOp); } + else + { + RenderPassDS.DepthBeginningAccess.Type = D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE; + RenderPassDS.StencilBeginningAccess.Type = D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE; + } if (RenderPassDS.DepthBeginningAccess.Type == D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR) { -- cgit v1.2.3