pCB->imageLayoutMap.clear();
pCB->drawData.clear();
pCB->currentDrawData.buffers.clear();
+ pCB->primaryCommandBuffer = VK_NULL_HANDLE;
pCB->secondaryCommandBuffers.clear();
pCB->dynamicOffsets.clear();
}
dev_data, dev_data->commandBufferMap[secondaryCmdBuffer]);
GLOBAL_CB_NODE* pSubCB = getCBNode(dev_data, secondaryCmdBuffer);
skipCall |= validateCommandBufferSimultaneousUse(dev_data, pSubCB);
+ if (pSubCB->primaryCommandBuffer != pCB->commandBuffer) {
+ 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 submitted with secondary buffer %#" PRIxLEAST64
+ " but that buffer has subsequently been bound to "
+ "primary cmd buffer %#" PRIxLEAST64 ".",
+ reinterpret_cast<uint64_t>(pCB->commandBuffer),
+ reinterpret_cast<uint64_t>(secondaryCmdBuffer),
+ reinterpret_cast<uint64_t>(
+ pSubCB->primaryCommandBuffer));
+ }
}
}
if ((pCB->beginInfo.flags & VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT) &&
pCB->beginInfo.flags &= ~VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT;
}
}
+ pSubCB->primaryCommandBuffer = pCB->commandBuffer;
pCB->secondaryCommandBuffers.insert(pSubCB->commandBuffer);
dev_data->globalInFlightCmdBuffers.insert(pSubCB->commandBuffer);
}
unordered_map<VkImage, IMAGE_CMD_BUF_NODE> imageLayoutMap;
vector<DRAW_DATA> drawData;
DRAW_DATA currentDrawData;
- // If cmd buffer is primary, track secondary command buffers pending execution
+ VkCommandBuffer primaryCommandBuffer;
+ // If cmd buffer is primary, track secondary command buffers pending
+ // execution
std::unordered_set<VkCommandBuffer> secondaryCommandBuffers;
vector<uint32_t> dynamicOffsets; // one dynamic offset per dynamic descriptor bound to this CB
} GLOBAL_CB_NODE;