From 6bf289a3252a9addb6631fda3dc1eaaf72d9bb25 Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Tue, 27 Sep 2016 13:10:33 -0600 Subject: 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() --- layers/core_validation.cpp | 10 +++++----- 1 file 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(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)) { -- cgit v1.2.3