-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] track the sizes of all outstanding MTLTexture allocations and report per frame in MB, matching Vulkan implementation. #53618
Conversation
FYI @gaaclarke |
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.
Overall looks good. I just have a question about accounting for the other mip levels.
|
||
~DebugAllocatorStats() {} | ||
|
||
void Increment(size_t size); |
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: note the units of size
in a docstring.
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.
Done
|
||
void Increment(size_t size); | ||
|
||
void Decrement(size_t size); |
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.
same
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.
Done
} | ||
|
||
void DebugAllocatorStats::Decrement(size_t size) { | ||
size_.fetch_sub(size, std::memory_order_relaxed); |
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.
Do you think we should have an assert that size will not go below zero?
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.
Well since its an unsigned type, it won't go below zero 🤓
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.
Semantics! haha. It'll go below zero, but you won't like it.
} | ||
|
||
size_t DebugAllocatorStats::GetAllocationSizeMB() { | ||
return size_ * 1e-6; |
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: this is doing a conversion between 64bit floats and 64bit integers.
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.
What change are you requesting?
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.
friendly ping @gaaclarke
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.
It's not a huge deal but divide by 1_000_000
instead.
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.
Done!
@@ -212,11 +226,23 @@ static MTLStorageMode ToMTLStorageMode(StorageMode mode, | |||
} | |||
} | |||
|
|||
#ifdef IMPELLER_DEBUG | |||
if (desc.storage_mode != StorageMode::kDeviceTransient) { | |||
debug_allocater_->Increment(desc.GetByteSizeOfBaseMipLevel()); |
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.
Does this mean we aren't tracking the size of the other mip levels? That will give us quite a different result?
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.
Done
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.
lgtm, outstanding nit on an assert and double conversion
} | ||
|
||
void DebugAllocatorStats::Decrement(size_t size) { | ||
size_.fetch_sub(size, std::memory_order_relaxed); |
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.
Semantics! haha. It'll go below zero, but you won't like it.
I commented on the commit but I don't know if that shows up for you anywhere. I made a mistake with |
you fooled me , I was like ... I guess C++has this too! |
…locations and report per frame in MB, matching Vulkan implementation. (flutter/engine#53618)
…locations and report per frame in MB, matching Vulkan implementation. (flutter/engine#53618)
…locations and report per frame in MB, matching Vulkan implementation. (flutter/engine#53618)
…locations and report per frame in MB, matching Vulkan implementation. (flutter/engine#53618)
…locations and report per frame in MB, matching Vulkan implementation. (flutter/engine#53618)
…151150) flutter/engine@3456fee...fc5bc14 2024-07-01 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Output .js files as ES6 modules. (#52023)" (flutter/engine#53674) 2024-07-01 skia-flutter-autoroll@skia.org Roll Dart SDK from 21c08743ee4a to c23e58143793 (1 revision) (flutter/engine#53670) 2024-07-01 skia-flutter-autoroll@skia.org Roll Skia from ae2b97d74812 to 8375bdc6e191 (3 revisions) (flutter/engine#53669) 2024-07-01 jacksongardner@google.com Output .js files as ES6 modules. (flutter/engine#52023) 2024-07-01 skia-flutter-autoroll@skia.org Roll Skia from a62bf018429c to ae2b97d74812 (3 revisions) (flutter/engine#53668) 2024-07-01 fmil@google.com [icu] Ignores the dir `flutter/third_party/icu/patches` (flutter/engine#53667) 2024-07-01 jonahwilliams@google.com [Impeller] track the sizes of all outstanding MTLTexture allocations and report per frame in MB, matching Vulkan implementation. (flutter/engine#53618) 2024-07-01 skia-flutter-autoroll@skia.org Roll Dart SDK from 338c6d4fd9c5 to 21c08743ee4a (1 revision) (flutter/engine#53666) 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 jimgraham@google.com,rmistry@google.com,zra@google.com 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
…lutter#151150) flutter/engine@3456fee...fc5bc14 2024-07-01 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Output .js files as ES6 modules. (flutter#52023)" (flutter/engine#53674) 2024-07-01 skia-flutter-autoroll@skia.org Roll Dart SDK from 21c08743ee4a to c23e58143793 (1 revision) (flutter/engine#53670) 2024-07-01 skia-flutter-autoroll@skia.org Roll Skia from ae2b97d74812 to 8375bdc6e191 (3 revisions) (flutter/engine#53669) 2024-07-01 jacksongardner@google.com Output .js files as ES6 modules. (flutter/engine#52023) 2024-07-01 skia-flutter-autoroll@skia.org Roll Skia from a62bf018429c to ae2b97d74812 (3 revisions) (flutter/engine#53668) 2024-07-01 fmil@google.com [icu] Ignores the dir `flutter/third_party/icu/patches` (flutter/engine#53667) 2024-07-01 jonahwilliams@google.com [Impeller] track the sizes of all outstanding MTLTexture allocations and report per frame in MB, matching Vulkan implementation. (flutter/engine#53618) 2024-07-01 skia-flutter-autoroll@skia.org Roll Dart SDK from 338c6d4fd9c5 to 21c08743ee4a (1 revision) (flutter/engine#53666) 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 jimgraham@google.com,rmistry@google.com,zra@google.com 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
Flutter driver side changes for flutter/engine#53618
…r#151153) Flutter driver side changes for flutter/engine#53618
…lutter#151150) flutter/engine@3456fee...fc5bc14 2024-07-01 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Output .js files as ES6 modules. (flutter#52023)" (flutter/engine#53674) 2024-07-01 skia-flutter-autoroll@skia.org Roll Dart SDK from 21c08743ee4a to c23e58143793 (1 revision) (flutter/engine#53670) 2024-07-01 skia-flutter-autoroll@skia.org Roll Skia from ae2b97d74812 to 8375bdc6e191 (3 revisions) (flutter/engine#53669) 2024-07-01 jacksongardner@google.com Output .js files as ES6 modules. (flutter/engine#52023) 2024-07-01 skia-flutter-autoroll@skia.org Roll Skia from a62bf018429c to ae2b97d74812 (3 revisions) (flutter/engine#53668) 2024-07-01 fmil@google.com [icu] Ignores the dir `flutter/third_party/icu/patches` (flutter/engine#53667) 2024-07-01 jonahwilliams@google.com [Impeller] track the sizes of all outstanding MTLTexture allocations and report per frame in MB, matching Vulkan implementation. (flutter/engine#53618) 2024-07-01 skia-flutter-autoroll@skia.org Roll Dart SDK from 338c6d4fd9c5 to 21c08743ee4a (1 revision) (flutter/engine#53666) 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 jimgraham@google.com,rmistry@google.com,zra@google.com 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
…r#151153) Flutter driver side changes for flutter/engine#53618
Does what it says!
Fixes flutter/flutter#150936