diff options
author | Piers Daniell <pdaniell@nvidia.com> | 2019-08-20 16:54:56 -0600 |
---|---|---|
committer | Mark Lobodzinski <mark@lunarg.com> | 2019-08-21 13:32:59 -0600 |
commit | e319e609bbde9511967d037a7028cf51a64b6f49 (patch) | |
tree | 53284a9b3ccac6a0158e5283e63fb58b5d433551 | |
parent | 5070e3e3d9e3f573bd1c038552a36f577604801c (diff) | |
download | vulkan-validation-layers-e319e609bbde9511967d037a7028cf51a64b6f49.tar.gz |
corechecks: Add VUs checking for indexTypeUint8
Change-Id: I0e2015c1eaa69452a5b69f05eb1be923f92dba33
-rw-r--r-- | layers/core_validation.cpp | 16 | ||||
-rw-r--r-- | layers/core_validation_types.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index a52bfcf73..174c5cb7d 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -2620,6 +2620,12 @@ void ValidationStateTracker::PostCallRecordCreateDevice(VkPhysicalDevice gpu, co 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 @@ bool CoreChecks::PreCallValidateCmdBindIndexBuffer(VkCommandBuffer commandBuffer "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 72dbdf23d..863c7645a 100644 --- a/layers/core_validation_types.h +++ b/layers/core_validation_types.h @@ -1563,6 +1563,7 @@ struct DeviceFeatures { 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 }; |