From 1826cd929ccf4e92f0cf24bb3c030ccfe8432d25 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Mon, 19 Jun 2017 17:03:01 -0700 Subject: layers: Move pipeline renderpass/subpass validation earlier --- layers/core_validation.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 075e5f7f..a1670504 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -1215,6 +1215,19 @@ static bool verifyPipelineCreateState(layer_data *dev_data, std::vectorgraphicsPipelineCI.renderPass); + if (renderPass && pPipeline->graphicsPipelineCI.subpass >= renderPass->createInfo.subpassCount) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, + HandleToUint64(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_096005ee, "DS", + "Invalid Pipeline CreateInfo State: Subpass index %u " + "is out of range for this renderpass (0..%u). %s", + pPipeline->graphicsPipelineCI.subpass, renderPass->createInfo.subpassCount - 1, + validation_error_map[VALIDATION_ERROR_096005ee]); + } + if (pPipeline->graphicsPipelineCI.pColorBlendState != NULL) { const safe_VkPipelineColorBlendStateCreateInfo *color_blend_state = pPipeline->graphicsPipelineCI.pColorBlendState; auto const render_pass_info = GetRenderPassState(dev_data, pPipeline->graphicsPipelineCI.renderPass)->createInfo.ptr(); @@ -1258,19 +1271,6 @@ static bool verifyPipelineCreateState(layer_data *dev_data, std::vectorgraphicsPipelineCI.renderPass); - if (renderPass && pPipeline->graphicsPipelineCI.subpass >= renderPass->createInfo.subpassCount) { - skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT, - HandleToUint64(pPipeline->pipeline), __LINE__, VALIDATION_ERROR_096005ee, "DS", - "Invalid Pipeline CreateInfo State: Subpass index %u " - "is out of range for this renderpass (0..%u). %s", - pPipeline->graphicsPipelineCI.subpass, renderPass->createInfo.subpassCount - 1, - validation_error_map[VALIDATION_ERROR_096005ee]); - } - if (validate_and_capture_pipeline_shader_state(dev_data, pPipeline)) { skip = true; } -- cgit v1.2.3