| 2327 | } |
| 2328 | |
| 2329 | void TextureViewer::AddResourceUsageEntry(QMenu &menu, uint32_t start, uint32_t end, |
| 2330 | ResourceUsage usage) |
| 2331 | { |
| 2332 | QAction *item = NULL; |
| 2333 | |
| 2334 | if(start == end) |
| 2335 | item = new QAction( |
| 2336 | QFormatStr("EID %1: %2").arg(start).arg(ToQStr(usage, m_Ctx.APIProps().pipelineType)), this); |
| 2337 | else |
| 2338 | item = new QAction( |
| 2339 | QFormatStr("EID %1-%2: %3").arg(start).arg(end).arg(ToQStr(usage, m_Ctx.APIProps().pipelineType)), |
| 2340 | this); |
| 2341 | |
| 2342 | QObject::connect(item, &QAction::triggered, this, &TextureViewer::texContextItem_triggered); |
| 2343 | item->setProperty("eid", QVariant(end)); |
| 2344 | |
| 2345 | if(start <= m_Ctx.CurEvent() && m_Ctx.CurEvent() <= end) |
| 2346 | item->setIcon(Icons::flag_green()); |
| 2347 | |
| 2348 | menu.addAction(item); |
| 2349 | } |
| 2350 | |
| 2351 | void TextureViewer::OpenResourceContextMenu(ResourceId id, bool input, |
| 2352 | const rdcarray<EventUsage> &usage) |