From 68550189ed94ff35fbac03c9ec855fc2097b28f2 Mon Sep 17 00:00:00 2001 From: assiduous Date: Sun, 2 Aug 2020 22:21:25 -0700 Subject: Added another framebuffer validation check --- Graphics/GraphicsEngine/src/FramebufferBase.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/src/FramebufferBase.cpp b/Graphics/GraphicsEngine/src/FramebufferBase.cpp index 75c00d71..41943b09 100644 --- a/Graphics/GraphicsEngine/src/FramebufferBase.cpp +++ b/Graphics/GraphicsEngine/src/FramebufferBase.cpp @@ -49,6 +49,17 @@ void ValidateFramebufferDesc(const FramebufferDesc& Desc) LOG_FRAMEBUFFER_ERROR_AND_THROW("attachment count is not zero, but ppAttachments is null."); } + for (Uint32 i = 0; i < Desc.AttachmentCount; ++i) + { + if (Desc.ppAttachments[i] == nullptr) + { + // If flags does not include VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT, and attachmentCount is not 0, + // pAttachments must be a valid pointer to an array of attachmentCount valid VkImageView handles. + // https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkFramebufferCreateInfo-flags-02778 + LOG_FRAMEBUFFER_ERROR_AND_THROW("framebuffer attachment ", i, " is null."); + } + } + const auto& RPDesc = Desc.pRenderPass->GetDesc(); if (Desc.AttachmentCount != RPDesc.AttachmentCount) { -- cgit v1.2.3