summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-08-03 05:21:25 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-08-03 05:21:25 +0000
commit68550189ed94ff35fbac03c9ec855fc2097b28f2 (patch)
tree795895ab3367313b3da0176286ffdd7ce470e61e /Graphics/GraphicsEngine
parentMore framebuffer validation (diff)
downloadDiligentCore-68550189ed94ff35fbac03c9ec855fc2097b28f2.tar.gz
DiligentCore-68550189ed94ff35fbac03c9ec855fc2097b28f2.zip
Added another framebuffer validation check
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/src/FramebufferBase.cpp11
1 files changed, 11 insertions, 0 deletions
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)
{