void *data_key,
std::unordered_map<void *, layer_data *> &data_map);
-debug_report_data *mdd(void* object)
-{
- dispatch_key key = get_dispatch_key(object);
- layer_data *my_data = get_my_data_ptr(key, layer_data_map);
-#if DISPATCH_MAP_DEBUG
- fprintf(stderr, "MDD: map: %p, object: %p, key: %p, data: %p\n", &layer_data_map, object, key, my_data);
-#endif
- return my_data->report_data;
-}
-
-debug_report_data *mid(VkInstance object)
-{
- dispatch_key key = get_dispatch_key(object);
- layer_data *my_data = get_my_data_ptr(key, layer_data_map);
-#if DISPATCH_MAP_DEBUG
- fprintf(stderr, "MID: map: %p, object: %p, key: %p, data: %p\n", &layer_data_map, object, key, my_data);
-#endif
- return my_data->report_data;
-}
// Map actual TID to an index value and return that index
// This keeps TIDs in range from 0-MAX_TID and simplifies compares between runs
static uint32_t getTIDIndex() {
return VK_FALSE;
}
// Check object status for selected flag state
-static VkBool32 validate_status(GLOBAL_CB_NODE* pNode, CBStatusFlags enable_mask, CBStatusFlags status_mask, CBStatusFlags status_flag, VkFlags msg_flags, DRAW_STATE_ERROR error_code, const char* fail_msg)
+static VkBool32 validate_status(layer_data* my_data, GLOBAL_CB_NODE* pNode, CBStatusFlags enable_mask, CBStatusFlags status_mask, CBStatusFlags status_flag, VkFlags msg_flags, DRAW_STATE_ERROR error_code, const char* fail_msg)
{
// If non-zero enable mask is present, check it against status but if enable_mask
// is 0 then no enable required so we should always just check status
if ((!enable_mask) || (enable_mask & pNode->status)) {
if ((pNode->status & status_mask) != status_flag) {
// TODO : How to pass dispatchable objects as srcObject? Here src obj should be cmd buffer
- return log_msg(mdd(pNode->cmdBuffer), msg_flags, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, error_code, "DS",
+ return log_msg(my_data->report_data, msg_flags, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, error_code, "DS",
"CB object %#" PRIxLEAST64 ": %s", reinterpret_cast<uint64_t>(pNode->cmdBuffer), fail_msg);
}
}
return VK_FALSE;
}
// Validate state stored as flags at time of draw call
-static VkBool32 validate_draw_state_flags(GLOBAL_CB_NODE* pCB, VkBool32 indexedDraw) {
+static VkBool32 validate_draw_state_flags(layer_data* my_data, GLOBAL_CB_NODE* pCB, VkBool32 indexedDraw) {
VkBool32 result;
- result = validate_status(pCB, CBSTATUS_NONE, CBSTATUS_VIEWPORT_SET, CBSTATUS_VIEWPORT_SET, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_VIEWPORT_NOT_BOUND, "Dynamic viewport state not set for this command buffer");
- result |= validate_status(pCB, CBSTATUS_NONE, CBSTATUS_SCISSOR_SET, CBSTATUS_SCISSOR_SET, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_STENCIL_NOT_BOUND, "Dynamic scissor state not set for this command buffer");
- result |= validate_status(pCB, CBSTATUS_NONE, CBSTATUS_LINE_WIDTH_SET, CBSTATUS_LINE_WIDTH_SET, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_LINE_WIDTH_NOT_BOUND, "Dynamic line width state not set for this command buffer");
- result |= validate_status(pCB, CBSTATUS_NONE, CBSTATUS_DEPTH_BIAS_SET, CBSTATUS_DEPTH_BIAS_SET, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_DEPTH_BIAS_NOT_BOUND, "Dynamic depth bias state not set for this command buffer");
- result |= validate_status(pCB, CBSTATUS_COLOR_BLEND_WRITE_ENABLE, CBSTATUS_BLEND_SET, CBSTATUS_BLEND_SET, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_BLEND_NOT_BOUND, "Dynamic blend object state not set for this command buffer");
- result |= validate_status(pCB, CBSTATUS_DEPTH_WRITE_ENABLE, CBSTATUS_DEPTH_BOUNDS_SET, CBSTATUS_DEPTH_BOUNDS_SET, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_DEPTH_BOUNDS_NOT_BOUND, "Dynamic depth bounds state not set for this command buffer");
- result |= validate_status(pCB, CBSTATUS_STENCIL_TEST_ENABLE, CBSTATUS_STENCIL_READ_MASK_SET, CBSTATUS_STENCIL_READ_MASK_SET, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_STENCIL_NOT_BOUND, "Dynamic stencil read mask state not set for this command buffer");
- result |= validate_status(pCB, CBSTATUS_STENCIL_TEST_ENABLE, CBSTATUS_STENCIL_WRITE_MASK_SET, CBSTATUS_STENCIL_WRITE_MASK_SET, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_STENCIL_NOT_BOUND, "Dynamic stencil write mask state not set for this command buffer");
- result |= validate_status(pCB, CBSTATUS_STENCIL_TEST_ENABLE, CBSTATUS_STENCIL_REFERENCE_SET, CBSTATUS_STENCIL_REFERENCE_SET, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_STENCIL_NOT_BOUND, "Dynamic stencil reference state not set for this command buffer");
+ result = validate_status(my_data, pCB, CBSTATUS_NONE, CBSTATUS_VIEWPORT_SET, CBSTATUS_VIEWPORT_SET, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_VIEWPORT_NOT_BOUND, "Dynamic viewport state not set for this command buffer");
+ result |= validate_status(my_data, pCB, CBSTATUS_NONE, CBSTATUS_SCISSOR_SET, CBSTATUS_SCISSOR_SET, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_STENCIL_NOT_BOUND, "Dynamic scissor state not set for this command buffer");
+ result |= validate_status(my_data, pCB, CBSTATUS_NONE, CBSTATUS_LINE_WIDTH_SET, CBSTATUS_LINE_WIDTH_SET, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_LINE_WIDTH_NOT_BOUND, "Dynamic line width state not set for this command buffer");
+ result |= validate_status(my_data, pCB, CBSTATUS_NONE, CBSTATUS_DEPTH_BIAS_SET, CBSTATUS_DEPTH_BIAS_SET, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_DEPTH_BIAS_NOT_BOUND, "Dynamic depth bias state not set for this command buffer");
+ result |= validate_status(my_data, pCB, CBSTATUS_COLOR_BLEND_WRITE_ENABLE, CBSTATUS_BLEND_SET, CBSTATUS_BLEND_SET, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_BLEND_NOT_BOUND, "Dynamic blend object state not set for this command buffer");
+ result |= validate_status(my_data, pCB, CBSTATUS_DEPTH_WRITE_ENABLE, CBSTATUS_DEPTH_BOUNDS_SET, CBSTATUS_DEPTH_BOUNDS_SET, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_DEPTH_BOUNDS_NOT_BOUND, "Dynamic depth bounds state not set for this command buffer");
+ result |= validate_status(my_data, pCB, CBSTATUS_STENCIL_TEST_ENABLE, CBSTATUS_STENCIL_READ_MASK_SET, CBSTATUS_STENCIL_READ_MASK_SET, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_STENCIL_NOT_BOUND, "Dynamic stencil read mask state not set for this command buffer");
+ result |= validate_status(my_data, pCB, CBSTATUS_STENCIL_TEST_ENABLE, CBSTATUS_STENCIL_WRITE_MASK_SET, CBSTATUS_STENCIL_WRITE_MASK_SET, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_STENCIL_NOT_BOUND, "Dynamic stencil write mask state not set for this command buffer");
+ result |= validate_status(my_data, pCB, CBSTATUS_STENCIL_TEST_ENABLE, CBSTATUS_STENCIL_REFERENCE_SET, CBSTATUS_STENCIL_REFERENCE_SET, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_STENCIL_NOT_BOUND, "Dynamic stencil reference state not set for this command buffer");
if (indexedDraw)
- result |= validate_status(pCB, CBSTATUS_NONE, CBSTATUS_INDEX_BUFFER_BOUND, CBSTATUS_INDEX_BUFFER_BOUND, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_INDEX_BUFFER_NOT_BOUND, "Index buffer object not bound to this command buffer when Indexed Draw attempted");
+ result |= validate_status(my_data, pCB, CBSTATUS_NONE, CBSTATUS_INDEX_BUFFER_BOUND, CBSTATUS_INDEX_BUFFER_BOUND, VK_DBG_REPORT_ERROR_BIT, DRAWSTATE_INDEX_BUFFER_NOT_BOUND, "Index buffer object not bound to this command buffer when Indexed Draw attempted");
return result;
}
// Validate overall state at the time of a draw call
static VkBool32 validate_draw_state(layer_data* my_data, GLOBAL_CB_NODE* pCB, VkBool32 indexedDraw) {
// First check flag states
- VkBool32 result = validate_draw_state_flags(pCB, indexedDraw);
+ VkBool32 result = validate_draw_state_flags(my_data, pCB, indexedDraw);
PIPELINE_NODE* pPipe = getPipeline(my_data, pCB->lastBoundPipeline);
// Now complete other state checks
// TODO : Currently only performing next check if *something* was bound (non-zero last bound)
// We should have that check separately and then gate this check based on that check
if (pPipe && (pCB->lastBoundPipelineLayout) && (pCB->lastBoundPipelineLayout != pPipe->graphicsPipelineCI.layout)) {
result = VK_FALSE;
- result |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_PIPELINE_LAYOUT, pCB->lastBoundPipelineLayout.handle, 0, DRAWSTATE_PIPELINE_LAYOUT_MISMATCH, "DS",
+ result |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_PIPELINE_LAYOUT, pCB->lastBoundPipelineLayout.handle, 0, DRAWSTATE_PIPELINE_LAYOUT_MISMATCH, "DS",
"Pipeline layout from last vkCmdBindDescriptorSets() (%#" PRIxLEAST64 ") does not match PSO Pipeline layout (%#" PRIxLEAST64 ") ", pCB->lastBoundPipelineLayout.handle, pPipe->graphicsPipelineCI.layout.handle);
}
// Verify Vtx binding
if (MAX_BINDING != pCB->lastVtxBinding) {
if (pCB->lastVtxBinding >= pPipe->vtxBindingCount) {
if (0 == pPipe->vtxBindingCount) {
- result |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_VTX_INDEX_OUT_OF_BOUNDS, "DS",
+ result |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_VTX_INDEX_OUT_OF_BOUNDS, "DS",
"Vtx Buffer Index %u was bound, but no vtx buffers are attached to PSO.", pCB->lastVtxBinding);
}
else {
- result |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_VTX_INDEX_OUT_OF_BOUNDS, "DS",
+ result |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_VTX_INDEX_OUT_OF_BOUNDS, "DS",
"Vtx binding Index of %u exceeds PSO pVertexBindingDescriptions max array index of %u.", pCB->lastVtxBinding, (pPipe->vtxBindingCount - 1));
}
}
VkBool32 dynScissor = isDynamic(pPipe, VK_DYNAMIC_STATE_SCISSOR);
if (dynViewport) {
if (pCB->viewports.size() != pPipe->graphicsPipelineCI.pViewportState->viewportCount) {
- result |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS",
+ result |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS",
"Dynamic viewportCount from vkCmdSetViewport() is %u, but PSO viewportCount is %u. These counts must match.", pCB->viewports.size(), pPipe->graphicsPipelineCI.pViewportState->viewportCount);
}
}
if (dynScissor) {
if (pCB->scissors.size() != pPipe->graphicsPipelineCI.pViewportState->scissorCount) {
- result |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS",
+ result |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS",
"Dynamic scissorCount from vkCmdSetScissor() is %u, but PSO scissorCount is %u. These counts must match.", pCB->scissors.size(), pPipe->graphicsPipelineCI.pViewportState->scissorCount);
}
}
return result;
}
// Verify that create state for a pipeline is valid
-static VkBool32 verifyPipelineCreateState(const VkDevice device, const PIPELINE_NODE* pPipeline)
+static VkBool32 verifyPipelineCreateState(layer_data* my_data, const VkDevice device, const PIPELINE_NODE* pPipeline)
{
VkBool32 skipCall = VK_FALSE;
// VS is required
if (!(pPipeline->active_shaders & VK_SHADER_STAGE_VERTEX_BIT)) {
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS",
"Invalid Pipeline CreateInfo State: Vtx Shader required");
}
// Either both or neither TC/TE shaders should be defined
if (((pPipeline->active_shaders & VK_SHADER_STAGE_TESS_CONTROL_BIT) == 0) !=
((pPipeline->active_shaders & VK_SHADER_STAGE_TESS_EVALUATION_BIT) == 0) ) {
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS",
"Invalid Pipeline CreateInfo State: TE and TC shaders must be included or excluded as a pair");
}
// Compute shaders should be specified independent of Gfx shaders
(pPipeline->active_shaders & (VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_TESS_CONTROL_BIT |
VK_SHADER_STAGE_TESS_EVALUATION_BIT | VK_SHADER_STAGE_GEOMETRY_BIT |
VK_SHADER_STAGE_FRAGMENT_BIT))) {
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS",
"Invalid Pipeline CreateInfo State: Do not specify Compute Shader for Gfx Pipeline");
}
// VK_PRIMITIVE_TOPOLOGY_PATCH primitive topology is only valid for tessellation pipelines.
// Mismatching primitive topology and tessellation fails graphics pipeline creation.
if (pPipeline->active_shaders & (VK_SHADER_STAGE_TESS_CONTROL_BIT | VK_SHADER_STAGE_TESS_EVALUATION_BIT) &&
(pPipeline->iaStateCI.topology != VK_PRIMITIVE_TOPOLOGY_PATCH)) {
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS",
"Invalid Pipeline CreateInfo State: VK_PRIMITIVE_TOPOLOGY_PATCH must be set as IA topology for tessellation pipelines");
}
if (pPipeline->iaStateCI.topology == VK_PRIMITIVE_TOPOLOGY_PATCH) {
if (~pPipeline->active_shaders & VK_SHADER_STAGE_TESS_CONTROL_BIT) {
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS",
"Invalid Pipeline CreateInfo State: VK_PRIMITIVE_TOPOLOGY_PATCH primitive topology is only valid for tessellation pipelines");
}
if (!pPipeline->tessStateCI.patchControlPoints || (pPipeline->tessStateCI.patchControlPoints > 32)) {
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_PIPELINE_CREATE_STATE, "DS",
"Invalid Pipeline CreateInfo State: VK_PRIMITIVE_TOPOLOGY_PATCH primitive topology used with patchControlPoints value %u."
" patchControlPoints should be >0 and <=32.", pPipeline->tessStateCI.patchControlPoints);
}
// Viewport state must be included and viewport and scissor counts should always match
// NOTE : Even if these are flagged as dynamic, counts need to be set correctly for shader compiler
if (!pPipeline->graphicsPipelineCI.pViewportState) {
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS",
"Gfx Pipeline pViewportState is null. Even if viewport and scissors are dynamic PSO must include viewportCount and scissorCount in pViewportState.");
} else if (pPipeline->graphicsPipelineCI.pViewportState->scissorCount != pPipeline->graphicsPipelineCI.pViewportState->viewportCount) {
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS",
"Gfx Pipeline viewport count (%u) must match scissor count (%u).", pPipeline->vpStateCI.viewportCount, pPipeline->vpStateCI.scissorCount);
} else {
// If viewport or scissor are not dynamic, then verify that data is appropriate for count
VkBool32 dynScissor = isDynamic(pPipeline, VK_DYNAMIC_STATE_SCISSOR);
if (!dynViewport) {
if (pPipeline->graphicsPipelineCI.pViewportState->viewportCount && !pPipeline->graphicsPipelineCI.pViewportState->pViewports) {
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS",
"Gfx Pipeline viewportCount is %u, but pViewports is NULL. For non-zero viewportCount, you must either include pViewports data, or include viewport in pDynamicState and set it with vkCmdSetViewport().", pPipeline->graphicsPipelineCI.pViewportState->viewportCount);
}
}
if (!dynScissor) {
if (pPipeline->graphicsPipelineCI.pViewportState->scissorCount && !pPipeline->graphicsPipelineCI.pViewportState->pScissors) {
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_VIEWPORT_SCISSOR_MISMATCH, "DS",
"Gfx Pipeline scissorCount is %u, but pScissors is NULL. For non-zero scissorCount, you must either include pScissors data, or include scissor in pDynamicState and set it with vkCmdSetScissor().", pPipeline->graphicsPipelineCI.pViewportState->scissorCount);
}
}
}
if (psoNumSamples != subpassNumSamples) {
- return log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_PIPELINE, pipeline.handle, 0, DRAWSTATE_NUM_SAMPLES_MISMATCH, "DS",
+ return log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_PIPELINE, pipeline.handle, 0, DRAWSTATE_NUM_SAMPLES_MISMATCH, "DS",
"Num samples mismatch! Binding PSO (%#" PRIxLEAST64 ") with %u samples while current RenderPass (%#" PRIxLEAST64 ") w/ %u samples!",
pipeline.handle, psoNumSamples, pCB->activeRenderPass.handle, subpassNumSamples);
}
return my_data->layoutMap[layout.handle];
}
// Return VK_FALSE if update struct is of valid type, otherwise flag error and return code from callback
-static VkBool32 validUpdateStruct(const VkDevice device, const GENERIC_HEADER* pUpdateStruct)
+static VkBool32 validUpdateStruct(layer_data* my_data, const VkDevice device, const GENERIC_HEADER* pUpdateStruct)
{
switch (pUpdateStruct->sType)
{
case VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET:
return VK_FALSE;
default:
- return log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_UPDATE_STRUCT, "DS",
+ return log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_UPDATE_STRUCT, "DS",
"Unexpected UPDATE struct of type %s (value %u) in vkUpdateDescriptors() struct tree", string_VkStructureType(pUpdateStruct->sType), pUpdateStruct->sType);
}
}
// For given update struct, return binding
-static VkBool32 getUpdateBinding(const VkDevice device, const GENERIC_HEADER* pUpdateStruct, uint32_t* binding)
+static VkBool32 getUpdateBinding(layer_data* my_data, const VkDevice device, const GENERIC_HEADER* pUpdateStruct, uint32_t* binding)
{
VkBool32 skipCall = VK_FALSE;
switch (pUpdateStruct->sType)
*binding = ((VkCopyDescriptorSet*)pUpdateStruct)->destBinding;
break;
default:
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_UPDATE_STRUCT, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_UPDATE_STRUCT, "DS",
"Unexpected UPDATE struct of type %s (value %u) in vkUpdateDescriptors() struct tree", string_VkStructureType(pUpdateStruct->sType), pUpdateStruct->sType);
*binding = 0xFFFFFFFF;
}
}
// Set arrayIndex for given update struct in the last parameter
// Return value of skipCall, which is only VK_TRUE is error occurs and callback signals execution to cease
-static uint32_t getUpdateArrayIndex(const VkDevice device, const GENERIC_HEADER* pUpdateStruct, uint32_t* arrayIndex)
+static uint32_t getUpdateArrayIndex(layer_data* my_data, const VkDevice device, const GENERIC_HEADER* pUpdateStruct, uint32_t* arrayIndex)
{
VkBool32 skipCall = VK_FALSE;
switch (pUpdateStruct->sType)
*arrayIndex = ((VkCopyDescriptorSet*)pUpdateStruct)->destArrayElement;
break;
default:
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_UPDATE_STRUCT, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_UPDATE_STRUCT, "DS",
"Unexpected UPDATE struct of type %s (value %u) in vkUpdateDescriptors() struct tree", string_VkStructureType(pUpdateStruct->sType), pUpdateStruct->sType);
*arrayIndex = 0;
}
}
// Set count for given update struct in the last parameter
// Return value of skipCall, which is only VK_TRUE is error occurs and callback signals execution to cease
-static uint32_t getUpdateCount(const VkDevice device, const GENERIC_HEADER* pUpdateStruct, uint32_t* count)
+static uint32_t getUpdateCount(layer_data* my_data, const VkDevice device, const GENERIC_HEADER* pUpdateStruct, uint32_t* count)
{
VkBool32 skipCall = VK_FALSE;
switch (pUpdateStruct->sType)
*count = ((VkCopyDescriptorSet*)pUpdateStruct)->count;
break;
default:
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_UPDATE_STRUCT, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_UPDATE_STRUCT, "DS",
"Unexpected UPDATE struct of type %s (value %u) in vkUpdateDescriptors() struct tree", string_VkStructureType(pUpdateStruct->sType), pUpdateStruct->sType);
*count = 0;
}
return offsetIndex-1;
}
// For given layout and update, return the first overall index of the layout that is update
-static VkBool32 getUpdateStartIndex(const VkDevice device, const LAYOUT_NODE* pLayout, const GENERIC_HEADER* pUpdateStruct, uint32_t* startIndex)
+static VkBool32 getUpdateStartIndex(layer_data* my_data, const VkDevice device, const LAYOUT_NODE* pLayout, const GENERIC_HEADER* pUpdateStruct, uint32_t* startIndex)
{
uint32_t binding = 0, arrayIndex = 0;
- VkBool32 skipCall = getUpdateBinding(device, pUpdateStruct, &binding);
- skipCall |= getUpdateArrayIndex(device, pUpdateStruct, &arrayIndex);
+ VkBool32 skipCall = getUpdateBinding(my_data, device, pUpdateStruct, &binding);
+ skipCall |= getUpdateArrayIndex(my_data, device, pUpdateStruct, &arrayIndex);
if (VK_FALSE == skipCall)
*startIndex = getBindingStartIndex(pLayout, binding)+arrayIndex;
return skipCall;
}
// For given layout and update, return the last overall index of the layout that is update
-static VkBool32 getUpdateEndIndex(const VkDevice device, const LAYOUT_NODE* pLayout, const GENERIC_HEADER* pUpdateStruct, uint32_t* endIndex)
+static VkBool32 getUpdateEndIndex(layer_data* my_data, const VkDevice device, const LAYOUT_NODE* pLayout, const GENERIC_HEADER* pUpdateStruct, uint32_t* endIndex)
{
uint32_t binding = 0, arrayIndex = 0, count = 0;
- VkBool32 skipCall = getUpdateBinding(device, pUpdateStruct, &binding);
- skipCall |= getUpdateArrayIndex(device, pUpdateStruct, &arrayIndex);
- skipCall |= getUpdateCount(device, pUpdateStruct, &count);
+ VkBool32 skipCall = getUpdateBinding(my_data, device, pUpdateStruct, &binding);
+ skipCall |= getUpdateArrayIndex(my_data, device, pUpdateStruct, &arrayIndex);
+ skipCall |= getUpdateCount(my_data, device, pUpdateStruct, &count);
if (VK_FALSE == skipCall)
*endIndex = getBindingStartIndex(pLayout, binding)+arrayIndex+count-1;
return skipCall;
}
// Verify that the descriptor type in the update struct matches what's expected by the layout
-static VkBool32 validateUpdateType(const VkDevice device, const LAYOUT_NODE* pLayout, const GENERIC_HEADER* pUpdateStruct)
+static VkBool32 validateUpdateType(layer_data* my_data, const VkDevice device, const LAYOUT_NODE* pLayout, const GENERIC_HEADER* pUpdateStruct)
{
// First get actual type of update
VkBool32 skipCall = VK_FALSE;
return VK_FALSE;
break;
default:
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_UPDATE_STRUCT, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_UPDATE_STRUCT, "DS",
"Unexpected UPDATE struct of type %s (value %u) in vkUpdateDescriptors() struct tree", string_VkStructureType(pUpdateStruct->sType), pUpdateStruct->sType);
}
- skipCall |= getUpdateStartIndex(device, pLayout, pUpdateStruct, &startIndex);
- skipCall |= getUpdateEndIndex(device, pLayout, pUpdateStruct, &endIndex);
+ skipCall |= getUpdateStartIndex(my_data, device, pLayout, pUpdateStruct, &startIndex);
+ skipCall |= getUpdateEndIndex(my_data, device, pLayout, pUpdateStruct, &endIndex);
if (VK_FALSE == skipCall) {
for (i = startIndex; i <= endIndex; i++) {
if (pLayout->descriptorTypes[i] != actualType) {
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_DESCRIPTOR_TYPE_MISMATCH, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_DESCRIPTOR_TYPE_MISMATCH, "DS",
"Descriptor update type of %s has descriptor type %s that does not match overlapping binding descriptor type of %s!",
string_VkStructureType(pUpdateStruct->sType), string_VkDescriptorType(actualType), string_VkDescriptorType(pLayout->descriptorTypes[i]));
}
// Determine the update type, allocate a new struct of that type, shadow the given pUpdate
// struct into the pNewNode param. Return VK_TRUE if error condition encountered and callback signals early exit.
// NOTE : Calls to this function should be wrapped in mutex
-static VkBool32 shadowUpdateNode(const VkDevice device, GENERIC_HEADER* pUpdate, GENERIC_HEADER** pNewNode)
+static VkBool32 shadowUpdateNode(layer_data* my_data, const VkDevice device, GENERIC_HEADER* pUpdate, GENERIC_HEADER** pNewNode)
{
VkBool32 skipCall = VK_FALSE;
VkWriteDescriptorSet* pWDS = NULL;
memcpy(pCDS, pUpdate, sizeof(VkCopyDescriptorSet));
break;
default:
- if (log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_UPDATE_STRUCT, "DS",
+ if (log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_UPDATE_STRUCT, "DS",
"Unexpected UPDATE struct of type %s (value %u) in vkUpdateDescriptors() struct tree", string_VkStructureType(pUpdate->sType), pUpdate->sType))
return VK_TRUE;
}
return skipCall;
}
-static VkBool32 validateDescriptorSetImageView(VkDevice device, uint32_t writeDsCount, const VkWriteDescriptorSet *pWDS)
+static VkBool32 validateDescriptorSetImageView(const layer_data* my_data, VkDevice device, uint32_t writeDsCount, const VkWriteDescriptorSet *pWDS)
{
VkBool32 skipCall = VK_FALSE;
layer_data *dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map);
VkImageAspectFlags flags = ((*imageViewItem).second)->subresourceRange.aspectMask;
if ((flags & VK_IMAGE_ASPECT_DEPTH_BIT) &&
(flags & VK_IMAGE_ASPECT_STENCIL_BIT)) {
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_IMAGE_VIEW, dInfo->imageView.handle, 0,
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_IMAGE_VIEW, dInfo->imageView.handle, 0,
DRAWSTATE_INVALID_IMAGE_ASPECT, "DS", "vkUpdateDescriptorSets: DesriptorSet[%d] in WriteDesriptorSet[%d] "
"has ImageView with both STENCIL and DEPTH aspects set", j, i);
}
if (type == VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET) {
pWDS = (const VkWriteDescriptorSet *)pUpdateArray;
- skipCall |= validateDescriptorSetImageView(device, updateCount, pWDS);
+ skipCall |= validateDescriptorSetImageView(my_data, device, updateCount, pWDS);
} else {
pCDS = (const VkCopyDescriptorSet *)pUpdateArray;
}
GENERIC_HEADER* pUpdate = (pWDS) ? (GENERIC_HEADER*) &pWDS[i] : (GENERIC_HEADER*) &pCDS[i];
pLayout = pSet->pLayout;
// First verify valid update struct
- if ((skipCall = validUpdateStruct(device, pUpdate)) == VK_TRUE) {
+ if ((skipCall = validUpdateStruct(my_data, device, pUpdate)) == VK_TRUE) {
break;
}
// Make sure that binding is within bounds
uint32_t binding = 0, endIndex = 0;
- skipCall |= getUpdateBinding(device, pUpdate, &binding);
+ skipCall |= getUpdateBinding(my_data, device, pUpdate, &binding);
if (pLayout->createInfo.count < binding) {
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, ds.handle, 0, DRAWSTATE_INVALID_UPDATE_INDEX, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, ds.handle, 0, DRAWSTATE_INVALID_UPDATE_INDEX, "DS",
"Descriptor Set %p does not have binding to match update binding %u for update type %s!", ds, binding, string_VkStructureType(pUpdate->sType));
} else {
// Next verify that update falls within size of given binding
- skipCall |= getUpdateBinding(device, pUpdate, &binding);
- skipCall |= getUpdateEndIndex(device, pLayout, pUpdate, &endIndex);
+ skipCall |= getUpdateBinding(my_data, device, pUpdate, &binding);
+ skipCall |= getUpdateEndIndex(my_data, device, pLayout, pUpdate, &endIndex);
if (getBindingEndIndex(pLayout, binding) < endIndex) {
// TODO : Keep count of layout CI structs and size this string dynamically based on that count
pLayoutCI = &pLayout->createInfo;
string DSstr = vk_print_vkdescriptorsetlayoutcreateinfo(pLayoutCI, "{DS} ");
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, ds.handle, 0, DRAWSTATE_DESCRIPTOR_UPDATE_OUT_OF_BOUNDS, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, ds.handle, 0, DRAWSTATE_DESCRIPTOR_UPDATE_OUT_OF_BOUNDS, "DS",
"Descriptor update type of %s is out of bounds for matching binding %u in Layout w/ CI:\n%s!", string_VkStructureType(pUpdate->sType), binding, DSstr.c_str());
} else { // TODO : should we skip update on a type mismatch or force it?
// Layout bindings match w/ update ok, now verify that update is of the right type
- if ((skipCall = validateUpdateType(device, pLayout, pUpdate)) == VK_FALSE) {
+ if ((skipCall = validateUpdateType(my_data, device, pLayout, pUpdate)) == VK_FALSE) {
// Save the update info
// TODO : Info message that update successful
// Create new update struct for this set's shadow copy
GENERIC_HEADER* pNewNode = NULL;
- skipCall |= shadowUpdateNode(device, pUpdate, &pNewNode);
+ skipCall |= shadowUpdateNode(my_data, device, pUpdate, &pNewNode);
if (NULL == pNewNode) {
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, ds.handle, 0, DRAWSTATE_OUT_OF_MEMORY, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, ds.handle, 0, DRAWSTATE_OUT_OF_MEMORY, "DS",
"Out of memory while attempting to allocate UPDATE struct in vkUpdateDescriptors()");
} else {
// Insert shadow node into LL of updates for this set
pNewNode->pNext = pSet->pUpdateStructs;
pSet->pUpdateStructs = pNewNode;
// Now update appropriate descriptor(s) to point to new Update node
- skipCall |= getUpdateEndIndex(device, pLayout, pUpdate, &endIndex);
+ skipCall |= getUpdateEndIndex(my_data, device, pLayout, pUpdate, &endIndex);
uint32_t startIndex;
- skipCall |= getUpdateStartIndex(device, pLayout, pUpdate, &startIndex);
+ skipCall |= getUpdateStartIndex(my_data, device, pLayout, pUpdate, &startIndex);
for (uint32_t j = startIndex; j <= endIndex; j++) {
assert(j<pSet->descriptorCount);
pSet->ppDescriptors[j] = pNewNode;
{
POOL_NODE* pPool = getPoolNode(my_data, pool);
if (!pPool) {
- log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_POOL, pool.handle, 0, DRAWSTATE_INVALID_POOL, "DS",
+ log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_POOL, pool.handle, 0, DRAWSTATE_INVALID_POOL, "DS",
"Unable to find pool node for pool %#" PRIxLEAST64 " specified in vkResetDescriptorPool() call", pool.handle);
} else {
// For every set off of this pool, clear it
if (my_data->cmdBufferMap.find(cb) == my_data->cmdBufferMap.end()) {
loader_platform_thread_unlock_mutex(&globalLock);
// TODO : How to pass cb as srcObj here?
- log_msg(mdd(cb), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_INVALID_CMD_BUFFER, "DS",
+ log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_INVALID_CMD_BUFFER, "DS",
"Attempt to use CmdBuffer %#" PRIxLEAST64 " that doesn't exist!", reinterpret_cast<uint64_t>(cb));
return NULL;
}
}
my_data->cmdBufferMap.clear();
}
-static VkBool32 report_error_no_cb_begin(const VkCmdBuffer cb, const char* caller_name)
+static VkBool32 report_error_no_cb_begin(const layer_data* dev_data, const VkCmdBuffer cb, const char* caller_name)
{
// TODO : How to pass cb as srcObj here?
- return log_msg(mdd(cb), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_NO_BEGIN_CMD_BUFFER, "DS",
+ return log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_NO_BEGIN_CMD_BUFFER, "DS",
"You must call vkBeginCommandBuffer() before this call to %s", (void*)caller_name);
}
-static VkBool32 addCmd(GLOBAL_CB_NODE* pCB, const CMD_TYPE cmd)
+static VkBool32 addCmd(const layer_data* my_data, GLOBAL_CB_NODE* pCB, const CMD_TYPE cmd)
{
VkBool32 skipCall = VK_FALSE;
CMD_NODE* pCmd = new CMD_NODE;
pCB->pCmds.push_back(pCmd);
} else {
// TODO : How to pass cb as srcObj here?
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_OUT_OF_MEMORY, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_OUT_OF_MEMORY, "DS",
"Out of memory while attempting to allocate new CMD_NODE for cmdBuffer %#" PRIxLEAST64, reinterpret_cast<uint64_t>(pCB->cmdBuffer));
}
return skipCall;
if (!pPipeTrav) {
// nothing to print
} else {
- skipCall |= log_msg(mdd(cb), VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
vk_print_vkgraphicspipelinecreateinfo(&pPipeTrav->graphicsPipelineCI, "{DS}").c_str());
}
}
SET_NODE* pSet = getSetNode(my_data, pCB->lastBoundDescriptorSet);
POOL_NODE* pPool = getPoolNode(my_data, pSet->pool);
// Print out pool details
- skipCall |= log_msg(mdd(cb), VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
"Details for pool %#" PRIxLEAST64 ".", pPool->pool.handle);
string poolStr = vk_print_vkdescriptorpoolcreateinfo(&pPool->createInfo, " ");
- skipCall |= log_msg(mdd(cb), VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
"%s", poolStr.c_str());
// Print out set details
char prefix[10];
uint32_t index = 0;
- skipCall |= log_msg(mdd(cb), VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
"Details for descriptor set %#" PRIxLEAST64 ".", pSet->set.handle);
LAYOUT_NODE* pLayout = pSet->pLayout;
// Print layout details
- skipCall |= log_msg(mdd(cb), VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
"Layout #%u, (object %#" PRIxLEAST64 ") for DS %#" PRIxLEAST64 ".", index+1, (void*)pLayout->layout.handle, (void*)pSet->set.handle);
sprintf(prefix, " [L%u] ", index);
string DSLstr = vk_print_vkdescriptorsetlayoutcreateinfo(&pLayout->createInfo, prefix).c_str();
- skipCall |= log_msg(mdd(cb), VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
"%s", DSLstr.c_str());
index++;
GENERIC_HEADER* pUpdate = pSet->pUpdateStructs;
if (pUpdate) {
- skipCall |= log_msg(mdd(cb), VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
"Update Chain [UC] for descriptor set %#" PRIxLEAST64 ":", pSet->set.handle);
sprintf(prefix, " [UC] ");
- skipCall |= log_msg(mdd(cb), VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
dynamic_display(pUpdate, prefix).c_str());
// TODO : If there is a "view" associated with this update, print CI for that view
} else {
if (0 != pSet->descriptorCount) {
- skipCall |= log_msg(mdd(cb), VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
"No Update Chain for descriptor set %#" PRIxLEAST64 " which has %u descriptors (vkUpdateDescriptors has not been called)", pSet->set.handle, pSet->descriptorCount);
} else {
- skipCall |= log_msg(mdd(cb), VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
+ skipCall |= log_msg(my_data->report_data, VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
"FYI: No descriptors in descriptor set %#" PRIxLEAST64 ".", pSet->set.handle);
}
}
{
GLOBAL_CB_NODE* pCB = getCBNode(my_data, cb);
if (pCB && pCB->pCmds.size() > 0) {
- log_msg(mdd(cb), VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
+ log_msg(my_data->report_data, VK_DBG_REPORT_INFO_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NONE, "DS",
"Cmds in CB %p", (void*)cb);
vector<CMD_NODE*> pCmds = pCB->pCmds;
for (auto ii=pCmds.begin(); ii!=pCmds.end(); ++ii) {
// TODO : Need to pass cb as srcObj here
- log_msg(mdd(cb), VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_NONE, "DS",
+ log_msg(my_data->report_data, VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_NONE, "DS",
" CMD#%lu: %s", (*ii)->cmdNumber, cmdTypeToString((*ii)->type).c_str());
}
} else {
static VkBool32 synchAndPrintDSConfig(layer_data* my_data, const VkCmdBuffer cb)
{
VkBool32 skipCall = VK_FALSE;
- if (!(mdd(cb)->active_flags & VK_DBG_REPORT_INFO_BIT)) {
+ if (!(my_data->report_data->active_flags & VK_DBG_REPORT_INFO_BIT)) {
return skipCall;
}
skipCall |= printDSConfig(my_data, cb);
// Flags validation error if the associated call is made inside a render pass. The apiName
// routine should ONLY be called outside a render pass.
-static VkBool32 insideRenderPass(GLOBAL_CB_NODE *pCB, const char *apiName)
+static VkBool32 insideRenderPass(const layer_data* my_data, GLOBAL_CB_NODE *pCB, const char *apiName)
{
VkBool32 inside = VK_FALSE;
if (pCB->activeRenderPass) {
- inside = log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER,
+ inside = log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER,
(uint64_t)pCB->cmdBuffer, 0, DRAWSTATE_INVALID_RENDERPASS_CMD, "DS",
"%s: It is invalid to issue this call inside an active render pass (%#" PRIxLEAST64 ")",
apiName, pCB->activeRenderPass.handle);
// Flags validation error if the associated call is made outside a render pass. The apiName
// routine should ONLY be called inside a render pass.
-static VkBool32 outsideRenderPass(GLOBAL_CB_NODE *pCB, const char *apiName)
+static VkBool32 outsideRenderPass(const layer_data* my_data, GLOBAL_CB_NODE *pCB, const char *apiName)
{
VkBool32 outside = VK_FALSE;
if (!pCB->activeRenderPass) {
- outside = log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER,
+ outside = log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER,
(uint64_t)pCB->cmdBuffer, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
"%s: This call must be issued inside an active render pass.", apiName);
}
loader_platform_thread_lock_mutex(&globalLock);
pCB->submitCount++; // increment submit count
if ((pCB->beginInfo.flags & VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT) && (pCB->submitCount > 1)) {
- skipCall |= log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_CMD_BUFFER_SINGLE_SUBMIT_VIOLATION, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_CMD_BUFFER_SINGLE_SUBMIT_VIOLATION, "DS",
"CB %#" PRIxLEAST64 " was begun w/ VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT set, but has been submitted %#" PRIxLEAST64 " times.", reinterpret_cast<uint64_t>(pCB->cmdBuffer), pCB->submitCount);
}
if (CB_UPDATE_COMPLETE != pCB->state) {
// Flag error for using CB w/o vkEndCommandBuffer() called
// TODO : How to pass cb as srcObj?
- skipCall |= log_msg(mdd(queue), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_NO_END_CMD_BUFFER, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_NO_END_CMD_BUFFER, "DS",
"You must call vkEndCommandBuffer() on CB %#" PRIxLEAST64 " before this call to vkQueueSubmit()!", reinterpret_cast<uint64_t>(pCB->cmdBuffer));
loader_platform_thread_unlock_mutex(&globalLock);
return VK_ERROR_VALIDATION_FAILED;
loader_platform_thread_lock_mutex(&globalLock);
for (i=0; i<count; i++) {
pPipeNode[i] = initPipeline(&pCreateInfos[i], NULL);
- skipCall |= verifyPipelineCreateState(device, pPipeNode[i]);
+ skipCall |= verifyPipelineCreateState(dev_data, device, pPipeNode[i]);
}
loader_platform_thread_unlock_mutex(&globalLock);
if (VK_FALSE == skipCall) {
if (VK_SUCCESS == result) {
LAYOUT_NODE* pNewNode = new LAYOUT_NODE;
if (NULL == pNewNode) {
- if (log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT, (*pSetLayout).handle, 0, DRAWSTATE_OUT_OF_MEMORY, "DS",
+ if (log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT, (*pSetLayout).handle, 0, DRAWSTATE_OUT_OF_MEMORY, "DS",
"Out of memory while attempting to allocate LAYOUT_NODE in vkCreateDescriptorSetLayout()"))
return VK_ERROR_VALIDATION_FAILED;
}
VkResult result = dev_data->device_dispatch_table->CreateDescriptorPool(device, pCreateInfo, pDescriptorPool);
if (VK_SUCCESS == result) {
// Insert this pool into Global Pool LL at head
- if (log_msg(mdd(device), VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_DESCRIPTOR_POOL, (*pDescriptorPool).handle, 0, DRAWSTATE_OUT_OF_MEMORY, "DS",
+ if (log_msg(dev_data->report_data, VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_DESCRIPTOR_POOL, (*pDescriptorPool).handle, 0, DRAWSTATE_OUT_OF_MEMORY, "DS",
"Created Descriptor Pool %#" PRIxLEAST64, (*pDescriptorPool).handle))
return VK_ERROR_VALIDATION_FAILED;
loader_platform_thread_lock_mutex(&globalLock);
POOL_NODE* pNewNode = new POOL_NODE(*pDescriptorPool, pCreateInfo);
if (NULL == pNewNode) {
- if (log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_POOL, (*pDescriptorPool).handle, 0, DRAWSTATE_OUT_OF_MEMORY, "DS",
+ if (log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_POOL, (*pDescriptorPool).handle, 0, DRAWSTATE_OUT_OF_MEMORY, "DS",
"Out of memory while attempting to allocate POOL_NODE in vkCreateDescriptorPool()"))
return VK_ERROR_VALIDATION_FAILED;
} else {
// Verify that requested descriptorSets are available in pool
POOL_NODE *pPoolNode = getPoolNode(dev_data, descriptorPool);
if (!pPoolNode) {
- skipCall |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_POOL, descriptorPool.handle, 0, DRAWSTATE_INVALID_POOL, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_POOL, descriptorPool.handle, 0, DRAWSTATE_INVALID_POOL, "DS",
"Unable to find pool node for pool %#" PRIxLEAST64 " specified in vkAllocDescriptorSets() call", descriptorPool.handle);
} else { // Make sure pool has all the available descriptors before calling down chain
skipCall |= validate_descriptor_availability_in_pool(dev_data, pPoolNode, count, pSetLayouts);
POOL_NODE *pPoolNode = getPoolNode(dev_data, descriptorPool);
if (pPoolNode) {
if (count == 0) {
- log_msg(mdd(device), VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, count, 0, DRAWSTATE_NONE, "DS",
+ log_msg(dev_data->report_data, VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, count, 0, DRAWSTATE_NONE, "DS",
"AllocDescriptorSets called with 0 count");
}
for (uint32_t i = 0; i < count; i++) {
- log_msg(mdd(device), VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, pDescriptorSets[i].handle, 0, DRAWSTATE_NONE, "DS",
+ log_msg(dev_data->report_data, VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, pDescriptorSets[i].handle, 0, DRAWSTATE_NONE, "DS",
"Created Descriptor Set %#" PRIxLEAST64, pDescriptorSets[i].handle);
// Create new set node and add to head of pool nodes
SET_NODE* pNewNode = new SET_NODE;
if (NULL == pNewNode) {
- if (log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, pDescriptorSets[i].handle, 0, DRAWSTATE_OUT_OF_MEMORY, "DS",
+ if (log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, pDescriptorSets[i].handle, 0, DRAWSTATE_OUT_OF_MEMORY, "DS",
"Out of memory while attempting to allocate SET_NODE in vkAllocDescriptorSets()"))
return VK_ERROR_VALIDATION_FAILED;
} else {
pPoolNode->pSets = pNewNode;
LAYOUT_NODE* pLayout = getLayoutNode(dev_data, pSetLayouts[i]);
if (NULL == pLayout) {
- if (log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT, pSetLayouts[i].handle, 0, DRAWSTATE_INVALID_LAYOUT, "DS",
+ if (log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT, pSetLayouts[i].handle, 0, DRAWSTATE_INVALID_LAYOUT, "DS",
"Unable to find set layout node for layout %#" PRIxLEAST64 " specified in vkAllocDescriptorSets() call", pSetLayouts[i].handle))
return VK_ERROR_VALIDATION_FAILED;
}
if (pCB->level == VK_CMD_BUFFER_LEVEL_PRIMARY) {
if (pBeginInfo->renderPass.handle || pBeginInfo->framebuffer.handle) {
// These should be NULL for a Primary CB
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_BEGIN_CB_INVALID_STATE, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_BEGIN_CB_INVALID_STATE, "DS",
"vkCreateCommandBuffer(): Primary Command Buffer (%p) may not specify framebuffer or renderpass parameters", (void*)cmdBuffer);
}
} else {
if (!pBeginInfo->renderPass.handle || !pBeginInfo->framebuffer.handle) {
// These should NOT be null for an Secondary CB
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_BEGIN_CB_INVALID_STATE, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_BEGIN_CB_INVALID_STATE, "DS",
"vkCreateCommandBuffer(): Secondary Command Buffers (%p) must specify framebuffer and renderpass parameters", (void*)cmdBuffer);
}
}
pCB->beginInfo = *pBeginInfo;
} else {
// TODO : Need to pass cmdBuffer as objType here
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_INVALID_CMD_BUFFER, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_INVALID_CMD_BUFFER, "DS",
"In vkBeginCommandBuffer() and unable to find CmdBuffer Node for CB %p!", (void*)cmdBuffer);
}
if (skipCall) {
/* TODO: preference is to always call API function after reporting any validation errors */
if (pCB) {
if (pCB->state != CB_UPDATE_ACTIVE) {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkEndCommandBuffer()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkEndCommandBuffer()");
}
}
if (VK_FALSE == skipCall) {
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_BINDPIPELINE);
+ skipCall |= addCmd(dev_data, pCB, CMD_BINDPIPELINE);
if ((VK_PIPELINE_BIND_POINT_COMPUTE == pipelineBindPoint) && (pCB->activeRenderPass)) {
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_PIPELINE, pipeline.handle,
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_PIPELINE, pipeline.handle,
0, DRAWSTATE_INVALID_RENDERPASS_CMD, "DS",
"Incorrectly binding compute pipeline (%#" PRIxLEAST64 ") during active RenderPass (%#" PRIxLEAST64 ")",
pipeline.handle, pCB->activeRenderPass.handle);
} else if ((VK_PIPELINE_BIND_POINT_GRAPHICS == pipelineBindPoint) && (!pCB->activeRenderPass)) {
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_PIPELINE, pipeline.handle,
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_PIPELINE, pipeline.handle,
0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS", "Incorrectly binding graphics pipeline "
" (%#" PRIxLEAST64 ") without an active RenderPass", pipeline.handle);
} else {
loader_platform_thread_unlock_mutex(&globalLock);
skipCall |= validatePipelineState(dev_data, pCB, pipelineBindPoint, pipeline);
} else {
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_PIPELINE, pipeline.handle,
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_PIPELINE, pipeline.handle,
0, DRAWSTATE_INVALID_PIPELINE, "DS",
"Attempt to bind Pipeline %#" PRIxLEAST64 " that doesn't exist!", (void*)pipeline.handle);
}
}
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindPipeline()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdBindPipeline()");
}
}
if (VK_FALSE == skipCall)
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_SETVIEWPORTSTATE);
+ skipCall |= addCmd(dev_data, pCB, CMD_SETVIEWPORTSTATE);
loader_platform_thread_lock_mutex(&globalLock);
pCB->status |= CBSTATUS_VIEWPORT_SET;
pCB->viewports.resize(viewportCount);
memcpy(pCB->viewports.data(), pViewports, viewportCount * sizeof(VkViewport));
loader_platform_thread_unlock_mutex(&globalLock);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdSetViewport()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdSetViewport()");
}
}
if (VK_FALSE == skipCall)
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_SETSCISSORSTATE);
+ skipCall |= addCmd(dev_data, pCB, CMD_SETSCISSORSTATE);
loader_platform_thread_lock_mutex(&globalLock);
pCB->status |= CBSTATUS_SCISSOR_SET;
pCB->scissors.resize(scissorCount);
memcpy(pCB->scissors.data(), pScissors, scissorCount * sizeof(VkRect2D));
loader_platform_thread_unlock_mutex(&globalLock);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdSetScissor()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdSetScissor()");
}
}
if (VK_FALSE == skipCall)
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_SETLINEWIDTHSTATE);
+ skipCall |= addCmd(dev_data, pCB, CMD_SETLINEWIDTHSTATE);
/* TODO: Do we still need this lock? */
loader_platform_thread_lock_mutex(&globalLock);
pCB->status |= CBSTATUS_LINE_WIDTH_SET;
pCB->lineWidth = lineWidth;
loader_platform_thread_unlock_mutex(&globalLock);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindDynamicLineWidthState()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdBindDynamicLineWidthState()");
}
}
if (VK_FALSE == skipCall)
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_SETDEPTHBIASSTATE);
+ skipCall |= addCmd(dev_data, pCB, CMD_SETDEPTHBIASSTATE);
pCB->status |= CBSTATUS_DEPTH_BIAS_SET;
pCB->depthBias = depthBias;
pCB->depthBiasClamp = depthBiasClamp;
pCB->slopeScaledDepthBias = slopeScaledDepthBias;
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdSetDepthBias()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdSetDepthBias()");
}
}
if (VK_FALSE == skipCall)
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_SETBLENDSTATE);
+ skipCall |= addCmd(dev_data, pCB, CMD_SETBLENDSTATE);
pCB->status |= CBSTATUS_BLEND_SET;
memcpy(pCB->blendConst, blendConst, 4 * sizeof(float));
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdSetBlendConstants()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdSetBlendConstants()");
}
}
if (VK_FALSE == skipCall)
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_SETDEPTHBOUNDSSTATE);
+ skipCall |= addCmd(dev_data, pCB, CMD_SETDEPTHBOUNDSSTATE);
pCB->status |= CBSTATUS_DEPTH_BOUNDS_SET;
pCB->minDepthBounds = minDepthBounds;
pCB->maxDepthBounds = maxDepthBounds;
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdSetDepthBounds()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdSetDepthBounds()");
}
}
if (VK_FALSE == skipCall)
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_SETSTENCILREADMASKSTATE);
+ skipCall |= addCmd(dev_data, pCB, CMD_SETSTENCILREADMASKSTATE);
if (faceMask & VK_STENCIL_FACE_FRONT_BIT) {
pCB->front.stencilCompareMask = stencilCompareMask;
}
/* TODO: We aren't capturing the faceMask, do we need to? */
pCB->status |= CBSTATUS_STENCIL_READ_MASK_SET;
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdSetStencilCompareMask()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdSetStencilCompareMask()");
}
}
if (VK_FALSE == skipCall)
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_SETSTENCILWRITEMASKSTATE);
+ skipCall |= addCmd(dev_data, pCB, CMD_SETSTENCILWRITEMASKSTATE);
if (faceMask & VK_STENCIL_FACE_FRONT_BIT) {
pCB->front.stencilWriteMask = stencilWriteMask;
}
}
pCB->status |= CBSTATUS_STENCIL_WRITE_MASK_SET;
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdSetStencilWriteMask()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdSetStencilWriteMask()");
}
}
if (VK_FALSE == skipCall)
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_SETSTENCILREFERENCESTATE);
+ skipCall |= addCmd(dev_data, pCB, CMD_SETSTENCILREFERENCESTATE);
if (faceMask & VK_STENCIL_FACE_FRONT_BIT) {
pCB->front.stencilReference = stencilReference;
}
}
pCB->status |= CBSTATUS_STENCIL_REFERENCE_SET;
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdSetStencilReference()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdSetStencilReference()");
}
}
if (VK_FALSE == skipCall)
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
if ((VK_PIPELINE_BIND_POINT_COMPUTE == pipelineBindPoint) && (pCB->activeRenderPass)) {
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_RENDERPASS_CMD, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_RENDERPASS_CMD, "DS",
"Incorrectly binding compute DescriptorSets during active RenderPass (%#" PRIxLEAST64 ")", pCB->activeRenderPass.handle);
} else if ((VK_PIPELINE_BIND_POINT_GRAPHICS == pipelineBindPoint) && (!pCB->activeRenderPass)) {
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
"Incorrectly binding graphics DescriptorSets without an active RenderPass");
} else {
for (uint32_t i=0; i<setCount; i++) {
pCB->boundDescriptorSets.push_back(pDescriptorSets[i]);
g_lastBoundDescriptorSet = pDescriptorSets[i];
loader_platform_thread_unlock_mutex(&globalLock);
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, pDescriptorSets[i].handle, 0, DRAWSTATE_NONE, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, pDescriptorSets[i].handle, 0, DRAWSTATE_NONE, "DS",
"DS %#" PRIxLEAST64 " bound on pipeline %s", pDescriptorSets[i].handle, string_VkPipelineBindPoint(pipelineBindPoint));
if (!pSet->pUpdateStructs)
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_WARN_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, pDescriptorSets[i].handle, 0, DRAWSTATE_DESCRIPTOR_SET_NOT_UPDATED, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_WARN_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, pDescriptorSets[i].handle, 0, DRAWSTATE_DESCRIPTOR_SET_NOT_UPDATED, "DS",
"DS %#" PRIxLEAST64 " bound but it was never updated. You may want to either update it or not bind it.", pDescriptorSets[i].handle);
} else {
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, pDescriptorSets[i].handle, 0, DRAWSTATE_INVALID_SET, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_DESCRIPTOR_SET, pDescriptorSets[i].handle, 0, DRAWSTATE_INVALID_SET, "DS",
"Attempt to bind DS %#" PRIxLEAST64 " that doesn't exist!", pDescriptorSets[i].handle);
}
}
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_BINDDESCRIPTORSETS);
+ skipCall |= addCmd(dev_data, pCB, CMD_BINDDESCRIPTORSETS);
}
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindDescriptorSets()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdBindDescriptorSets()");
}
}
if (VK_FALSE == skipCall)
break;
}
if (!offset_align || (offset % offset_align)) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_VTX_INDEX_ALIGNMENT_ERROR, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_VTX_INDEX_ALIGNMENT_ERROR, "DS",
"vkCmdBindIndexBuffer() offset (%#" PRIxLEAST64 ") does not fall on alignment (%s) boundary.", offset, string_VkIndexType(indexType));
}
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdBindIndexBuffer()");
}
pCB->status |= CBSTATUS_INDEX_BUFFER_BOUND;
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_BINDINDEXBUFFER);
+ skipCall |= addCmd(dev_data, pCB, CMD_BINDINDEXBUFFER);
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdBindIndexBuffer(cmdBuffer, buffer, offset, indexType);
/* TODO: Need to track all the vertex buffers, not just last one */
pCB->lastVtxBinding = startBinding + bindingCount -1;
updateCBTracking(pCB);
- addCmd(pCB, CMD_BINDVERTEXBUFFER);
+ addCmd(dev_data, pCB, CMD_BINDVERTEXBUFFER);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindVertexBuffer()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdBindVertexBuffer()");
}
}
if (VK_FALSE == skipCall)
pCB->drawCount[DRAW]++;
skipCall |= validate_draw_state(dev_data, pCB, VK_FALSE);
// TODO : Need to pass cmdBuffer as srcObj here
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_NONE, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_NONE, "DS",
"vkCmdDraw() call #%lu, reporting DS state:", g_drawCount[DRAW]++);
skipCall |= synchAndPrintDSConfig(dev_data, cmdBuffer);
if (VK_FALSE == skipCall) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_DRAW);
+ skipCall |= addCmd(dev_data, pCB, CMD_DRAW);
}
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdDraw()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdDraw()");
}
- skipCall |= outsideRenderPass(pCB, "vkCmdDraw");
+ skipCall |= outsideRenderPass(dev_data, pCB, "vkCmdDraw");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdDraw(cmdBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
pCB->drawCount[DRAW_INDEXED]++;
skipCall |= validate_draw_state(dev_data, pCB, VK_TRUE);
// TODO : Need to pass cmdBuffer as srcObj here
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_NONE, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_NONE, "DS",
"vkCmdDrawIndexed() call #%lu, reporting DS state:", g_drawCount[DRAW_INDEXED]++);
skipCall |= synchAndPrintDSConfig(dev_data, cmdBuffer);
if (VK_FALSE == skipCall) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_DRAWINDEXED);
+ skipCall |= addCmd(dev_data, pCB, CMD_DRAWINDEXED);
}
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdDrawIndexed()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdDrawIndexed()");
}
- skipCall |= outsideRenderPass(pCB, "vkCmdDrawIndexed");
+ skipCall |= outsideRenderPass(dev_data, pCB, "vkCmdDrawIndexed");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdDrawIndexed(cmdBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
pCB->drawCount[DRAW_INDIRECT]++;
skipCall |= validate_draw_state(dev_data, pCB, VK_FALSE);
// TODO : Need to pass cmdBuffer as srcObj here
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_NONE, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_NONE, "DS",
"vkCmdDrawIndirect() call #%lu, reporting DS state:", g_drawCount[DRAW_INDIRECT]++);
skipCall |= synchAndPrintDSConfig(dev_data, cmdBuffer);
if (VK_FALSE == skipCall) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_DRAWINDIRECT);
+ skipCall |= addCmd(dev_data, pCB, CMD_DRAWINDIRECT);
}
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdDrawIndirect()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdDrawIndirect()");
}
- skipCall |= outsideRenderPass(pCB, "vkCmdDrawIndirect");
+ skipCall |= outsideRenderPass(dev_data, pCB, "vkCmdDrawIndirect");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdDrawIndirect(cmdBuffer, buffer, offset, count, stride);
pCB->drawCount[DRAW_INDEXED_INDIRECT]++;
skipCall |= validate_draw_state(dev_data, pCB, VK_TRUE);
// TODO : Need to pass cmdBuffer as srcObj here
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_NONE, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_INFO_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_NONE, "DS",
"vkCmdDrawIndexedIndirect() call #%lu, reporting DS state:", g_drawCount[DRAW_INDEXED_INDIRECT]++);
skipCall |= synchAndPrintDSConfig(dev_data, cmdBuffer);
if (VK_FALSE == skipCall) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_DRAWINDEXEDINDIRECT);
+ skipCall |= addCmd(dev_data, pCB, CMD_DRAWINDEXEDINDIRECT);
}
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdDrawIndexedIndirect()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdDrawIndexedIndirect()");
}
- skipCall |= outsideRenderPass(pCB, "vkCmdDrawIndexedIndirect");
+ skipCall |= outsideRenderPass(dev_data, pCB, "vkCmdDrawIndexedIndirect");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdDrawIndexedIndirect(cmdBuffer, buffer, offset, count, stride);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_DISPATCH);
+ skipCall |= addCmd(dev_data, pCB, CMD_DISPATCH);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdDispatch()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdDispatch()");
}
- skipCall |= insideRenderPass(pCB, "vkCmdDispatch");
+ skipCall |= insideRenderPass(dev_data, pCB, "vkCmdDispatch");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdDispatch(cmdBuffer, x, y, z);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_DISPATCHINDIRECT);
+ skipCall |= addCmd(dev_data, pCB, CMD_DISPATCHINDIRECT);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdDispatchIndirect()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdDispatchIndirect()");
}
- skipCall |= insideRenderPass(pCB, "vkCmdDispatchIndirect");
+ skipCall |= insideRenderPass(dev_data, pCB, "vkCmdDispatchIndirect");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdDispatchIndirect(cmdBuffer, buffer, offset);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_COPYBUFFER);
+ skipCall |= addCmd(dev_data, pCB, CMD_COPYBUFFER);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdCopyBuffer()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdCopyBuffer()");
}
- skipCall |= insideRenderPass(pCB, "vkCmdCopyBuffer");
+ skipCall |= insideRenderPass(dev_data, pCB, "vkCmdCopyBuffer");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdCopyBuffer(cmdBuffer, srcBuffer, destBuffer, regionCount, pRegions);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_COPYIMAGE);
+ skipCall |= addCmd(dev_data, pCB, CMD_COPYIMAGE);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdCopyImage()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdCopyImage()");
}
- skipCall |= insideRenderPass(pCB, "vkCmdCopyImage");
+ skipCall |= insideRenderPass(dev_data, pCB, "vkCmdCopyImage");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdCopyImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_BLITIMAGE);
+ skipCall |= addCmd(dev_data, pCB, CMD_BLITIMAGE);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBlitImage()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdBlitImage()");
}
- skipCall |= insideRenderPass(pCB, "vkCmdBlitImage");
+ skipCall |= insideRenderPass(dev_data, pCB, "vkCmdBlitImage");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdBlitImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions, filter);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_COPYBUFFERTOIMAGE);
+ skipCall |= addCmd(dev_data, pCB, CMD_COPYBUFFERTOIMAGE);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdCopyBufferToImage()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdCopyBufferToImage()");
}
- skipCall |= insideRenderPass(pCB, "vkCmdCopyBufferToImage");
+ skipCall |= insideRenderPass(dev_data, pCB, "vkCmdCopyBufferToImage");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, destImageLayout, regionCount, pRegions);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_COPYIMAGETOBUFFER);
+ skipCall |= addCmd(dev_data, pCB, CMD_COPYIMAGETOBUFFER);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdCopyImageToBuffer()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdCopyImageToBuffer()");
}
- skipCall |= insideRenderPass(pCB, "vkCmdCopyImageToBuffer");
+ skipCall |= insideRenderPass(dev_data, pCB, "vkCmdCopyImageToBuffer");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdCopyImageToBuffer(cmdBuffer, srcImage, srcImageLayout, destBuffer, regionCount, pRegions);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_UPDATEBUFFER);
+ skipCall |= addCmd(dev_data, pCB, CMD_UPDATEBUFFER);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdUpdateBuffer()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdUpdateBuffer()");
}
- skipCall |= insideRenderPass(pCB, "vkCmdCopyUpdateBuffer");
+ skipCall |= insideRenderPass(dev_data, pCB, "vkCmdCopyUpdateBuffer");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdUpdateBuffer(cmdBuffer, destBuffer, destOffset, dataSize, pData);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_FILLBUFFER);
+ skipCall |= addCmd(dev_data, pCB, CMD_FILLBUFFER);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdFillBuffer()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdFillBuffer()");
}
- skipCall |= insideRenderPass(pCB, "vkCmdCopyFillBuffer");
+ skipCall |= insideRenderPass(dev_data, pCB, "vkCmdCopyFillBuffer");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdFillBuffer(cmdBuffer, destBuffer, destOffset, fillSize, data);
if (pCB->state == CB_UPDATE_ACTIVE) {
// Warn if this is issued prior to Draw Cmd
if (!hasDrawCmd(pCB)) {
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_WARN_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, (uint64_t)cmdBuffer, 0, DRAWSTATE_CLEAR_CMD_BEFORE_DRAW, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_WARN_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, (uint64_t)cmdBuffer, 0, DRAWSTATE_CLEAR_CMD_BEFORE_DRAW, "DS",
"vkCmdClearColorAttachment() issued on CB object 0x%" PRIxLEAST64 " prior to any Draw Cmds."
" It is recommended you use RenderPass LOAD_OP_CLEAR on Color Attachments prior to any Draw.", reinterpret_cast<uint64_t>(cmdBuffer));
}
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_CLEARCOLORATTACHMENT);
+ skipCall |= addCmd(dev_data, pCB, CMD_CLEARCOLORATTACHMENT);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdClearColorAttachment()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdClearColorAttachment()");
}
// Validate that attachment is in reference list of active subpass
}
}
if (VK_FALSE == found) {
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER,
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER,
(uint64_t)cmdBuffer, 0, DRAWSTATE_MISSING_ATTACHMENT_REFERENCE, "DS",
"vkCmdClearColorAttachment() attachment index %d not found in attachment reference array of active subpass %d",
colorAttachment, pCB->activeSubpass);
}
}
- skipCall |= outsideRenderPass(pCB, "vkCmdClearColorAttachment");
+ skipCall |= outsideRenderPass(dev_data, pCB, "vkCmdClearColorAttachment");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, pColor, rectCount, pRects);
// Warn if this is issued prior to Draw Cmd
if (!hasDrawCmd(pCB)) {
// TODO : cmdBuffer should be srcObj
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_WARN_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_CLEAR_CMD_BEFORE_DRAW, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_WARN_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, 0, 0, DRAWSTATE_CLEAR_CMD_BEFORE_DRAW, "DS",
"vkCmdClearDepthStencilAttachment() issued on CB object 0x%" PRIxLEAST64 " prior to any Draw Cmds."
" It is recommended you use RenderPass LOAD_OP_CLEAR on DS Attachment prior to any Draw.", reinterpret_cast<uint64_t>(cmdBuffer));
}
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_CLEARDEPTHSTENCILATTACHMENT);
+ skipCall |= addCmd(dev_data, pCB, CMD_CLEARDEPTHSTENCILATTACHMENT);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdClearDepthStencilAttachment()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdClearDepthStencilAttachment()");
}
- skipCall |= outsideRenderPass(pCB, "vkCmdClearDepthStencilAttachment");
+ skipCall |= outsideRenderPass(dev_data, pCB, "vkCmdClearDepthStencilAttachment");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, pDepthStencil, rectCount, pRects);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_CLEARCOLORIMAGE);
+ skipCall |= addCmd(dev_data, pCB, CMD_CLEARCOLORIMAGE);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdClearColorImage()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdClearColorImage()");
}
- skipCall |= insideRenderPass(pCB, "vkCmdClearColorImage");
+ skipCall |= insideRenderPass(dev_data, pCB, "vkCmdClearColorImage");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdClearColorImage(cmdBuffer, image, imageLayout, pColor, rangeCount, pRanges);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_CLEARDEPTHSTENCILIMAGE);
+ skipCall |= addCmd(dev_data, pCB, CMD_CLEARDEPTHSTENCILIMAGE);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdClearDepthStencilImage()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdClearDepthStencilImage()");
}
- skipCall |= insideRenderPass(pCB, "vkCmdClearDepthStencilImage");
+ skipCall |= insideRenderPass(dev_data, pCB, "vkCmdClearDepthStencilImage");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdClearDepthStencilImage(cmdBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_RESOLVEIMAGE);
+ skipCall |= addCmd(dev_data, pCB, CMD_RESOLVEIMAGE);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdResolveImage()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdResolveImage()");
}
- skipCall |= insideRenderPass(pCB, "vkCmdResolveImage");
+ skipCall |= insideRenderPass(dev_data, pCB, "vkCmdResolveImage");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdResolveImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_SETEVENT);
+ skipCall |= addCmd(dev_data, pCB, CMD_SETEVENT);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdSetEvent()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdSetEvent()");
}
- skipCall |= insideRenderPass(pCB, "vkCmdSetEvent");
+ skipCall |= insideRenderPass(dev_data, pCB, "vkCmdSetEvent");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdSetEvent(cmdBuffer, event, stageMask);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_RESETEVENT);
+ skipCall |= addCmd(dev_data, pCB, CMD_RESETEVENT);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdResetEvent()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdResetEvent()");
}
- skipCall |= insideRenderPass(pCB, "vkCmdResetEvent");
+ skipCall |= insideRenderPass(dev_data, pCB, "vkCmdResetEvent");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdResetEvent(cmdBuffer, event, stageMask);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_WAITEVENTS);
+ skipCall |= addCmd(dev_data, pCB, CMD_WAITEVENTS);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdWaitEvents()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdWaitEvents()");
}
}
if (VK_FALSE == skipCall)
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_PIPELINEBARRIER);
+ skipCall |= addCmd(dev_data, pCB, CMD_PIPELINEBARRIER);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdPipelineBarrier()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdPipelineBarrier()");
}
}
if (VK_FALSE == skipCall)
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_BEGINQUERY);
+ skipCall |= addCmd(dev_data, pCB, CMD_BEGINQUERY);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBeginQuery()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdBeginQuery()");
}
}
if (VK_FALSE == skipCall)
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_ENDQUERY);
+ skipCall |= addCmd(dev_data, pCB, CMD_ENDQUERY);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdEndQuery()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdEndQuery()");
}
}
if (VK_FALSE == skipCall)
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_RESETQUERYPOOL);
+ skipCall |= addCmd(dev_data, pCB, CMD_RESETQUERYPOOL);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdResetQueryPool()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdResetQueryPool()");
}
- skipCall |= insideRenderPass(pCB, "vkCmdQueryPool");
+ skipCall |= insideRenderPass(dev_data, pCB, "vkCmdQueryPool");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_COPYQUERYPOOLRESULTS);
+ skipCall |= addCmd(dev_data, pCB, CMD_COPYQUERYPOOLRESULTS);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdCopyQueryPoolResults()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdCopyQueryPoolResults()");
}
- skipCall |= insideRenderPass(pCB, "vkCmdCopyQueryPoolResults");
+ skipCall |= insideRenderPass(dev_data, pCB, "vkCmdCopyQueryPoolResults");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdCopyQueryPoolResults(cmdBuffer, queryPool,
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_WRITETIMESTAMP);
+ skipCall |= addCmd(dev_data, pCB, CMD_WRITETIMESTAMP);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdWriteTimestamp()");
+ skipCall |= report_error_no_cb_begin(dev_data, cmdBuffer, "vkCmdWriteTimestamp()");
}
}
if (VK_FALSE == skipCall)
return false;
}
-bool CheckDependencyExists(VkDevice device, const int subpass, const std::vector<uint32_t>& dependent_subpasses, const std::vector<DAGNode>& subpass_to_node, bool& skip_call) {
+bool CheckDependencyExists(const layer_data* my_data, VkDevice device, const int subpass, const std::vector<uint32_t>& dependent_subpasses, const std::vector<DAGNode>& subpass_to_node, bool& skip_call) {
bool result = true;
// Loop through all subpasses that share the same attachment and make sure a dependency exists
for (uint32_t k = 0; k < dependent_subpasses.size(); ++k) {
std::unordered_set<uint32_t> processed_nodes;
if (FindDependency(subpass, dependent_subpasses[k], subpass_to_node, processed_nodes) ||
FindDependency(dependent_subpasses[k], subpass, subpass_to_node, processed_nodes)) {
- skip_call |= log_msg(mdd(device), VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, DRAWSTATE_INVALID_RENDERPASS, "DS",
+ skip_call |= log_msg(my_data->report_data, VK_DBG_REPORT_WARN_BIT, (VkDbgObjectType)0, 0, 0, DRAWSTATE_INVALID_RENDERPASS, "DS",
"A dependency between subpasses %d and %d must exist but only an implicit one is specified.",
subpass, dependent_subpasses[k]);
} else {
- skip_call |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, DRAWSTATE_INVALID_RENDERPASS, "DS",
+ skip_call |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, DRAWSTATE_INVALID_RENDERPASS, "DS",
"A dependency between subpasses %d and %d must exist but one is not specified.",
subpass, dependent_subpasses[k]);
result = false;
return result;
}
-bool CheckPreserved(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const int index, const int attachment, const std::vector<DAGNode>& subpass_to_node, int depth, bool& skip_call) {
+bool CheckPreserved(const layer_data* my_data, VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const int index, const int attachment, const std::vector<DAGNode>& subpass_to_node, int depth, bool& skip_call) {
const DAGNode& node = subpass_to_node[index];
// If this node writes to the attachment return true as next nodes need to preserve the attachment.
const VkSubpassDescription& subpass = pCreateInfo->pSubpasses[index];
bool result = false;
// Loop through previous nodes and see if any of them write to the attachment.
for (auto elem : node.prev) {
- result |= CheckPreserved(device, pCreateInfo, elem, attachment, subpass_to_node, depth + 1, skip_call);
+ result |= CheckPreserved(my_data, device, pCreateInfo, elem, attachment, subpass_to_node, depth + 1, skip_call);
}
// If the attachment was written to by a previous node than this node needs to preserve it.
if (result && depth > 0) {
}
}
if (!has_preserved) {
- skip_call |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, DRAWSTATE_INVALID_RENDERPASS, "DS",
+ skip_call |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, DRAWSTATE_INVALID_RENDERPASS, "DS",
"Attachment %d is used by a later subpass and must be preserved in subpass %d.", attachment, index);
}
}
return result;
}
-bool validateDependencies(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo) {
+bool validateDependencies(const layer_data* my_data, VkDevice device, const VkRenderPassCreateInfo* pCreateInfo) {
bool skip_call = false;
std::vector<DAGNode> subpass_to_node(pCreateInfo->subpassCount);
std::vector<std::vector<uint32_t>> output_attachment_to_subpass(pCreateInfo->attachmentCount);
for (uint32_t i = 0; i < pCreateInfo->dependencyCount; ++i) {
const VkSubpassDependency& dependency = pCreateInfo->pDependencies[i];
if (dependency.srcSubpass > dependency.destSubpass) {
- skip_call |= log_msg(mdd(device), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, DRAWSTATE_INVALID_RENDERPASS, "DS",
+ skip_call |= log_msg(my_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType)0, 0, 0, DRAWSTATE_INVALID_RENDERPASS, "DS",
"Dependency graph must be specified such that an earlier pass cannot depend on a later pass.");
}
subpass_to_node[dependency.destSubpass].prev.push_back(dependency.srcSubpass);
// If the attachment is an input then all subpasses that output must have a dependency relationship
for (uint32_t j = 0; j < subpass.inputCount; ++j) {
const uint32_t& attachment = subpass.pInputAttachments[j].attachment;
- CheckDependencyExists(device, i, output_attachment_to_subpass[attachment], subpass_to_node, skip_call);
+ CheckDependencyExists(my_data, device, i, output_attachment_to_subpass[attachment], subpass_to_node, skip_call);
}
// If the attachment is an output then all subpasses that use the attachment must have a dependency relationship
for (uint32_t j = 0; j < subpass.colorCount; ++j) {
const uint32_t& attachment = subpass.pColorAttachments[j].attachment;
- CheckDependencyExists(device, i, output_attachment_to_subpass[attachment], subpass_to_node, skip_call);
- CheckDependencyExists(device, i, input_attachment_to_subpass[attachment], subpass_to_node, skip_call);
+ CheckDependencyExists(my_data, device, i, output_attachment_to_subpass[attachment], subpass_to_node, skip_call);
+ CheckDependencyExists(my_data, device, i, input_attachment_to_subpass[attachment], subpass_to_node, skip_call);
}
if (subpass.depthStencilAttachment.attachment != VK_ATTACHMENT_UNUSED) {
const uint32_t& attachment = subpass.depthStencilAttachment.attachment;
- CheckDependencyExists(device, i, output_attachment_to_subpass[attachment], subpass_to_node, skip_call);
- CheckDependencyExists(device, i, input_attachment_to_subpass[attachment], subpass_to_node, skip_call);
+ CheckDependencyExists(my_data, device, i, output_attachment_to_subpass[attachment], subpass_to_node, skip_call);
+ CheckDependencyExists(my_data, device, i, input_attachment_to_subpass[attachment], subpass_to_node, skip_call);
}
}
// Loop through implicit dependencies, if this pass reads make sure the attachment is preserved for all passes after it was written.
for (uint32_t i = 0; i < pCreateInfo->subpassCount; ++i) {
const VkSubpassDescription& subpass = pCreateInfo->pSubpasses[i];
for (uint32_t j = 0; j < subpass.inputCount; ++j) {
- CheckPreserved(device, pCreateInfo, i, subpass.pInputAttachments[j].attachment, subpass_to_node, 0, skip_call);
+ CheckPreserved(my_data, device, pCreateInfo, i, subpass.pInputAttachments[j].attachment, subpass_to_node, 0, skip_call);
}
}
return skip_call;
VK_LAYER_EXPORT VkResult VKAPI vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, VkRenderPass* pRenderPass)
{
- if (validateDependencies(device, pCreateInfo)) {
+ layer_data* dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map);
+ if (validateDependencies(dev_data, device, pCreateInfo)) {
return VK_ERROR_VALIDATION_FAILED;
}
- layer_data* dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map);
VkResult result = dev_data->device_dispatch_table->CreateRenderPass(device, pCreateInfo, pRenderPass);
if (VK_SUCCESS == result) {
// Shadow create info and store in map
GLOBAL_CB_NODE* pCB = getCBNode(dev_data, cmdBuffer);
if (pCB) {
if (pRenderPassBegin && pRenderPassBegin->renderPass) {
- skipCall |= insideRenderPass(pCB, "vkCmdBeginRenderPass");
+ skipCall |= insideRenderPass(dev_data, pCB, "vkCmdBeginRenderPass");
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_BEGINRENDERPASS);
+ skipCall |= addCmd(dev_data, pCB, CMD_BEGINRENDERPASS);
pCB->activeRenderPass = pRenderPassBegin->renderPass;
pCB->activeSubpass = 0;
pCB->framebuffer = pRenderPassBegin->framebuffer;
skipCall |= validatePipelineState(dev_data, pCB, VK_PIPELINE_BIND_POINT_GRAPHICS, pCB->lastBoundPipeline);
}
} else {
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_RENDERPASS, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_RENDERPASS, "DS",
"You cannot use a NULL RenderPass object in vkCmdBeginRenderPass()");
}
}
GLOBAL_CB_NODE* pCB = getCBNode(dev_data, cmdBuffer);
if (pCB) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_NEXTSUBPASS);
+ skipCall |= addCmd(dev_data, pCB, CMD_NEXTSUBPASS);
pCB->activeSubpass++;
if (pCB->lastBoundPipeline) {
skipCall |= validatePipelineState(dev_data, pCB, VK_PIPELINE_BIND_POINT_GRAPHICS, pCB->lastBoundPipeline);
}
- skipCall |= outsideRenderPass(pCB, "vkCmdNextSubpass");
+ skipCall |= outsideRenderPass(dev_data, pCB, "vkCmdNextSubpass");
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdNextSubpass(cmdBuffer, contents);
layer_data* dev_data = get_my_data_ptr(get_dispatch_key(cmdBuffer), layer_data_map);
GLOBAL_CB_NODE* pCB = getCBNode(dev_data, cmdBuffer);
if (pCB) {
- skipCall |= outsideRenderPass(pCB, "vkEndRenderpass");
+ skipCall |= outsideRenderPass(dev_data, pCB, "vkEndRenderpass");
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_ENDRENDERPASS);
+ skipCall |= addCmd(dev_data, pCB, CMD_ENDRENDERPASS);
pCB->activeRenderPass = 0;
pCB->activeSubpass = 0;
}
for (uint32_t i=0; i<cmdBuffersCount; i++) {
pSubCB = getCBNode(dev_data, pCmdBuffers[i]);
if (!pSubCB) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_SECONDARY_CMD_BUFFER, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_SECONDARY_CMD_BUFFER, "DS",
"vkCmdExecuteCommands() called w/ invalid Cmd Buffer %p in element %u of pCmdBuffers array.", (void*)pCmdBuffers[i], i);
} else if (VK_CMD_BUFFER_LEVEL_PRIMARY == pSubCB->createInfo.level) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_SECONDARY_CMD_BUFFER, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_SECONDARY_CMD_BUFFER, "DS",
"vkCmdExecuteCommands() called w/ Primary Cmd Buffer %p in element %u of pCmdBuffers array. All cmd buffers in pCmdBuffers array must be secondary.", (void*)pCmdBuffers[i], i);
}
}
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_EXECUTECOMMANDS);
+ skipCall |= addCmd(dev_data, pCB, CMD_EXECUTECOMMANDS);
}
if (VK_FALSE == skipCall)
dev_data->device_dispatch_table->CmdExecuteCommands(cmdBuffer, cmdBuffersCount, pCmdBuffers);
layer_data* dev_data = get_my_data_ptr(get_dispatch_key(cmdBuffer), layer_data_map);
GLOBAL_CB_NODE* pCB = getCBNode(dev_data, cmdBuffer);
if (!dev_data->device_extensions.debug_marker_enabled) {
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, (uint64_t)cmdBuffer, 0, DRAWSTATE_INVALID_EXTENSION, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, (uint64_t)cmdBuffer, 0, DRAWSTATE_INVALID_EXTENSION, "DS",
"Attempt to use CmdDbgMarkerBegin but extension disabled!");
return;
} else if (pCB) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_DBGMARKERBEGIN);
+ skipCall |= addCmd(dev_data, pCB, CMD_DBGMARKERBEGIN);
}
if (VK_FALSE == skipCall)
debug_marker_dispatch_table(cmdBuffer)->CmdDbgMarkerBegin(cmdBuffer, pMarker);
layer_data* dev_data = get_my_data_ptr(get_dispatch_key(cmdBuffer), layer_data_map);
GLOBAL_CB_NODE* pCB = getCBNode(dev_data, cmdBuffer);
if (!dev_data->device_extensions.debug_marker_enabled) {
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, (uint64_t)cmdBuffer, 0, DRAWSTATE_INVALID_EXTENSION, "DS",
+ skipCall |= log_msg(dev_data->report_data, VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER, (uint64_t)cmdBuffer, 0, DRAWSTATE_INVALID_EXTENSION, "DS",
"Attempt to use CmdDbgMarkerEnd but extension disabled!");
return;
} else if (pCB) {
updateCBTracking(pCB);
- skipCall |= addCmd(pCB, CMD_DBGMARKEREND);
+ skipCall |= addCmd(dev_data, pCB, CMD_DBGMARKEREND);
}
if (VK_FALSE == skipCall)
debug_marker_dispatch_table(cmdBuffer)->CmdDbgMarkerEnd(cmdBuffer);