diff options
| author | Tobin Ehlis <tobine@google.com> | 2016-08-03 09:59:17 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-08-03 18:25:12 -0600 |
| commit | f365d0ba03d87ae7f969e3d4f119e41415b4673a (patch) | |
| tree | 05255a0db09b3a25db405bece30a44536bdc23b3 /layers/core_validation.cpp | |
| parent | 3b55a124a521a5e61f136f8a8c6db59e792efc57 (diff) | |
| download | usermoji-f365d0ba03d87ae7f969e3d4f119e41415b4673a.tar.xz | |
layers: Check vtx buffer binding
Need to check vtx buffer binding based on binding values set in
pVertexBindingDescriptions array if present.
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
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 { |
