From 29029f85423281a4ba8c03461e654cfcee5eaac4 Mon Sep 17 00:00:00 2001 From: Courtney Goeltzenleuchter Date: Mon, 27 Apr 2015 11:16:35 -0600 Subject: draw_state: Fix Microsoft C++ assert The C++ runtime library was issuing an assert on the following line: for (vector::iterator ii=pCB->pCmds.begin(); ii!=pCB->pCmds.end(); ++ii) { It was complaining that the iterator ii was not compatible with the pCmds.end(). Tracing down the assert, the C++ library did not like the fact that we were accessing pCmds through a pointer (pCB). If we made a local copy of the pCmds vector the assert went away. --- layers/draw_state.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'layers/draw_state.cpp') diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index af1c4787..5bfe41d4 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -1373,7 +1373,8 @@ static void printCB(const VkCmdBuffer cb) char str[1024]; sprintf(str, "Cmds in CB %p", (void*)cb); layerCbMsg(VK_DBG_MSG_UNKNOWN, VK_VALIDATION_LEVEL_0, NULL, 0, DRAWSTATE_NONE, "DS", str); - for (vector::iterator ii=pCB->pCmds.begin(); ii!=pCB->pCmds.end(); ++ii) { + vector pCmds = pCB->pCmds; + for (vector::iterator ii=pCmds.begin(); ii!=pCmds.end(); ++ii) { sprintf(str, " CMD#%lu: %s", (*ii)->cmdNumber, cmdTypeToString((*ii)->type).c_str()); layerCbMsg(VK_DBG_MSG_UNKNOWN, VK_VALIDATION_LEVEL_0, cb, 0, DRAWSTATE_NONE, "DS", str); } -- cgit v1.2.3