aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2017-02-01 13:31:22 -0700
committerTobin Ehlis <tobine@google.com>2017-02-01 15:08:07 -0700
commit556692b8792a6a909262ddec39dc754086bec1c3 (patch)
tree9d1f868f70ab1c15f2927f5ec168ae2cb11838f5 /layers/core_validation.cpp
parentee9cd37d587568b3ed4f32b620350331f4320d1e (diff)
downloadusermoji-556692b8792a6a909262ddec39dc754086bec1c3.tar.xz
layers:Move gfx pipe check to create time
Fixes #1424 The check to verify that the attachmentCount for blend state of a Graphics Pipeline matches the attachmentCount for the given subpass of the creation renderPass was occurring at draw time but can and should be done at Gfx Pipeline creation time. This change moves the check to creation time and updates the database and test appropriately.
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index ebb900db..a4cde252 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -2885,21 +2885,6 @@ static bool ValidatePipelineDrawtimeState(layer_data const *my_data, LAST_BOUND_
auto const render_pass_info = pCB->activeRenderPass->createInfo.ptr();
const VkSubpassDescription *subpass_desc = &render_pass_info->pSubpasses[pCB->activeSubpass];
uint32_t i;
-
- const safe_VkPipelineColorBlendStateCreateInfo *color_blend_state = pPipeline->graphicsPipelineCI.pColorBlendState;
- if ((color_blend_state != NULL) && (pCB->activeSubpass == pPipeline->graphicsPipelineCI.subpass) &&
- (color_blend_state->attachmentCount != subpass_desc->colorAttachmentCount)) {
- skip_call |=
- log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
- reinterpret_cast<const uint64_t &>(pPipeline->pipeline), __LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS",
- "Render pass subpass %u mismatch with blending state defined and blend state attachment "
- "count %u while subpass color attachment count %u in Pipeline (0x%" PRIxLEAST64
- ")! These "
- "must be the same at draw-time.",
- pCB->activeSubpass, color_blend_state->attachmentCount, subpass_desc->colorAttachmentCount,
- reinterpret_cast<const uint64_t &>(pPipeline->pipeline));
- }
-
unsigned subpass_num_samples = 0;
for (i = 0; i < subpass_desc->colorAttachmentCount; i++) {
@@ -3132,6 +3117,19 @@ static bool verifyPipelineCreateState(layer_data *my_data, std::vector<PIPELINE_
}
if (pPipeline->graphicsPipelineCI.pColorBlendState != NULL) {
+ const safe_VkPipelineColorBlendStateCreateInfo *color_blend_state = pPipeline->graphicsPipelineCI.pColorBlendState;
+ auto const render_pass_info = getRenderPassState(my_data, pPipeline->graphicsPipelineCI.renderPass)->createInfo.ptr();
+ const VkSubpassDescription *subpass_desc = &render_pass_info->pSubpasses[pPipeline->graphicsPipelineCI.subpass];
+ if (color_blend_state->attachmentCount != subpass_desc->colorAttachmentCount) {
+ skip_call |= log_msg(
+ my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT,
+ reinterpret_cast<const uint64_t &>(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_02109, "DS",
+ "vkCreateGraphicsPipelines(): Render pass (0x%" PRIxLEAST64
+ ") subpass %u has colorAttachmentCount of %u which doesn't match the pColorBlendState->attachmentCount of %u. %s",
+ reinterpret_cast<const uint64_t &>(pPipeline->graphicsPipelineCI.renderPass), pPipeline->graphicsPipelineCI.subpass,
+ subpass_desc->colorAttachmentCount, color_blend_state->attachmentCount,
+ validation_error_map[VALIDATION_ERROR_02109]);
+ }
if (!my_data->enabled_features.independentBlend) {
if (pPipeline->attachments.size() > 1) {
VkPipelineColorBlendAttachmentState *pAttachments = &pPipeline->attachments[0];