Fixed static analysis warning: Dereferencing NULL pointer 'DepthStencilRenderTarget.DepthStencilTarget'

#jira UE-73125

#ROBOMERGE-OWNER: lina.halper
#ROBOMERGE-AUTHOR: dmitriy.dyomin
#ROBOMERGE-SOURCE: CL 6054867 via CL 6055470 via CL 6056431 via CL 6056602
#ROBOMERGE-BOT: ANIM (Main -> Dev-Anim)

[CL 6064545 by dmitriy dyomin in Dev-Anim branch]
This commit is contained in:
dmitriy dyomin
2019-04-23 17:14:46 -04:00
parent d4cbd4dd28
commit e894e33cf7

View File

@@ -1002,20 +1002,20 @@ void FRHIRenderPassInfo::Validate() const
// this check is incorrect for mobile, depth/stencil is intermediate and we don't want to store it to main memory
//ensure(StencilStore == ERenderTargetStoreAction::EStore);
}
if (SubpassHint == ESubpassHint::DepthReadSubpass)
{
// for depth read sub-pass
// 1. render pass must have depth target
// 2. depth target must support InputAttachement
ensure((DepthStencilRenderTarget.DepthStencilTarget->GetFlags() & TexCreate_InputAttachmentRead) != 0);
}
}
else
{
ensure(DepthStencilRenderTarget.Action == EDepthStencilTargetActions::DontLoad_DontStore);
ensure(DepthStencilRenderTarget.ExclusiveDepthStencil == FExclusiveDepthStencil::DepthNop_StencilNop);
}
if (SubpassHint == ESubpassHint::DepthReadSubpass)
{
// for depth read sub-pass
// 1. render pass must have depth target
// 2. depth target must support InputAttachement
ensure(DepthStencilRenderTarget.DepthStencilTarget);
ensure((DepthStencilRenderTarget.DepthStencilTarget->GetFlags() & TexCreate_InputAttachmentRead) != 0);
ensure(SubpassHint != ESubpassHint::DepthReadSubpass);
}
}
#endif