corechecks: Add VUs checking for indexTypeUint8
Change-Id: I0e2015c1eaa69452a5b69f05eb1be923f92dba33
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index a52bfcf..174c5cb 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -2620,6 +2620,12 @@
state_tracker->enabled_features.pipeline_exe_props_features = *pipeline_exe_props_features;
}
+ const auto *index_type_uint8_features =
+ lvl_find_in_chain<VkPhysicalDeviceIndexTypeUint8FeaturesEXT>(pCreateInfo->pNext);
+ if (index_type_uint8_features) {
+ state_tracker->enabled_features.index_type_uint8_features = *index_type_uint8_features;
+ }
+
// Store physical device properties and physical device mem limits into CoreChecks structs
DispatchGetPhysicalDeviceMemoryProperties(gpu, &state_tracker->phys_dev_mem_props);
DispatchGetPhysicalDeviceProperties(gpu, &state_tracker->phys_dev_props);
@@ -7762,6 +7768,16 @@
"vkCmdBindIndexBuffer() offset (0x%" PRIxLEAST64 ") does not fall on alignment (%s) boundary.", offset,
string_VkIndexType(indexType));
}
+ if (indexType == VK_INDEX_TYPE_NONE_NV) {
+ skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ HandleToUint64(commandBuffer), "VUID-vkCmdBindIndexBuffer-indexType-02507",
+ "vkCmdBindIndexBuffer() indexType must not be VK_INDEX_TYPE_NONE_NV.");
+ }
+ if (indexType == VK_INDEX_TYPE_UINT8_EXT && !enabled_features.index_type_uint8_features.indexTypeUint8) {
+ skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT,
+ HandleToUint64(commandBuffer), "VUID-vkCmdBindIndexBuffer-indexType-02765",
+ "vkCmdBindIndexBuffer() indexType is VK_INDEX_TYPE_UINT8_EXT but indexTypeUint8 feature is not enabled.");
+ }
return skip;
}
diff --git a/layers/core_validation_types.h b/layers/core_validation_types.h
index 72dbdf2..863c764 100644
--- a/layers/core_validation_types.h
+++ b/layers/core_validation_types.h
@@ -1563,6 +1563,7 @@
VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT texel_buffer_alignment_features;
VkPhysicalDeviceImagelessFramebufferFeaturesKHR imageless_framebuffer_features;
VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR pipeline_exe_props_features;
+ VkPhysicalDeviceIndexTypeUint8FeaturesEXT index_type_uint8_features;
};
enum RenderPassCreateVersion { RENDER_PASS_VERSION_1 = 0, RENDER_PASS_VERSION_2 = 1 };