Skip to content

Commit 99299bd

Browse files
layers: Improve 08008 message
1 parent b863a43 commit 99299bd

1 file changed

Lines changed: 22 additions & 13 deletions

File tree

layers/core_checks/cc_descriptor.cpp

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4126,36 +4126,45 @@ bool CoreChecks::PreCallValidateCreatePipelineLayout(VkDevice device, const VkPi
41264126

41274127
const Location create_info_loc = error_obj.location.dot(Field::pCreateInfo);
41284128
std::vector<std::shared_ptr<vvl::DescriptorSetLayout const>> set_layouts(pCreateInfo->setLayoutCount, nullptr);
4129-
uint32_t descriptor_buffer_set_count = 0;
4130-
uint32_t valid_set_count = 0;
41314129
uint32_t push_descriptor_set_found = pCreateInfo->setLayoutCount;
4130+
4131+
bool first_layout_is_descriptor_buffer = false;
4132+
uint32_t first_layout_index = vvl::kNoIndex32;
41324133
for (uint32_t i = 0; i < pCreateInfo->setLayoutCount; ++i) {
41334134
set_layouts[i] = Get<vvl::DescriptorSetLayout>(pCreateInfo->pSetLayouts[i]);
4134-
if (!set_layouts[i]) continue;
4135+
if (!set_layouts[i]) {
4136+
continue;
4137+
}
41354138

41364139
if (set_layouts[i]->IsPushDescriptor()) {
41374140
if (push_descriptor_set_found < pCreateInfo->setLayoutCount) {
4138-
skip |= LogError("VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00293", set_layouts[i]->VkHandle(),
4141+
const LogObjectList objlist(set_layouts[i]->VkHandle(), set_layouts[push_descriptor_set_found]->VkHandle());
4142+
skip |= LogError("VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00293", objlist,
41394143
create_info_loc.dot(Field::pSetLayouts, i),
41404144
"and pSetLayouts[%" PRIu32 "] both have push descriptor sets.", push_descriptor_set_found);
41414145
}
41424146
push_descriptor_set_found = i;
41434147
}
4144-
if (set_layouts[i]->GetCreateFlags() & VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT) {
4148+
const VkDescriptorSetLayoutCreateFlags dsl_flags = set_layouts[i]->GetCreateFlags();
4149+
if (dsl_flags & VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT) {
41454150
skip |= LogError("VUID-VkPipelineLayoutCreateInfo-pSetLayouts-04606", set_layouts[i]->VkHandle(),
41464151
create_info_loc.dot(Field::pSetLayouts, i),
41474152
"was created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT bit.");
41484153
}
4149-
++valid_set_count;
4150-
if (set_layouts[i]->GetCreateFlags() & VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT) {
4151-
++descriptor_buffer_set_count;
4154+
4155+
bool is_descriptor_buffer = (dsl_flags & VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT) != 0;
4156+
if (first_layout_index != vvl::kNoIndex32 && first_layout_is_descriptor_buffer != is_descriptor_buffer) {
4157+
const LogObjectList objlist(set_layouts[i]->VkHandle(), set_layouts[first_layout_index]->VkHandle());
4158+
skip |=
4159+
LogError("VUID-VkPipelineLayoutCreateInfo-pSetLayouts-08008", objlist, create_info_loc.dot(Field::pSetLayouts, i),
4160+
"%s created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT but pSetLayouts[%" PRIu32 "] %s.",
4161+
is_descriptor_buffer ? "was" : "was not", first_layout_index, is_descriptor_buffer ? "was not" : "was");
41524162
}
4153-
}
41544163

4155-
if ((descriptor_buffer_set_count != 0) && (valid_set_count != descriptor_buffer_set_count)) {
4156-
skip |= LogError("VUID-VkPipelineLayoutCreateInfo-pSetLayouts-08008", device, error_obj.location,
4157-
"All sets must be created with "
4158-
"VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT or none of them.");
4164+
if (first_layout_index == vvl::kNoIndex32) {
4165+
first_layout_index = i;
4166+
first_layout_is_descriptor_buffer = is_descriptor_buffer;
4167+
}
41594168
}
41604169

41614170
// Max descriptors by type, within a single pipeline stage

0 commit comments

Comments
 (0)