From 436564308e52d09c3ca4f34a23e5bdc5bade483f Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Tue, 23 Jun 2015 08:46:18 -0600 Subject: layers: Added DrawState check to flag error if compute pipeline bound during RenderPass --- layers/draw_state.cpp | 4 ++++ layers/draw_state.h | 1 + 2 files changed, 5 insertions(+) diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index 3b50649b..ce12fba5 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -2122,6 +2122,10 @@ VK_LAYER_EXPORT void VKAPI vkCmdBindPipeline(VkCmdBuffer cmdBuffer, VkPipelineBi if (pCB->state == CB_UPDATE_ACTIVE) { updateCBTracking(cmdBuffer); addCmd(pCB, CMD_BINDPIPELINE); + if ((VK_PIPELINE_BIND_POINT_COMPUTE == pipelineBindPoint) && (pCB->activeRenderPass)) { + log_msg(mdd(cmdBuffer), VK_DBG_REPORT_ERROR_BIT, VK_OBJECT_TYPE_PIPELINE, pipeline, 0, DRAWSTATE_INVALID_RENDERPASS_CMD, "DS", + "Incorrectly binding compute pipeline (%p) during active RenderPass (%p)", (void*)pipeline, (void*)pCB->activeRenderPass); + } PIPELINE_NODE* pPN = getPipeline(pipeline); if (pPN) { pCB->lastBoundPipeline = pipeline; diff --git a/layers/draw_state.h b/layers/draw_state.h index 9c647782..90343950 100644 --- a/layers/draw_state.h +++ b/layers/draw_state.h @@ -55,6 +55,7 @@ typedef enum _DRAW_STATE_ERROR DRAWSTATE_DEPTH_STENCIL_NOT_BOUND, // Draw submitted with no depth-stencil state object bound when depth write enabled DRAWSTATE_INDEX_BUFFER_NOT_BOUND, // Draw submitted with no depth-stencil state object bound when depth write enabled DRAWSTATE_PIPELINE_LAYOUT_MISMATCH, // Draw submitted PSO Pipeline layout that doesn't match layout from BindDescriptorSets + DRAWSTATE_INVALID_RENDERPASS_CMD, // Invalid cmd submitted while a RenderPass is active DRAWSTATE_INVALID_EXTENSION, } DRAW_STATE_ERROR; -- cgit v1.2.3