-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] GPUTracer for Metal. #46846
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie or stuartmorgan on the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
| trace_states_[current_state].pending_buffers += 1; | ||
|
|
||
| if (@available(ios 10.3, tvos 10.2, macos 10.15, macCatalyst 13.0, *)) { | ||
| [buffer addCompletedHandler:^(id<MTLCommandBuffer> buffer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this has some issues with GPUTracerMTL being deleted (or retained), but I'm not quite sure how to solve that with object-c / c++ interop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks @gaaclarke !
|
Oh, hmm, I wonder if this available check covers simulators. Need to build for sim locally and confirm |
These values will be 0 until flutter/engine#46846 and flutter/engine#46796 roll into the framework.
|
This works on Simulators! |
| namespace impeller { | ||
|
|
||
| void GPUTracerMTL::MarkFrameEnd() { | ||
| #ifdef IMPELLER_DEBUG |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit - rather than guarding each method, just don't even allocate this outside of debug?
| (state.largest_timestamp - state.smallest_timestamp) * 1000; | ||
| state.smallest_timestamp = std::numeric_limits<float>::max(); | ||
| state.largest_timestamp = 0; | ||
| FML_TRACE_COUNTER("flutter", "GPUTracer", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it should be a constant somewhere so that MTL and VK use the same one always
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where would you want this? I can put it in core?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im gonna punt on this - the trace event will probably change a few times
dnfield
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nits, LGTM
|
auto label is removed for flutter/engine/46846, due to - The status or check suite Linux linux_web_engine has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
auto label is removed for flutter/engine/46846, due to - The status or check suite Linux linux_web_engine has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. |
…136695) flutter/engine@2d55e29...2159fdb 2023-10-17 [email protected] Roll Skia from 751358929d1f to 205b728a8623 (1 revision) (flutter/engine#46982) 2023-10-17 [email protected] Revert "Fix `Platform.script` for flutter_tester" (flutter/engine#46981) 2023-10-16 [email protected] Roll Dart SDK from 12f6559bd6ed to f3e1cd38e8b0 (1 revision) (flutter/engine#46977) 2023-10-16 [email protected] Roll Fuchsia Linux SDK from 6E-cSq679DjzBMcqY... to Y9mDBoH4BSC6pWFXV... (flutter/engine#46974) 2023-10-16 [email protected] Roll Skia from 8919fecf15c1 to 751358929d1f (4 revisions) (flutter/engine#46972) 2023-10-16 [email protected] [Impeller] GPUTracer for Metal. (flutter/engine#46846) 2023-10-16 [email protected] Fix `Platform.script` for flutter_tester (flutter/engine#46911) 2023-10-16 [email protected] Roll Skia from 85c8dca08cbe to 8919fecf15c1 (1 revision) (flutter/engine#46966) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from 6E-cSq679Djz to Y9mDBoH4BSC6 If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Impelement GPU frame time tracing for metal. Unlike Vulkan, this can't use dummy cmd buffers as those don't seem to ever get an executed callback. Instead we decorate every submitted cmd buffer with tracing functionality, and min/max the timestamps to compute the range of computation time.
Impelement GPU frame time tracing for metal. Unlike Vulkan, this can't use dummy cmd buffers as those don't seem to ever get an executed callback. Instead we decorate every submitted cmd buffer with tracing functionality, and min/max the timestamps to compute the range of computation time.