MCPcopy Create free account
hub / github.com/baldurk/renderdoc / CreateActionNode

Method CreateActionNode

qrenderdoc/Windows/EventBrowser.cpp:1089–1144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1087 }
1088
1089 ActionTreeNode CreateActionNode(const ActionDescription *action)
1090 {
1091 const rdcarray<ActionDescription> &actionRange =
1092 action ? action->children : m_Ctx.CurRootActions();
1093
1094 // account for the Capture Start row we'll add at the top level
1095 int row = action ? 0 : 1;
1096
1097 ActionTreeNode ret;
1098
1099 ret.action = action;
1100 ret.effectiveEID = actionRange.back().eventId;
1101 if(actionRange.back().flags & ActionFlags::PopMarker)
1102 ret.effectiveEID--;
1103
1104 ret.row2action[0] = 0;
1105
1106 uint32_t row2eidStride = (actionRange.count() / ActionTreeNode::Row2ActionFactor) + 1;
1107
1108 const SDFile &sdfile = m_Ctx.GetStructuredFile();
1109
1110 for(int i = 0; i < actionRange.count(); i++)
1111 {
1112 const ActionDescription &a = actionRange[i];
1113
1114 if((i % row2eidStride) == 0)
1115 ret.row2action[row] = i;
1116
1117 for(const APIEvent &e : a.events)
1118 {
1119 m_Actions.resize_for_index(e.eventId);
1120 m_Chunks.resize_for_index(e.eventId);
1121 m_Actions[e.eventId] = &a;
1122 if(e.chunkIndex != APIEvent::NoChunk && e.chunkIndex < sdfile.chunks.size())
1123 m_Chunks[e.eventId] = sdfile.chunks[e.chunkIndex];
1124 }
1125
1126 row += a.events.count();
1127
1128 if(a.children.empty())
1129 continue;
1130
1131 ActionTreeNode node = CreateActionNode(&a);
1132
1133 node.index = createIndex(row - 1, 0, a.eventId);
1134
1135 if(a.eventId == ret.effectiveEID)
1136 ret.effectiveEID = node.effectiveEID;
1137
1138 m_Nodes[a.eventId] = node;
1139 }
1140
1141 ret.rowCount = row;
1142
1143 return ret;
1144 }
1145
1146 QModelIndex GetIndexForActionChildRow(const ActionTreeNode &node, int row, int column) const

Callers

nothing calls this directly

Calls 7

createIndexFunction · 0.85
resize_for_indexMethod · 0.80
backMethod · 0.45
countMethod · 0.45
GetStructuredFileMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected