app/internal/d3d11: only clear depth buffer if it exists

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-02-28 14:50:39 +00:00
parent 73fc5e1482
commit a448825d48
+1 -1
View File
@@ -500,7 +500,7 @@ func (b *Backend) Clear(buffers backend.BufferAttachments) {
if buffers&backend.BufferAttachmentColor != 0 {
b.dev.ctx.ClearRenderTargetView(b.fbo.renderTarget, &b.clearColor)
}
if buffers&backend.BufferAttachmentDepth != 0 {
if buffers&backend.BufferAttachmentDepth != 0 && b.fbo.depthView != nil {
b.dev.ctx.ClearDepthStencilView(b.fbo.depthView, _D3D11_CLEAR_DEPTH|_D3D11_CLEAR_STENCIL, b.clearDepth, 0)
}
}