diff options
| author | Tobin Ehlis <tobin@lunarg.com> | 2015-09-09 13:31:01 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobin@lunarg.com> | 2015-09-09 16:32:38 -0600 |
| commit | 83f14b504ba098c34befeeaa12ae036c768bc9c1 (patch) | |
| tree | 3665612eba9ef97bb520b200b3ee263208f5bac5 | |
| parent | 8a724d8c8f0fc69457d10cd32dca7f0478c66ce9 (diff) | |
| download | usermoji-83f14b504ba098c34befeeaa12ae036c768bc9c1.tar.xz | |
layers: DrawState fix to prevent false positives when matching PipelineLayouts
Updated existing check where PipelineLayout found with vkBindDescriptorSets was always checked against PipelineLayout from PSO. Since there are cases when a Draw requires no Descriptors the check was modified for now to only occur when vkCmdBindDescriptorSets has been called. This is still not perfect but will prevent false positives.
Really need to identify when it's valid to not call vkCmdBindDescriptorSets and, if so, don't perform the PipelineLayout match check.
| -rw-r--r-- | layers/draw_state.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index 02f2e108..d97578a7 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -436,7 +436,10 @@ static VkBool32 validate_draw_state(GLOBAL_CB_NODE* pCB, VkBool32 indexedDraw) { VkBool32 result = validate_draw_state_flags(pCB, indexedDraw); PIPELINE_NODE* pPipe = getPipeline(pCB->lastBoundPipeline); // Now complete other state checks - if (pPipe && (pCB->lastBoundPipelineLayout != pPipe->graphicsPipelineCI.layout)) { + // TODO : Currently only performing next check if *something* was bound (non-zero last bound) + // There is probably a better way to gate when this check happens, and to know if something *should* have been 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; 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); |
