From f365d0ba03d87ae7f969e3d4f119e41415b4673a Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Wed, 3 Aug 2016 09:59:17 -0600 Subject: layers: Check vtx buffer binding Need to check vtx buffer binding based on binding values set in pVertexBindingDescriptions array if present. --- layers/core_validation.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 6a07f71b..7ef5c9c8 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -2873,13 +2873,16 @@ static bool validatePipelineDrawtimeState(layer_data const *my_data, // Verify Vtx binding if (pPipeline->vertexBindingDescriptions.size() > 0) { for (size_t i = 0; i < pPipeline->vertexBindingDescriptions.size(); i++) { - if ((pCB->currentDrawData.buffers.size() < (i + 1)) || (pCB->currentDrawData.buffers[i] == VK_NULL_HANDLE)) { - skip_call |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, - __LINE__, DRAWSTATE_VTX_INDEX_OUT_OF_BOUNDS, "DS", - "The Pipeline State Object (0x%" PRIxLEAST64 - ") expects that this Command Buffer's vertex binding Index " PRINTF_SIZE_T_SPECIFIER - " should be set via vkCmdBindVertexBuffers.", - (uint64_t)state.pipeline, i); + auto vertex_binding = pPipeline->vertexBindingDescriptions[i].binding; + if ((pCB->currentDrawData.buffers.size() < (vertex_binding + 1)) || + (pCB->currentDrawData.buffers[vertex_binding] == VK_NULL_HANDLE)) { + skip_call |= log_msg( + my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT)0, 0, __LINE__, + DRAWSTATE_VTX_INDEX_OUT_OF_BOUNDS, "DS", + "The Pipeline State Object (0x%" PRIxLEAST64 ") expects that this Command Buffer's vertex binding Index %u " + "should be set via vkCmdBindVertexBuffers. This is because VkVertexInputBindingDescription struct " + "at index " PRINTF_SIZE_T_SPECIFIER " of pVertexBindingDescriptions has a binding value of %u.", + (uint64_t)state.pipeline, vertex_binding, i, vertex_binding); } } } else { -- cgit v1.2.3