diff --git a/src/Graphics/CommandBuffer.cs b/src/Graphics/CommandBuffer.cs index dd2e61a..ded0829 100644 --- a/src/Graphics/CommandBuffer.cs +++ b/src/Graphics/CommandBuffer.cs @@ -1946,10 +1946,13 @@ namespace MoonWorks.Graphics } } - var pipelineDepthFormat = graphicsPipeline.AttachmentInfo.DepthStencilFormat; - if (pipelineDepthFormat != depthStencilFormat) + if (graphicsPipeline.AttachmentInfo.HasDepthStencilAttachment) { - throw new System.InvalidOperationException($"Depth texture format mismatch! Pipeline expects {pipelineDepthFormat}, render pass attachment is {depthStencilFormat}"); + var pipelineDepthFormat = graphicsPipeline.AttachmentInfo.DepthStencilFormat; + if (pipelineDepthFormat != depthStencilFormat) + { + throw new System.InvalidOperationException($"Depth texture format mismatch! Pipeline expects {pipelineDepthFormat}, render pass attachment is {depthStencilFormat}"); + } } }