RenderTarget: fix NPE when depth is not present.

This fixes a recent regression that would occur when a RenderTarget
does not have a depth attachment.
This commit is contained in:
Philip Rideout
2021-03-29 10:20:39 -07:00
parent 3c577b6191
commit cf070c6bc7

View File

@@ -109,7 +109,7 @@ FRenderTarget::HwHandle FRenderTarget::createHandle(FEngine& engine, const Build
auto dtexture = depth.texture ? upcast(depth.texture)->getHwHandle() : TextureHandle();
const TargetBufferInfo dinfo =
upcast(depth.texture)->getTarget() == Texture::Sampler::SAMPLER_CUBEMAP ?
depth.texture && upcast(depth.texture)->getTarget() == Texture::Sampler::SAMPLER_CUBEMAP ?
TargetBufferInfo(dtexture, depth.mipLevel, depth.face) :
TargetBufferInfo(dtexture, depth.mipLevel, depth.layer);