Skip to content

Commit 0653762

Browse files
authored
Timeline viewer: Add subpass count to info panel (#128)
1 parent 121726a commit 0653762

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

lglpy/timeline/data/processed_trace.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ class GPURenderPass(GPUWorkload):
301301
width: The workload width, in pixels.
302302
height: The workload height, in pixels.
303303
draw_call_count: The number of draw calls in the render pass.
304+
subpass_count: The number of subpasses in the render pass.
304305
attachments: The list of framebuffer attachments.
305306
'''
306307

@@ -319,6 +320,7 @@ def __init__(self, event: RenderstageEvent, metadata: MetadataRenderPass):
319320
self.width = metadata.width
320321
self.height = metadata.height
321322
self.draw_call_count = metadata.draw_call_count
323+
self.subpass_count = metadata.subpass_count
322324
self.attachments = list(metadata.attachments.attachments)
323325

324326
def get_workload_type_name(self) -> str:
@@ -334,13 +336,15 @@ def get_key_value_properties(self) -> dict[str, str]:
334336
Returns:
335337
Returns the label for use in the UI.
336338
'''
337-
return {
338-
'resolution': self.get_resolution_str(),
339-
'draw count': self.get_draw_count_str(),
340-
'attachments': self.get_attachment_present_str(),
341-
'attachments loaded': self.get_attachment_loadop_str(),
342-
'attachments stored': self.get_attachment_storeop_str()
343-
}
339+
properties = {}
340+
properties['resolution'] = self.get_resolution_str()
341+
properties['draw count'] = self.get_draw_count_str()
342+
if self.subpass_count > 1:
343+
properties['subpass count'] = self.get_subpass_count_str()
344+
properties['attachments'] = self.get_attachment_present_str()
345+
properties['attachments loaded'] = self.get_attachment_loadop_str()
346+
properties['attachments stored'] = self.get_attachment_storeop_str()
347+
return properties
344348

345349
def get_resolution_str(self) -> str:
346350
'''
@@ -366,6 +370,16 @@ def get_draw_count_str(self) -> str:
366370

367371
return f'{self.draw_call_count} draws'
368372

373+
def get_subpass_count_str(self) -> str:
374+
'''
375+
Get the subpass count string.
376+
377+
Returns:
378+
Returns the label for use in the UI.
379+
'''
380+
es = '' if self.subpass_count == 1 else 'es'
381+
return f'{self.subpass_count} subpass{es}'
382+
369383
def get_attachment_present_str(self) -> str:
370384
'''
371385
Get the attachment present string.

lglpy/timeline/data/raw_trace.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ def __init__(self, submit: MetadataSubmit, metadata: JSONType):
347347
self.width = int(metadata['width'])
348348
self.height = int(metadata['height'])
349349
self.draw_call_count = int(metadata['drawCallCount'])
350+
self.subpass_count = int(metadata['subpassCount'])
350351

351352
self.attachments = MetadataAttachments(metadata)
352353

lglpy/timeline/gui/timeline/info_widget.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ def compute_active_event_stats_single(self, event):
320320

321321
metrics.append(f' Stream: {stream_name}')
322322
metrics.append(f' Stage: {stage_name}')
323+
metrics.append(f' Start: {event.start_time / 1000000.0:0.2f} ms')
323324
metrics.append(f' Duration: {event.duration / 1000000.0:0.2f} ms')
324325

325326
for key, value in event.get_key_value_properties().items():

0 commit comments

Comments
 (0)