aboutsummaryrefslogtreecommitdiff
path: root/layers
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2017-06-19 17:03:01 -0700
committerChris Forbes <chrisf@ijw.co.nz>2017-06-20 10:41:20 -0700
commit1826cd929ccf4e92f0cf24bb3c030ccfe8432d25 (patch)
treeca8b016c8d8e109c1eec5378050df2084be543a5 /layers
parent8642911db6c4445dafb81002eecefeb46fd9ff58 (diff)
downloadusermoji-1826cd929ccf4e92f0cf24bb3c030ccfe8432d25.tar.xz
layers: Move pipeline renderpass/subpass validation earlier
Diffstat (limited to 'layers')
-rw-r--r--layers/core_validation.cpp26
1 files 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::vector<PIPELINE
}
}
+ // Ensure the subpass index is valid. If not, then validate_and_capture_pipeline_shader_state
+ // produces nonsense errors that confuse users. Other layers should already
+ // emit errors for renderpass being invalid.
+ auto renderPass = GetRenderPassState(dev_data, pPipeline->graphicsPipelineCI.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::vector<PIPELINE
}
}
- // Ensure the subpass index is valid. If not, then validate_and_capture_pipeline_shader_state
- // produces nonsense errors that confuse users. Other layers should already
- // emit errors for renderpass being invalid.
- auto renderPass = GetRenderPassState(dev_data, pPipeline->graphicsPipelineCI.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;
}