Fixed potential crash if an attachment binding doesn't connect to an attachment. (#1373)

This commit is contained in:
Qing Tao
2021-06-16 17:00:41 -07:00
committed by GitHub
parent 62c70035f4
commit 7b0d2aac03
@@ -61,6 +61,11 @@ namespace AZ
{
const PassAttachmentBinding& binding = m_attachmentBindings[slotIndex];
if (!binding.m_attachment)
{
continue;
}
// Handle the depth-stencil attachment. There should be only one.
if (binding.m_scopeAttachmentUsage == RHI::ScopeAttachmentUsage::DepthStencil)
{
@@ -98,6 +103,10 @@ namespace AZ
{
continue;
}
if (!binding.m_attachment)
{
continue;
}
if (binding.m_scopeAttachmentUsage == RHI::ScopeAttachmentUsage::RenderTarget
|| binding.m_scopeAttachmentUsage == RHI::ScopeAttachmentUsage::DepthStencil)