Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions lglpy/timeline/data/processed_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ class GPURenderPass(GPUWorkload):
width: The workload width, in pixels.
height: The workload height, in pixels.
draw_call_count: The number of draw calls in the render pass.
subpass_count: The number of subpasses in the render pass.
attachments: The list of framebuffer attachments.
'''

Expand All @@ -319,6 +320,7 @@ def __init__(self, event: RenderstageEvent, metadata: MetadataRenderPass):
self.width = metadata.width
self.height = metadata.height
self.draw_call_count = metadata.draw_call_count
self.subpass_count = metadata.subpass_count
self.attachments = list(metadata.attachments.attachments)

def get_workload_type_name(self) -> str:
Expand All @@ -334,13 +336,15 @@ def get_key_value_properties(self) -> dict[str, str]:
Returns:
Returns the label for use in the UI.
'''
return {
'resolution': self.get_resolution_str(),
'draw count': self.get_draw_count_str(),
'attachments': self.get_attachment_present_str(),
'attachments loaded': self.get_attachment_loadop_str(),
'attachments stored': self.get_attachment_storeop_str()
}
properties = {}
properties['resolution'] = self.get_resolution_str()
properties['draw count'] = self.get_draw_count_str()
if self.subpass_count > 1:
properties['subpass count'] = self.get_subpass_count_str()
properties['attachments'] = self.get_attachment_present_str()
properties['attachments loaded'] = self.get_attachment_loadop_str()
properties['attachments stored'] = self.get_attachment_storeop_str()
return properties

def get_resolution_str(self) -> str:
'''
Expand All @@ -366,6 +370,16 @@ def get_draw_count_str(self) -> str:

return f'{self.draw_call_count} draws'

def get_subpass_count_str(self) -> str:
'''
Get the subpass count string.

Returns:
Returns the label for use in the UI.
'''
es = '' if self.subpass_count == 1 else 'es'
return f'{self.subpass_count} subpass{es}'

def get_attachment_present_str(self) -> str:
'''
Get the attachment present string.
Expand Down
1 change: 1 addition & 0 deletions lglpy/timeline/data/raw_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ def __init__(self, submit: MetadataSubmit, metadata: JSONType):
self.width = int(metadata['width'])
self.height = int(metadata['height'])
self.draw_call_count = int(metadata['drawCallCount'])
self.subpass_count = int(metadata['subpassCount'])

self.attachments = MetadataAttachments(metadata)

Expand Down
1 change: 1 addition & 0 deletions lglpy/timeline/gui/timeline/info_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ def compute_active_event_stats_single(self, event):

metrics.append(f' Stream: {stream_name}')
metrics.append(f' Stage: {stage_name}')
metrics.append(f' Start: {event.start_time / 1000000.0:0.2f} ms')
metrics.append(f' Duration: {event.duration / 1000000.0:0.2f} ms')

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