layers: Check for valid pipeline before validating
authorTony Barbour <tony@LunarG.com>
Mon, 6 Apr 2015 17:00:38 +0000 (11:00 -0600)
committerChia-I Wu <olv@lunarg.com>
Thu, 16 Apr 2015 09:33:28 +0000 (17:33 +0800)
layers/draw_state.cpp

index bbbcb58..a1cb3c3 100644 (file)
@@ -2582,7 +2582,8 @@ XGL_LAYER_EXPORT void XGLAPI xglCmdBeginRenderPass(XGL_CMD_BUFFER cmdBuffer, con
         addCmd(pCB, CMD_BEGINRENDERPASS);
         pCB->activeRenderPass = pRenderPassBegin->renderPass;
         pCB->framebuffer = pRenderPassBegin->framebuffer;
-        validatePipelineState(pCB, XGL_PIPELINE_BIND_POINT_GRAPHICS, pCB->lastBoundPipeline);
+        if (pCB->lastBoundPipeline)
+            validatePipelineState(pCB, XGL_PIPELINE_BIND_POINT_GRAPHICS, pCB->lastBoundPipeline);
     } else {
         char str[1024];
         sprintf(str, "Attempt to use CmdBuffer %p that doesn't exist!", (void*)cmdBuffer);