diff options
| author | Tobin Ehlis <tobine@google.com> | 2016-04-14 15:44:20 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-04-14 16:21:21 -0600 |
| commit | fc722c35c09f7231d7d0099ca57c1c8bcf4622d0 (patch) | |
| tree | 509b3a171f0f0d0eb6bf523246fe35a60ed6473f | |
| parent | 592b8136eb63ef922d28897378bb03c6060f47a6 (diff) | |
| download | usermoji-fc722c35c09f7231d7d0099ca57c1c8bcf4622d0.tar.xz | |
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.
| -rw-r--r-- | layers/core_validation.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
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 |
