From 474b8fe37de261098c737c8f46212ffd68f78860 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Tue, 29 Nov 2022 13:06:03 -0800 Subject: [PATCH] only check depth format if there is a depth attachment --- src/Graphics/CommandBuffer.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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}"); + } } }