diff options
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index b4d8e510..a95f99b7 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -2133,6 +2133,15 @@ static bool attachment_references_compatible(const uint32_t index, const VkAttac const uint32_t primaryCount, const VkAttachmentDescription *pPrimaryAttachments, const VkAttachmentReference *pSecondary, const uint32_t secondaryCount, const VkAttachmentDescription *pSecondaryAttachments) { + // Check potential NULL cases first to avoid nullptr issues later + if (pPrimary == nullptr) { + if (pSecondary == nullptr) { + return true; + } + return false; + } else if (pSecondary == nullptr) { + return false; + } if (index >= primaryCount) { // Check secondary as if primary is VK_ATTACHMENT_UNUSED if (VK_ATTACHMENT_UNUSED == pSecondary[index].attachment) return true; @@ -2150,7 +2159,7 @@ static bool attachment_references_compatible(const uint32_t index, const VkAttac return false; } -// For give primary and secondary RenderPass objects, verify that they're compatible +// For given primary and secondary RenderPass objects, verify that they're compatible static bool verify_renderpass_compatibility(const layer_data *my_data, const VkRenderPass primaryRP, const VkRenderPass secondaryRP, string &errorMsg) { auto primary_render_pass = getRenderPass(my_data, primaryRP); @@ -8248,6 +8257,7 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateFramebuffer(VkDevice device, const VkFrameb VkFramebuffer *pFramebuffer) { bool skip_call = false; VkResult result = VK_ERROR_VALIDATION_FAILED_EXT; + // TODO : Verify that renderPass FB is created with is compatible with FB layer_data *dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map); skip_call |= ValidateAttachmentImageUsage(dev_data, pCreateInfo); |
