| 105 | } |
| 106 | |
| 107 | func (dm *debugMarkerStack) checkDebugMarkers(label *api.Label) { |
| 108 | // It preserves Labels with no-decreasing sizes in the stack of debug_markers_begin avoiding |
| 109 | // insert debug markers in Labels with smaller sizes that would break the levels of hierarchy. |
| 110 | for dm.getSize() > 0 && label.GetSize() < dm.top().GetSize() { |
| 111 | dm.pop() |
| 112 | } |
| 113 | dm.push(label) |
| 114 | |
| 115 | if label.GetCommandName() == VK_CMD_DEBUG_MARKER_END { |
| 116 | if dm.getSize() > 0 { |
| 117 | if label.GetSize() == dm.top().GetSize() && getMaxCommonPrefix(label, dm.top()) == label.GetSize()-1 { |
| 118 | dm.addDebugMarker() |
| 119 | } |
| 120 | dm.pop() |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | func getCommandHierarchyNames() *api.HierarchyNames { |
| 126 | commandHierarchyNames := &api.HierarchyNames{BeginNameToLevel: map[string]int{}, EndNameToLevel: map[string]int{}, |