aboutsummaryrefslogtreecommitdiff
path: root/layers/parameter_validation.cpp
diff options
context:
space:
mode:
authorJeremy Hayes <jeremy@lunarg.com>2017-05-04 18:08:49 -0600
committerJeremy Hayes <jeremy-lunarg@users.noreply.github.com>2017-05-05 15:43:46 -0600
commitd24613355c7a0a9e5b49a5bc29d5d5cd67af76d3 (patch)
tree06a995e6c8ba641e4ffa2d2fa9489f1887861dfe /layers/parameter_validation.cpp
parentbc4a9e58c724cbe907cd098ea2110c5296e2f48e (diff)
downloadusermoji-d24613355c7a0a9e5b49a5bc29d5d5cd67af76d3.tar.xz
layers: Add VkVertexInputBindingDescription VUs
Change-Id: Id9cb603dce7a49b21f9f8252baef692b4f6787f7
Diffstat (limited to 'layers/parameter_validation.cpp')
-rw-r--r--layers/parameter_validation.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/layers/parameter_validation.cpp b/layers/parameter_validation.cpp
index c8bf83ea..991e2488 100644
--- a/layers/parameter_validation.cpp
+++ b/layers/parameter_validation.cpp
@@ -2921,6 +2921,32 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateGraphicsPipelines(VkDevice device, VkPipeli
if (pCreateInfos != nullptr) {
for (uint32_t i = 0; i < createInfoCount; ++i) {
// Validation for parameters excluded from the generated validation code due to a 'noautovalidity' tag in vk.xml
+ if (pCreateInfos[i].pVertexInputState != nullptr) {
+ auto const &vertex_input_state = pCreateInfos[i].pVertexInputState;
+ for (uint32_t d = 0; d < vertex_input_state->vertexBindingDescriptionCount; ++d) {
+ auto const &vertex_bind_desc = vertex_input_state->pVertexBindingDescriptions[d];
+ if (vertex_bind_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_01407, LayerName,
+ "vkCreateGraphicsPipelines: parameter "
+ "pCreateInfos[%u].pVertexInputState->pVertexBindingDescriptions[%u].binding (%u) is "
+ "greater than or equal to VkPhysicalDeviceLimits::maxVertexInputBindings (%u). %s",
+ i, d, vertex_bind_desc.binding, device_data->device_limits.maxVertexInputBindings,
+ validation_error_map[VALIDATION_ERROR_01407]);
+ }
+
+ if (vertex_bind_desc.stride >= device_data->device_limits.maxVertexInputBindingStride) {
+ skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0,
+ __LINE__, VALIDATION_ERROR_01408, LayerName,
+ "vkCreateGraphicsPipelines: parameter "
+ "pCreateInfos[%u].pVertexInputState->pVertexBindingDescriptions[%u].stride (%u) is greater "
+ "than VkPhysicalDeviceLimits::maxVertexInputBindingStride (%u). %s",
+ i, d, vertex_bind_desc.stride, device_data->device_limits.maxVertexInputBindingStride,
+ validation_error_map[VALIDATION_ERROR_01408]);
+ }
+ }
+ }
+
if (pCreateInfos[i].pStages != nullptr) {
bool has_control = false;
bool has_eval = false;