Fix a crash when using custom rendertargets

This was introduced recently.

Fix #3962
This commit is contained in:
Mathias Agopian
2021-05-24 09:53:54 -07:00
committed by Mathias Agopian
parent 92d2de5279
commit 786eee4eb9
+1 -1
View File
@@ -322,7 +322,7 @@ void FRenderer::renderJob(ArenaScope& arena, FView& view) {
// "+1" to the count for the DEPTH attachment (we don't have stencil for the public RenderTarget)
for (size_t i = 0; i < RenderTarget::MAX_SUPPORTED_COLOR_ATTACHMENTS_COUNT + 1; i++) {
auto attachment = currentRenderTarget->getAttachment((RenderTarget::AttachmentPoint)i);
if (any(attachment.texture->getUsage() &
if (attachment.texture && any(attachment.texture->getUsage() &
(TextureUsage::SAMPLEABLE | Texture::Usage::SUBPASS_INPUT))) {
keepOverrideEndFlags |= backend::getTargetBufferFlagsAt(i);
}