From 0330659871974f8082f6f689e2f88bba3d516493 Mon Sep 17 00:00:00 2001 From: Mike Weiblen Date: Thu, 9 Feb 2017 12:13:24 -0700 Subject: layers: Add VU 2116 pColorBlendState checking GH-777 Add Valid Usage 02116 check. If the rasterizerDiscardEnable member of pRasterizationState is VK_FALSE, and subpass uses color attachments, pColorBlendState must be a pointer to a valid VkPipelineColorBlendStateCreateInfo structure. Update VU database check_implemented flag. Change-Id: I154321e3a891a61c0917ec8a9520ae766162e2e6 --- layers/core_validation.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index d225af42..c008d45b 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -3223,6 +3223,23 @@ static bool verifyPipelineCreateState(layer_data *dev_data, std::vectorcolorAttachmentCount; ++i) { + if (subpass_desc->pColorAttachments[i].attachment != VK_ATTACHMENT_UNUSED) { + ++color_attachment_count; + } + } + if (color_attachment_count > 0 && pPipeline->graphicsPipelineCI.pColorBlendState == nullptr) { + skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, __LINE__, VALIDATION_ERROR_02116, "DS", + "Invalid Pipeline CreateInfo State: pColorBlendState is NULL when rasterization is " + "enabled and subpass uses color attachments. %s", + validation_error_map[VALIDATION_ERROR_02116]); + } + } } } -- cgit v1.2.3