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

Method GetCachedEIDName

qrenderdoc/Windows/EventBrowser.cpp:1212–1335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1210 }
1211
1212 QVariant GetCachedEIDName(uint32_t eid) const
1213 {
1214 auto it = m_EIDNameCache.find(eid);
1215 if(it != m_EIDNameCache.end())
1216 return it.value();
1217
1218 if(eid == 0)
1219 return tr("Capture Start");
1220
1221 if(eid >= m_Actions.size())
1222 return QVariant();
1223
1224 const ActionDescription *action = m_Actions[eid];
1225
1226 QString name;
1227
1228 // markers always use the action name no matter what (fake markers must because we don't have a
1229 // chunk to use to name them). This doesn't apply to 'marker' regions that are multiactions or
1230 // command buffer boundaries.
1231 if(action->eventId == eid)
1232 {
1233 if(m_UseCustomActionNames)
1234 {
1235 name = action->customName;
1236 }
1237 else
1238 {
1239 if((action->flags & (ActionFlags::SetMarker | ActionFlags::PushMarker)) &&
1240 !(action->flags & (ActionFlags::CommandBufferBoundary | ActionFlags::PassBoundary |
1241 ActionFlags::CmdList | ActionFlags::MultiAction)))
1242 name = action->customName;
1243 }
1244 }
1245
1246 bool forceHTML = false;
1247
1248 if(name.isEmpty())
1249 {
1250 auto eidit = std::lower_bound(action->events.begin(), action->events.end(), eid,
1251 [](const APIEvent &e, uint32_t eid) { return e.eventId < eid; });
1252
1253 if(eidit != action->events.end() && eidit->eventId == eid)
1254 {
1255 const APIEvent &e = *eidit;
1256
1257 const StructuredChunkList &chunks = m_Ctx.GetStructuredFile().chunks;
1258
1259 if(e.chunkIndex >= chunks.size())
1260 return QVariant();
1261
1262 const SDChunk *chunk = chunks[e.chunkIndex];
1263
1264 if(chunk == NULL)
1265 return QVariant();
1266
1267 name = chunk->name;
1268
1269 // don't display any "ClassName::" prefix. We keep it for the API inspector which is more

Callers

nothing calls this directly

Calls 15

QLatin1CharClass · 0.85
SDObject2VariantFunction · 0.85
trFunction · 0.50
QVariantClass · 0.50
findMethod · 0.45
endMethod · 0.45
valueMethod · 0.45
sizeMethod · 0.45
isEmptyMethod · 0.45
beginMethod · 0.45
GetStructuredFileMethod · 0.45

Tested by

no test coverage detected