mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
app/internal/d3d11: only clear depth buffer if it exists
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user