diff options
| author | Tobin Ehlis <tobine@google.com> | 2016-09-27 13:10:33 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-09-28 11:44:37 -0600 |
| commit | 6bf289a3252a9addb6631fda3dc1eaaf72d9bb25 (patch) | |
| tree | 7fb4b9ffcaac92205a98a7c968a1f6679946b792 | |
| parent | 40c868be929c891ba454ef66c3dc715dd164dafb (diff) | |
| download | usermoji-6bf289a3252a9addb6631fda3dc1eaaf72d9bb25.tar.xz | |
layers: Indicate correct source for validateCommandBufferState() error
Fixes #982
Instead of hard-coding vkQueueSubmit, take a parameter to clarify if the error
originates from vkQueueSubmit() or vkCmdExecuteCommands()
| -rw-r--r-- | layers/core_validation.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 509d7d77..020e5553 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -4852,7 +4852,7 @@ static bool validateCommandBufferSimultaneousUse(layer_data *dev_data, GLOBAL_CB return skip_call; } -static bool validateCommandBufferState(layer_data *dev_data, GLOBAL_CB_NODE *pCB) { +static bool validateCommandBufferState(layer_data *dev_data, GLOBAL_CB_NODE *pCB, const char *call_source) { bool skip_call = 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)) { @@ -4883,8 +4883,8 @@ static bool validateCommandBufferState(layer_data *dev_data, GLOBAL_CB_NODE *pCB skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, (uint64_t)(pCB->commandBuffer), __LINE__, DRAWSTATE_NO_END_COMMAND_BUFFER, "DS", - "You must call vkEndCommandBuffer() on CB 0x%" PRIxLEAST64 " before this call to vkQueueSubmit()!", - (uint64_t)(pCB->commandBuffer)); + "You must call vkEndCommandBuffer() on CB 0x%" PRIxLEAST64 " before this call to %s!", + reinterpret_cast<uint64_t &>(pCB->commandBuffer), call_source); } } return skip_call; @@ -4937,7 +4937,7 @@ static bool validatePrimaryCommandBufferState(layer_data *dev_data, GLOBAL_CB_NO } } - skip_call |= validateCommandBufferState(dev_data, pCB); + skip_call |= validateCommandBufferState(dev_data, pCB, "vkQueueSubmit()"); return skip_call; } @@ -10597,7 +10597,7 @@ CmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBuffersCount, } // TODO(mlentine): Move more logic into this method skip_call |= validateSecondaryCommandBufferState(dev_data, pCB, pSubCB); - skip_call |= validateCommandBufferState(dev_data, pSubCB); + skip_call |= validateCommandBufferState(dev_data, pSubCB, "vkCmdExecuteCommands()"); // Secondary cmdBuffers are considered pending execution starting w/ // being recorded if (!(pSubCB->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT)) { |
