From fc722c35c09f7231d7d0099ca57c1c8bcf4622d0 Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Thu, 14 Apr 2016 15:44:20 -0600 Subject: layers: Validate ONE_TIME_SUBMIT for secondary cmd buffers Previously were only validating *_ONE_TIME_SUBMIT_BIT for primary cmd buffers. After clarification on spec, moving the check so it will also hit secondary command buffers. --- layers/core_validation.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'layers') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index c1361214..31a6ccb9 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -5043,6 +5043,14 @@ static bool validateCommandBufferSimultaneousUse(layer_data *dev_data, GLOBAL_CB static bool validateCommandBufferState(layer_data *dev_data, GLOBAL_CB_NODE *pCB) { bool skipCall = false; + // Validate ONE_TIME_SUBMIT_BIT CB is not being submitted more than once + if ((pCB->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT) && (pCB->submitCount > 1)) { + skipCall |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, 0, + __LINE__, DRAWSTATE_COMMAND_BUFFER_SINGLE_SUBMIT_VIOLATION, "DS", + "CB %#" PRIxLEAST64 " was begun w/ VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT " + "set, but has been submitted %#" PRIxLEAST64 " times.", + (uint64_t)(pCB->commandBuffer), pCB->submitCount); + } // Validate that cmd buffers have been updated if (CB_RECORDED != pCB->state) { if (CB_INVALID == pCB->state) { @@ -5129,16 +5137,6 @@ static bool validatePrimaryCommandBufferState(layer_data *dev_data, GLOBAL_CB_NO } } } - // TODO : Verify if this also needs to be checked for secondary command - // buffers. If so, this block of code can move to - // validateCommandBufferState() function. vulkan GL106 filed to clarify - if ((pCB->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT) && (pCB->submitCount > 1)) { - skipCall |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, 0, - __LINE__, DRAWSTATE_COMMAND_BUFFER_SINGLE_SUBMIT_VIOLATION, "DS", - "CB %#" PRIxLEAST64 " was begun w/ VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT " - "set, but has been submitted %#" PRIxLEAST64 " times.", - (uint64_t)(pCB->commandBuffer), pCB->submitCount); - } skipCall |= validateCommandBufferState(dev_data, pCB); // If USAGE_SIMULTANEOUS_USE_BIT not set then CB cannot already be executing // on device -- cgit v1.2.3