layers: LX265 Error if color blend attch count != subpass attch.
authorMark Young <marky@lunarg.com>
Wed, 30 Mar 2016 07:17:08 +0000 (01:17 -0600)
committerTobin Ehlis <tobine@google.com>
Thu, 31 Mar 2016 22:33:50 +0000 (16:33 -0600)
Spec states that the VkPilelineColorBlendAttachmentState
attachmentCount must be equal to the subpass'
colorAttachmentCount.

Change-Id: I2b281cda2c12f2003d8ee68b326d78a9aaadf573

layers/core_validation.cpp

index 8ebc10b..7235fd5 100644 (file)
@@ -3409,6 +3409,14 @@ static VkBool32 validatePipelineState(layer_data *my_data, const GLOBAL_CB_NODE
                 VkSampleCountFlagBits subpassNumSamples = (VkSampleCountFlagBits)0;
                 uint32_t i;
 
+                if (pPipeline->cbStateCI.attachmentCount != pSD->colorAttachmentCount) {
+                    return log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+                                   reinterpret_cast<const uint64_t &>(pipeline), __LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS",
+                                   "Render pass subpass %u mismatch between blend state attachment count %u and "
+                                   "sub-pass color attachment count %u!  These must be the same.",
+                                   pCB->activeSubpass, pPipeline->cbStateCI.attachmentCount, pSD->colorAttachmentCount);
+                }
+
                 for (i = 0; i < pSD->colorAttachmentCount; i++) {
                     VkSampleCountFlagBits samples;