aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <courtney@LunarG.com>2015-04-27 11:16:35 -0600
committerCourtney Goeltzenleuchter <courtney@LunarG.com>2015-04-29 11:25:22 -0600
commit29029f85423281a4ba8c03461e654cfcee5eaac4 (patch)
tree6211ac7e9f0853ed41cff041dd4f468204adc95a
parent586bbe3500b36a34df03760bc7aa149184ad4ede (diff)
downloadusermoji-29029f85423281a4ba8c03461e654cfcee5eaac4.tar.xz
draw_state: Fix Microsoft C++ assert
The C++ runtime library was issuing an assert on the following line: for (vector<CMD_NODE*>::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.
-rw-r--r--layers/draw_state.cpp3
1 files changed, 2 insertions, 1 deletions
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<CMD_NODE*>::iterator ii=pCB->pCmds.begin(); ii!=pCB->pCmds.end(); ++ii) {
+ vector<CMD_NODE*> pCmds = pCB->pCmds;
+ for (vector<CMD_NODE*>::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);
}