aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Hayes <jeremy@lunarg.com>2017-05-04 18:10:28 -0600
committerJeremy Hayes <jeremy-lunarg@users.noreply.github.com>2017-05-05 15:43:46 -0600
commit814c8c8c7df490e55a91c597702bfca4447a4070 (patch)
tree433e698839c0b79c322d55abaf5537f2170f9960
parentd24613355c7a0a9e5b49a5bc29d5d5cd67af76d3 (diff)
downloadusermoji-814c8c8c7df490e55a91c597702bfca4447a4070.tar.xz
layers: Add VkVertexInputAttributeDescription VUs
Also fix GH#1709. Change-Id: I62394dc34cb92aa4308eb84cf7a0d62403e7a9e7
-rw-r--r--layers/parameter_validation.cpp33
-rw-r--r--layers/vk_validation_error_database.txt6
2 files changed, 36 insertions, 3 deletions
diff --git a/layers/parameter_validation.cpp b/layers/parameter_validation.cpp
index 991e2488..19912167 100644
--- a/layers/parameter_validation.cpp
+++ b/layers/parameter_validation.cpp
@@ -2945,6 +2945,39 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateGraphicsPipelines(VkDevice device, VkPipeli
validation_error_map[VALIDATION_ERROR_01408]);
}
}
+
+ for (uint32_t d = 0; d < vertex_input_state->vertexAttributeDescriptionCount; ++d) {
+ auto const &vertex_attrib_desc = vertex_input_state->pVertexAttributeDescriptions[d];
+ if (vertex_attrib_desc.location >= device_data->device_limits.maxVertexInputAttributes) {
+ skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_01410, LayerName,
+ "vkCreateGraphicsPipelines: parameter "
+ "pCreateInfos[%u].pVertexInputState->pVertexAttributeDescriptions[%u].location (%u) is "
+ "greater than or equal to VkPhysicalDeviceLimits::maxVertexInputAttributes (%u). %s",
+ i, d, vertex_attrib_desc.location, device_data->device_limits.maxVertexInputAttributes,
+ validation_error_map[VALIDATION_ERROR_01410]);
+ }
+
+ if (vertex_attrib_desc.binding >= device_data->device_limits.maxVertexInputBindings) {
+ skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_01411, LayerName,
+ "vkCreateGraphicsPipelines: parameter "
+ "pCreateInfos[%u].pVertexInputState->pVertexAttributeDescriptions[%u].binding (%u) is "
+ "greater than or equal to VkPhysicalDeviceLimits::maxVertexInputBindings (%u). %s",
+ i, d, vertex_attrib_desc.binding, device_data->device_limits.maxVertexInputBindings,
+ validation_error_map[VALIDATION_ERROR_01411]);
+ }
+
+ if (vertex_attrib_desc.offset > device_data->device_limits.maxVertexInputAttributeOffset) {
+ skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_01412, LayerName,
+ "vkCreateGraphicsPipelines: parameter "
+ "pCreateInfos[%u].pVertexInputState->pVertexAttributeDescriptions[%u].offset (%u) is "
+ "greater than VkPhysicalDeviceLimits::maxVertexInputAttributeOffset (%u). %s",
+ i, d, vertex_attrib_desc.offset, device_data->device_limits.maxVertexInputAttributeOffset,
+ validation_error_map[VALIDATION_ERROR_01412]);
+ }
+ }
}
if (pCreateInfos[i].pStages != nullptr) {
diff --git a/layers/vk_validation_error_database.txt b/layers/vk_validation_error_database.txt
index 51414113..62ca1580 100644
--- a/layers/vk_validation_error_database.txt
+++ b/layers/vk_validation_error_database.txt
@@ -1355,9 +1355,9 @@ VALIDATION_ERROR_01406~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~For mo
VALIDATION_ERROR_01407~^~Y~^~VALIDATION_ERROR_01407~^~vkCmdDrawIndexedIndirectCountAMD~^~For more information refer to Vulkan Spec Section '20.2. Vertex Input Description' which states 'binding must be less than VkPhysicalDeviceLimits::maxVertexInputBindings' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkVertexInputRate)~^~
VALIDATION_ERROR_01408~^~Y~^~VALIDATION_ERROR_01408~^~vkCmdDrawIndexedIndirectCountAMD~^~For more information refer to Vulkan Spec Section '20.2. Vertex Input Description' which states 'stride must be less than or equal to VkPhysicalDeviceLimits::maxVertexInputBindingStride' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkVertexInputRate)~^~
VALIDATION_ERROR_01409~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~For more information refer to Vulkan Spec Section '20.2. Vertex Input Description' which states 'inputRate must be a valid VkVertexInputRate value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkVertexInputRate)~^~implicit
-VALIDATION_ERROR_01410~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~For more information refer to Vulkan Spec Section '20.2. Vertex Input Description' which states 'location must be less than VkPhysicalDeviceLimits::maxVertexInputAttributes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkVertexInputAttributeDescription)~^~
-VALIDATION_ERROR_01411~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~For more information refer to Vulkan Spec Section '20.2. Vertex Input Description' which states 'binding must be less than VkPhysicalDeviceLimits::maxVertexInputBindings' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkVertexInputAttributeDescription)~^~
-VALIDATION_ERROR_01412~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~For more information refer to Vulkan Spec Section '20.2. Vertex Input Description' which states 'offset must be less than or equal to VkPhysicalDeviceLimits::maxVertexInputAttributeOffset' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkVertexInputAttributeDescription)~^~
+VALIDATION_ERROR_01410~^~Y~^~VALIDATION_ERROR_01410~^~vkCmdDrawIndexedIndirectCountAMD~^~For more information refer to Vulkan Spec Section '20.2. Vertex Input Description' which states 'location must be less than VkPhysicalDeviceLimits::maxVertexInputAttributes' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkVertexInputAttributeDescription)~^~
+VALIDATION_ERROR_01411~^~Y~^~VALIDATION_ERROR_01411~^~vkCmdDrawIndexedIndirectCountAMD~^~For more information refer to Vulkan Spec Section '20.2. Vertex Input Description' which states 'binding must be less than VkPhysicalDeviceLimits::maxVertexInputBindings' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkVertexInputAttributeDescription)~^~
+VALIDATION_ERROR_01412~^~Y~^~VALIDATION_ERROR_01412~^~vkCmdDrawIndexedIndirectCountAMD~^~For more information refer to Vulkan Spec Section '20.2. Vertex Input Description' which states 'offset must be less than or equal to VkPhysicalDeviceLimits::maxVertexInputAttributeOffset' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkVertexInputAttributeDescription)~^~
VALIDATION_ERROR_01413~^~Y~^~CreatePipelineBadVertexAttributeFormat~^~vkCmdDrawIndexedIndirectCountAMD~^~For more information refer to Vulkan Spec Section '20.2. Vertex Input Description' which states 'format must be allowed as a vertex buffer format, as specified by the VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT flag in VkFormatProperties::bufferFeatures returned by vkGetPhysicalDeviceFormatProperties' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkVertexInputAttributeDescription)~^~
VALIDATION_ERROR_01414~^~N~^~Unknown~^~vkCmdDrawIndexedIndirectCountAMD~^~For more information refer to Vulkan Spec Section '20.2. Vertex Input Description' which states 'format must be a valid VkFormat value' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkVertexInputAttributeDescription)~^~implicit
VALIDATION_ERROR_01415~^~N~^~Unknown~^~vkCmdBindVertexBuffers~^~For more information refer to Vulkan Spec Section '20.2. Vertex Input Description' which states 'firstBinding must be less than VkPhysicalDeviceLimits::maxVertexInputBindings' (https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#vkCmdBindVertexBuffers)~^~