Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Impeller] fold memory check into allocator_vk #51187

Merged
merged 7 commits into from
Mar 6, 2024

Conversation

jonahwilliams
Copy link
Member

@jonahwilliams jonahwilliams commented Mar 4, 2024

Various cleanups to Vulkan allocator implementation:

  1. Fixes [Impeller] Track if selected heap for buffer memory is coherent, avoid flush. flutter#137454
  2. Fold device transient cap check into allocator.
  3. adds debug tracking for total memory usage in MB (a followup change needs to be made to driver to plumb it through)
  4. Small cleanups to mock vulkan so an allocator can be created from it.
  5. depth/stencil shouldn't be input attachments.

Part of flutter/flutter#144617

@jonahwilliams jonahwilliams marked this pull request as ready for review March 5, 2024 00:22
Copy link
Contributor

@matanlurey matanlurey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a little tough to review 5 changes at once, especially as I'm not super familiar. If these changes aren't interconnected I'd recommend splitting them up somewhat, if they are then I suppose it's fine 😅

// Query texture support.
// TODO(jonahwilliams):
// https://github.com/flutter/flutter/issues/129784
physical_device.getMemoryProperties(&memory_properties_);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't this already done above on line 182? Or is the scope significant somehow?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh good call. Will fix

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

for (auto i = 0u; i < memory_properties_.memoryTypeCount; i++) {
if (memory_properties_.memoryTypes[i].propertyFlags &
vk::MemoryPropertyFlagBits::eLazilyAllocated) {
supports_memoryless_textures_ = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

break after since it doesn't seem relevant to iterate through once we find one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 6, 2024
@auto-submit auto-submit bot merged commit 5bbac1a into flutter:main Mar 6, 2024
28 checks passed
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Mar 6, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 6, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Mar 6, 2024
…144714)

flutter/engine@44405ae...5bbac1a

2024-03-06 jonahwilliams@google.com [Impeller] fold memory check into allocator_vk (flutter/engine#51187)
2024-03-06 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from ujOkbeYbrC8loPbfR... to y67DIBX84h7pAekIp... (flutter/engine#51233)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from ujOkbeYbrC8l to y67DIBX84h7p

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 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
@jonahwilliams jonahwilliams added the revert Label used to revert changes in a closed and merged pull request. label Mar 6, 2024
Copy link
Contributor

auto-submit bot commented Mar 6, 2024

A reason for requesting a revert of flutter/engine/51187 could
not be found or the reason was not properly formatted. Begin a comment with 'Reason for revert:' to tell the bot why
this issue is being reverted.

@auto-submit auto-submit bot removed the revert Label used to revert changes in a closed and merged pull request. label Mar 6, 2024
@jonahwilliams jonahwilliams added the revert Label used to revert changes in a closed and merged pull request. label Mar 6, 2024
auto-submit bot pushed a commit that referenced this pull request Mar 6, 2024
@auto-submit auto-submit bot removed the revert Label used to revert changes in a closed and merged pull request. label Mar 6, 2024
auto-submit bot added a commit that referenced this pull request Mar 6, 2024
…1243)

Reverts: #51187
Initiated by: jonahwilliams
Reason for reverting: unexpected benchmark regression

https://flutter-flutter-perf.skia.org/e/?queries=device_type%3DPixel_7_Pro%26sub_result%3D90th_percentile_frame_rasterizer_time_millis%26sub_result%3D99th_percentile_frame_rasterizer_time_millis%26sub_result%3Daverage_frame_rasterizer_time_millis%26sub_result%3Dworst_frame_rasterizer_time_millis%26test%3Dnew_gallery_impeller__transition_perf&selected=commit%3D396
Original PR Author: jonahwilliams

Reviewed By: {matanlurey}

This change reverts the following previous change:
Various cleanups to Vulkan allocator implementation:

1. Fixes flutter/flutter#137454
2. Fold device transient cap check into allocator.
3. adds debug tracking for total memory usage in MB (a followup change needs to be made to driver to plumb it through)
4. Small cleanups to mock vulkan so an allocator can be created from it.
5. depth/stencil shouldn't be input attachments.

Part of flutter/flutter#144617
auto-submit bot pushed a commit that referenced this pull request Mar 7, 2024
)

Part of flutter/flutter#144617

Adds MemoryBudgetUsageMB which includes the MB of VMA allocated GPU and host memory, approximately per frame. This will be recorded in the devicelab and used to track how much memory pressure we're creating.

Split out from #51187 since that was reverted (and doing big changes is a bad idea anyway).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App e: impeller
Projects
None yet
2 participants