aboutsummaryrefslogtreecommitdiff
path: root/layers/core_validation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'layers/core_validation.cpp')
-rw-r--r--layers/core_validation.cpp18
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