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,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}");
}
}
}