diff options
| author | Mike Weiblen <mikew@lunarg.com> | 2017-02-09 12:13:24 -0700 |
|---|---|---|
| committer | Mike Weiblen <mikew@lunarg.com> | 2017-02-13 12:02:45 -0700 |
| commit | 0330659871974f8082f6f689e2f88bba3d516493 (patch) | |
| tree | 7da187c92cafea0e0ab262b71716d840c729b98b /layers/core_validation.cpp | |
| parent | 44dd16bb27045ef45fa64d694c0864426c66405e (diff) | |
| download | usermoji-0330659871974f8082f6f689e2f88bba3d516493.tar.xz | |
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
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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::vector<PIPELINE validation_error_map[VALIDATION_ERROR_02115]); } } + + // If subpass uses color attachments, pColorBlendState must be valid pointer + if (subpass_desc) { + uint32_t color_attachment_count = 0; + for (uint32_t i = 0; i < subpass_desc->colorAttachmentCount; ++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]); + } + } } } |
