return "CMD_ENDQUERY";
case CMD_RESETQUERYPOOL:
return "CMD_RESETQUERYPOOL";
+ case CMD_COPYQUERYPOOLRESULTS:
+ return "CMD_COPYQUERYPOOLRESULTS";
case CMD_WRITETIMESTAMP:
return "CMD_WRITETIMESTAMP";
case CMD_INITATOMICCOUNTERS:
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",
"Pipeline layout from last vkCmdBindDescriptorSets() (%#" PRIxLEAST64 ") does not match PSO Pipeline layout (%#" PRIxLEAST64 ") ", pCB->lastBoundPipelineLayout.handle, pPipe->graphicsPipelineCI.layout.handle);
}
- if (!pCB->activeRenderPass) {
- result |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
- "Draw cmd issued without an active RenderPass. vkCmdDraw*() must only be called within a RenderPass.");
- }
// Verify Vtx binding
if (MAX_BINDING != pCB->lastVtxBinding) {
if (pCB->lastVtxBinding >= pPipe->vtxBindingCount) {
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",
- "Num samples mismatch! Binding PSO (%#" PRIxLEAST64 ") with %u samples while current RenderPass (%#" PRIxLEAST64 ") w/ %u samples!", pipeline.handle, psoNumSamples, pCB->activeRenderPass.handle, subpassNumSamples);
+ "Num samples mismatch! Binding PSO (%#" PRIxLEAST64 ") with %u samples while current RenderPass (%#" PRIxLEAST64 ") w/ %u samples!",
+ pipeline.handle, psoNumSamples, pCB->activeRenderPass.handle, subpassNumSamples);
}
} else {
// TODO : I believe it's an error if we reach this point and don't have an activeRenderPass
}
}
-
static VkBool32 synchAndPrintDSConfig(const VkCmdBuffer cb)
{
VkBool32 skipCall = VK_FALSE;
return skipCall;
}
+// 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)
+{
+ VkBool32 inside = VK_FALSE;
+ if (pCB->activeRenderPass) {
+ inside = log_msg(mdd(pCB->cmdBuffer), 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);
+ }
+ return inside;
+}
+
+// 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)
+{
+ VkBool32 outside = VK_FALSE;
+ if (!pCB->activeRenderPass) {
+ outside = log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER,
+ (uint64_t)pCB->cmdBuffer, 0, DRAWSTATE_INVALID_RENDERPASS_CMD, "DS",
+ "%s: This call must be issued inside an active render pass.", apiName);
+ }
+ return outside;
+}
+
static void init_draw_state(layer_data *my_data)
{
uint32_t report_flags = 0;
updateCBTracking(cmdBuffer);
skipCall |= addCmd(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, 0, DRAWSTATE_INVALID_RENDERPASS_CMD, "DS",
- "Incorrectly binding compute pipeline (%#" PRIxLEAST64 ") during active RenderPass (%#" PRIxLEAST64 ")", pipeline.handle, pCB->activeRenderPass.handle);
+ skipCall |= log_msg(mdd(cmdBuffer), 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, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
- "Incorrectly binding graphics pipeline (%#" PRIxLEAST64 ") without an active RenderPass", pipeline.handle);
+ skipCall |= log_msg(mdd(cmdBuffer), 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 {
PIPELINE_NODE* pPN = getPipeline(pipeline);
if (pPN) {
loader_platform_thread_unlock_mutex(&globalLock);
skipCall |= validatePipelineState(pCB, pipelineBindPoint, pipeline);
} else {
- skipCall |= log_msg(mdd(cmdBuffer), 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);
+ skipCall |= log_msg(mdd(cmdBuffer), 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 {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_SETVIEWPORTSTATE);
- if (!pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
- "Incorrect call to vkCmdSetViewport() without an active RenderPass.");
- }
loader_platform_thread_lock_mutex(&globalLock);
pCB->status |= CBSTATUS_VIEWPORT_SET;
pCB->viewports.resize(viewportCount);
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_SETSCISSORSTATE);
- if (!pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
- "Incorrect call to vkCmdSetScissor() without an active RenderPass.");
- }
loader_platform_thread_lock_mutex(&globalLock);
pCB->status |= CBSTATUS_SCISSOR_SET;
pCB->scissors.resize(scissorCount);
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_SETLINEWIDTHSTATE);
- if (!pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
- "Incorrect call to vkCmdSetLineWidth() without an active RenderPass.");
- }
/* TODO: Do we still need this lock? */
loader_platform_thread_lock_mutex(&globalLock);
pCB->status |= CBSTATUS_LINE_WIDTH_SET;
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_SETDEPTHBIASSTATE);
- if (!pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
- "Incorrect call to vkCmdSetDepthBias() without an active RenderPass.");
- }
pCB->status |= CBSTATUS_DEPTH_BIAS_SET;
pCB->depthBias = depthBias;
pCB->depthBiasClamp = depthBiasClamp;
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_SETBLENDSTATE);
- if (!pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
- "Incorrect call to vkSetBlendConstants() without an active RenderPass.");
- }
pCB->status |= CBSTATUS_BLEND_SET;
memcpy(pCB->blendConst, blendConst, 4 * sizeof(float));
} else {
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_SETDEPTHBOUNDSSTATE);
- if (!pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
- "Incorrect call to vkCmdSetDepthBounds() without an active RenderPass.");
- }
pCB->status |= CBSTATUS_DEPTH_BOUNDS_SET;
pCB->minDepthBounds = minDepthBounds;
pCB->maxDepthBounds = maxDepthBounds;
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_SETSTENCILREADMASKSTATE);
- if (!pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
- "Incorrect call to vkCmdSetStencilCompareMask() without an active RenderPass.");
- }
if (faceMask & VK_STENCIL_FACE_FRONT_BIT) {
pCB->front.stencilCompareMask = stencilCompareMask;
}
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_SETSTENCILWRITEMASKSTATE);
- if (!pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
- "Incorrect call to vkCmdSetStencilWriteMask() without an active RenderPass.");
- }
if (faceMask & VK_STENCIL_FACE_FRONT_BIT) {
pCB->front.stencilWriteMask = stencilWriteMask;
}
if (pCB->state == CB_UPDATE_ACTIVE) {
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_SETSTENCILREFERENCESTATE);
- if (!pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
- "Incorrect call to vkCmdSetStencilReference() without an active RenderPass.");
- }
if (faceMask & VK_STENCIL_FACE_FRONT_BIT) {
pCB->front.stencilReference = stencilReference;
}
GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
- if (!pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
- "Incorrect call to vkCmdBindIndexBuffer() without an active RenderPass.");
- }
VkDeviceSize offset_align = 0;
switch (indexType) {
case VK_INDEX_TYPE_UINT16:
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
/* TODO: Need to track all the vertex buffers, not just last one */
- if (!pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
- "Incorrect call to vkCmdBindVertexBuffers() without an active RenderPass.");
- } else {
- pCB->lastVtxBinding = startBinding + bindingCount -1;
- updateCBTracking(cmdBuffer);
- addCmd(pCB, CMD_BINDVERTEXBUFFER);
- }
+ pCB->lastVtxBinding = startBinding + bindingCount -1;
+ updateCBTracking(cmdBuffer);
+ addCmd(pCB, CMD_BINDVERTEXBUFFER);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindVertexBuffer()");
}
}
if (VK_FALSE == skipCall)
skipCall |= addCmd(pCB, CMD_DRAW);
}
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdDraw()");
}
+ skipCall |= outsideRenderPass(pCB, "vkCmdDraw");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdDraw(cmdBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
skipCall |= addCmd(pCB, CMD_DRAWINDEXED);
}
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdDrawIndexed()");
}
+ skipCall |= outsideRenderPass(pCB, "vkCmdDrawIndexed");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdDrawIndexed(cmdBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
skipCall |= addCmd(pCB, CMD_DRAWINDIRECT);
}
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdDrawIndirect()");
}
+ skipCall |= outsideRenderPass(pCB, "vkCmdDrawIndirect");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdDrawIndirect(cmdBuffer, buffer, offset, count, stride);
skipCall |= addCmd(pCB, CMD_DRAWINDEXEDINDIRECT);
}
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdDrawIndexedIndirect()");
}
+ skipCall |= outsideRenderPass(pCB, "vkCmdDrawIndexedIndirect");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdDrawIndexedIndirect(cmdBuffer, buffer, offset, count, stride);
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_DISPATCH);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdDispatch()");
}
+ skipCall |= insideRenderPass(pCB, "vkCmdDispatch");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdDispatch(cmdBuffer, x, y, z);
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_DISPATCHINDIRECT);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdDispatchIndirect()");
}
+ skipCall |= insideRenderPass(pCB, "vkCmdDispatchIndirect");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdDispatchIndirect(cmdBuffer, buffer, offset);
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_COPYBUFFER);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdCopyBuffer()");
}
+ skipCall |= insideRenderPass(pCB, "vkCmdCopyBuffer");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdCopyBuffer(cmdBuffer, srcBuffer, destBuffer, regionCount, pRegions);
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_COPYIMAGE);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdCopyImage()");
}
+ skipCall |= insideRenderPass(pCB, "vkCmdCopyImage");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdCopyImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions);
GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
- if (pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_RENDERPASS_CMD, "DS",
- "Incorrectly issuing CmdBlitImage during active RenderPass (%#" PRIxLEAST64 ")", pCB->activeRenderPass.handle);
- } else {
- updateCBTracking(cmdBuffer);
- skipCall |= addCmd(pCB, CMD_BLITIMAGE);
- }
+ updateCBTracking(cmdBuffer);
+ skipCall |= addCmd(pCB, CMD_BLITIMAGE);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBlitImage()");
}
+ skipCall |= insideRenderPass(pCB, "vkCmdBlitImage");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdBlitImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions, filter);
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_COPYBUFFERTOIMAGE);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdCopyBufferToImage()");
}
+ skipCall |= insideRenderPass(pCB, "vkCmdCopyBufferToImage");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdCopyBufferToImage(cmdBuffer, srcBuffer, destImage, destImageLayout, regionCount, pRegions);
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_COPYIMAGETOBUFFER);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdCopyImageToBuffer()");
}
+ skipCall |= insideRenderPass(pCB, "vkCmdCopyImageToBuffer");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdCopyImageToBuffer(cmdBuffer, srcImage, srcImageLayout, destBuffer, regionCount, pRegions);
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_UPDATEBUFFER);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
- }
- if (pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER,
- (uint64_t)cmdBuffer, 0, DRAWSTATE_INVALID_RENDERPASS_CMD, "DS",
- "CmdUpdateBuffer cmd issued within an active RenderPass -- vkCmdUpdateBuffer "
- "may only be called outside of a RenderPass.");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdUpdateBuffer()");
}
+ skipCall |= insideRenderPass(pCB, "vkCmdCopyUpdateBuffer");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdUpdateBuffer(cmdBuffer, destBuffer, destOffset, dataSize, pData);
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_FILLBUFFER);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
- }
- if (pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER,
- (uint64_t)cmdBuffer, 0, DRAWSTATE_INVALID_RENDERPASS_CMD, "DS",
- "CmdFillBuffer cmd issued within an active RenderPass -- vkCmdFillBuffer "
- "may only be called outside of a RenderPass.");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdFillBuffer()");
}
+ skipCall |= insideRenderPass(pCB, "vkCmdCopyFillBuffer");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdFillBuffer(cmdBuffer, destBuffer, destOffset, fillSize, data);
"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));
}
- if (!pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER,
- (uint64_t)cmdBuffer, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
- "CmdClearColorAttachment cmd issued outside of an active RenderPass. "
- "vkCmdClearColorAttachment() must only be called inside of a RenderPass."
- " vkCmdClearColorImage() should be used outside of a RenderPass.");
- } else {
- updateCBTracking(cmdBuffer);
- skipCall |= addCmd(pCB, CMD_CLEARCOLORATTACHMENT);
- }
+ updateCBTracking(cmdBuffer);
+ skipCall |= addCmd(pCB, CMD_CLEARCOLORATTACHMENT);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdClearColorAttachment()");
}
+ skipCall |= outsideRenderPass(pCB, "vkCmdClearColorAttachment");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdClearColorAttachment(cmdBuffer, colorAttachment, imageLayout, pColor, rectCount, pRects);
"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));
}
- if (!pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
- "Clear*Attachment cmd issued without an active RenderPass. vkCmdClearDepthStencilAttachment() must only be called inside of a RenderPass."
- " vkCmdClearDepthStencilImage() should be used outside of a RenderPass.");
- } else {
- updateCBTracking(cmdBuffer);
- skipCall |= addCmd(pCB, CMD_CLEARDEPTHSTENCILATTACHMENT);
- }
+ updateCBTracking(cmdBuffer);
+ skipCall |= addCmd(pCB, CMD_CLEARDEPTHSTENCILATTACHMENT);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdClearDepthStencilAttachment()");
}
+ skipCall |= outsideRenderPass(pCB, "vkCmdClearDepthStencilAttachment");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, pDepthStencil, rectCount, pRects);
GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
- if (pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER,
- (uint64_t)cmdBuffer, 0, DRAWSTATE_INVALID_RENDERPASS_CMD, "DS",
- "CmdClearColorImage cmd issued within an active RenderPass. "
- "vkCmdClearColorImage() must only be called outside of a RenderPass. "
- "vkCmdClearColorAttachment() should be used within a RenderPass.");
- } else {
- updateCBTracking(cmdBuffer);
- skipCall |= addCmd(pCB, CMD_CLEARCOLORIMAGE);
- }
+ updateCBTracking(cmdBuffer);
+ skipCall |= addCmd(pCB, CMD_CLEARCOLORIMAGE);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdClearColorImage()");
}
+ skipCall |= insideRenderPass(pCB, "vkCmdClearColorImage");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdClearColorImage(cmdBuffer, image, imageLayout, pColor, rangeCount, pRanges);
GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
- if (pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_COMMAND_BUFFER,
- (uint64_t)cmdBuffer, 0, DRAWSTATE_INVALID_RENDERPASS_CMD, "DS",
- "CmdClearDepthStencilImage cmd issued within an active RenderPass. "
- "vkCmdClearDepthStencilImage() must only be called outside of a RenderPass."
- " vkCmdClearDepthStencilAttachment() should be used within a RenderPass.");
- } else {
- updateCBTracking(cmdBuffer);
- skipCall |= addCmd(pCB, CMD_CLEARDEPTHSTENCILIMAGE);
- }
+ updateCBTracking(cmdBuffer);
+ skipCall |= addCmd(pCB, CMD_CLEARDEPTHSTENCILIMAGE);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdClearDepthStencilImage()");
}
+ skipCall |= insideRenderPass(pCB, "vkCmdClearDepthStencilImage");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdClearDepthStencilImage(cmdBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer);
if (pCB) {
if (pCB->state == CB_UPDATE_ACTIVE) {
- if (pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_RENDERPASS_CMD, "DS",
- "Cannot call vkCmdResolveImage() during an active RenderPass (%#" PRIxLEAST64 ").", pCB->activeRenderPass.handle);
- } else {
- updateCBTracking(cmdBuffer);
- skipCall |= addCmd(pCB, CMD_RESOLVEIMAGE);
- }
+ updateCBTracking(cmdBuffer);
+ skipCall |= addCmd(pCB, CMD_RESOLVEIMAGE);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdResolveImage()");
}
+ skipCall |= insideRenderPass(pCB, "vkCmdResolveImage");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdResolveImage(cmdBuffer, srcImage, srcImageLayout, destImage, destImageLayout, regionCount, pRegions);
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_SETEVENT);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdSetEvent()");
}
+ skipCall |= insideRenderPass(pCB, "vkCmdSetEvent");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdSetEvent(cmdBuffer, event, stageMask);
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_RESETEVENT);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdResetEvent()");
}
+ skipCall |= insideRenderPass(pCB, "vkCmdResetEvent");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdResetEvent(cmdBuffer, event, stageMask);
updateCBTracking(cmdBuffer);
skipCall |= addCmd(pCB, CMD_WAITEVENTS);
} else {
- skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdBindIndexBuffer()");
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdWaitEvents()");
}
}
if (VK_FALSE == skipCall)
} else {
skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdResetQueryPool()");
}
+ skipCall |= insideRenderPass(pCB, "vkCmdQueryPool");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdResetQueryPool(cmdBuffer, queryPool, startQuery, queryCount);
}
+VK_LAYER_EXPORT void VKAPI vkCmdCopyQueryPoolResults(VkCmdBuffer cmdBuffer, VkQueryPool queryPool, uint32_t startQuery,
+ uint32_t queryCount, VkBuffer destBuffer, VkDeviceSize destOffset,
+ VkDeviceSize destStride, VkQueryResultFlags flags)
+{
+ VkBool32 skipCall = VK_FALSE;
+ GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer);
+ if (pCB) {
+ if (pCB->state == CB_UPDATE_ACTIVE) {
+ updateCBTracking(cmdBuffer);
+ skipCall |= addCmd(pCB, CMD_COPYQUERYPOOLRESULTS);
+ } else {
+ skipCall |= report_error_no_cb_begin(cmdBuffer, "vkCmdCopyQueryPoolResults()");
+ }
+ skipCall |= insideRenderPass(pCB, "vkCmdCopyQueryPoolResults");
+ }
+ if (VK_FALSE == skipCall)
+ get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdCopyQueryPoolResults(cmdBuffer, queryPool,
+ startQuery, queryCount, destBuffer, destOffset, destStride, flags);
+}
+
VK_LAYER_EXPORT void VKAPI vkCmdWriteTimestamp(VkCmdBuffer cmdBuffer, VkTimestampType timestampType, VkBuffer destBuffer, VkDeviceSize destOffset)
{
VkBool32 skipCall = VK_FALSE;
GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer);
if (pCB) {
if (pRenderPassBegin && pRenderPassBegin->renderPass) {
- if (pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_INVALID_RENDERPASS_CMD, "DS",
- "Cannot call vkCmdBeginRenderPass() during an active RenderPass (%#" PRIxLEAST64 "). You must first call vkCmdEndRenderPass().", pCB->activeRenderPass.handle);
- } else {
- updateCBTracking(cmdBuffer);
- skipCall |= addCmd(pCB, CMD_BEGINRENDERPASS);
- pCB->activeRenderPass = pRenderPassBegin->renderPass;
- pCB->activeSubpass = 0;
- pCB->framebuffer = pRenderPassBegin->framebuffer;
- if (pCB->lastBoundPipeline) {
- skipCall |= validatePipelineState(pCB, VK_PIPELINE_BIND_POINT_GRAPHICS, pCB->lastBoundPipeline);
- }
+ skipCall |= insideRenderPass(pCB, "vkCmdBeginRenderPass");
+ updateCBTracking(cmdBuffer);
+ skipCall |= addCmd(pCB, CMD_BEGINRENDERPASS);
+ pCB->activeRenderPass = pRenderPassBegin->renderPass;
+ pCB->activeSubpass = 0;
+ pCB->framebuffer = pRenderPassBegin->framebuffer;
+ if (pCB->lastBoundPipeline) {
+ skipCall |= validatePipelineState(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",
VkBool32 skipCall = VK_FALSE;
GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer);
if (pCB) {
- if (!pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
- "Incorrect call to vkCmdNextSubpass() without an active RenderPass.");
- } else {
- updateCBTracking(cmdBuffer);
- skipCall |= addCmd(pCB, CMD_NEXTSUBPASS);
- pCB->activeSubpass++;
- if (pCB->lastBoundPipeline) {
- skipCall |= validatePipelineState(pCB, VK_PIPELINE_BIND_POINT_GRAPHICS, pCB->lastBoundPipeline);
- }
+ updateCBTracking(cmdBuffer);
+ skipCall |= addCmd(pCB, CMD_NEXTSUBPASS);
+ pCB->activeSubpass++;
+ if (pCB->lastBoundPipeline) {
+ skipCall |= validatePipelineState(pCB, VK_PIPELINE_BIND_POINT_GRAPHICS, pCB->lastBoundPipeline);
}
+ skipCall |= outsideRenderPass(pCB, "vkCmdNextSubpass");
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdNextSubpass(cmdBuffer, contents);
VkBool32 skipCall = VK_FALSE;
GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer);
if (pCB) {
- if (!pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
- "Incorrect call to vkCmdEndRenderPass() without an active RenderPass.");
- } else {
- updateCBTracking(cmdBuffer);
- skipCall |= addCmd(pCB, CMD_ENDRENDERPASS);
- pCB->activeRenderPass = 0;
- pCB->activeSubpass = 0;
- }
+ skipCall |= outsideRenderPass(pCB, "vkEndRenderpass");
+ updateCBTracking(cmdBuffer);
+ skipCall |= addCmd(pCB, CMD_ENDRENDERPASS);
+ pCB->activeRenderPass = 0;
+ pCB->activeSubpass = 0;
}
if (VK_FALSE == skipCall)
get_dispatch_table(draw_state_device_table_map, cmdBuffer)->CmdEndRenderPass(cmdBuffer);
VkBool32 skipCall = VK_FALSE;
GLOBAL_CB_NODE* pCB = getCBNode(cmdBuffer);
if (pCB) {
- if (!pCB->activeRenderPass) {
- skipCall |= log_msg(mdd(pCB->cmdBuffer), VK_DBG_REPORT_ERROR_BIT, (VkDbgObjectType) 0, 0, 0, DRAWSTATE_NO_ACTIVE_RENDERPASS, "DS",
- "Incorrect call to vkCmdExecuteCommands() without an active RenderPass.");
- }
GLOBAL_CB_NODE* pSubCB = NULL;
for (uint32_t i=0; i<cmdBuffersCount; i++) {
pSubCB = getCBNode(pCmdBuffers[i]);