only check depth format if there is a depth attachment

moar-validation
cosmonaut 2022-11-29 13:06:03 -08:00
parent bc41d2c079
commit 474b8fe37d
1 changed files with 6 additions and 3 deletions

View File

@ -1946,12 +1946,15 @@ namespace MoonWorks.Graphics
} }
} }
if (graphicsPipeline.AttachmentInfo.HasDepthStencilAttachment)
{
var pipelineDepthFormat = graphicsPipeline.AttachmentInfo.DepthStencilFormat; var pipelineDepthFormat = graphicsPipeline.AttachmentInfo.DepthStencilFormat;
if (pipelineDepthFormat != depthStencilFormat) if (pipelineDepthFormat != depthStencilFormat)
{ {
throw new System.InvalidOperationException($"Depth texture format mismatch! Pipeline expects {pipelineDepthFormat}, render pass attachment is {depthStencilFormat}"); throw new System.InvalidOperationException($"Depth texture format mismatch! Pipeline expects {pipelineDepthFormat}, render pass attachment is {depthStencilFormat}");
} }
} }
}
private void AssertVertexSamplerCount(int count) private void AssertVertexSamplerCount(int count)
{ {