Skip to content

Commit

Permalink
layers: Add VUID 06561, 06562
Browse files Browse the repository at this point in the history
Check for valid descriptor set layout handles at CreatePipelineLayout
time.
  • Loading branch information
ncesario-lunarg committed Apr 8, 2022
1 parent 711be93 commit db38b7a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions layers/parameter_validation_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1604,6 +1604,20 @@ bool StatelessValidation::manual_PreCallValidateCreatePipelineLayout(VkDevice de
pCreateInfo->setLayoutCount, device_limits.maxBoundDescriptorSets);
}

const bool has_independent_sets = (pCreateInfo->flags & VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT) != 0;
const bool graphics_pipeline_library = IsExtEnabled(device_extensions.vk_ext_graphics_pipeline_library);
const char *const valid_dsl_vuid = (!graphics_pipeline_library)
? "VUID-VkPipelineLayoutCreateInfo-pSetLayouts-06561"
: ((!has_independent_sets) ? "VUID-VkPipelineLayoutCreateInfo-flags-06562" : nullptr);
if (valid_dsl_vuid) {
for (uint32_t i = 0; i < pCreateInfo->setLayoutCount; ++i) {
if (!pCreateInfo->pSetLayouts[i]) {
skip |=
LogError(device, valid_dsl_vuid, "vkCreatePipelineLayout(): pSetLayouts[%" PRIu32 "] is VK_NULL_HANDLE.", i);
}
}
}

// Validate Push Constant ranges
for (uint32_t i = 0; i < pCreateInfo->pushConstantRangeCount; ++i) {
const uint32_t offset = pCreateInfo->pPushConstantRanges[i].offset;
Expand Down

0 comments on commit db38b7a

Please sign in to comment.