-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Encode directly to command buffer for Metal. #49785
[Impeller] Encode directly to command buffer for Metal. #49785
Conversation
Requires #49780 since these touch most of the same code. |
MTLRenderPassDescriptor* desc_ = nil; | ||
std::string label_; | ||
bool is_metal_trace_active_ = false; |
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.
TODO: this
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
raster_message_loop_->PostTaskToAllWorkers([]() { | ||
// See https://github.com/flutter/flutter/issues/65752 | ||
// Intentionally opt out of QoS for raster task workloads. | ||
[[NSThread currentThread] setThreadPriority:1.0]; |
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.
Get rid of the corresponding Foundation.h header import above?
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 should be no change to rendering if this caching was | ||
/// absent. | ||
/// | ||
struct PassBindingsCache { |
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.
Move to its own TU and rename as PassBindingsCacheMTL
.
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
bool has_valid_pipeline_ = false; | ||
bool has_label_ = false; | ||
BufferView index_buffer_; | ||
PrimitiveType primitive_type_; |
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.
Default this ivars.
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
…ne into direct_encoding_metal
This reverts commit 8818531.
a20fc81
to
3470e36
Compare
…141917) flutter/engine@53a2436...4d67f26 2024-01-20 jonahwilliams@google.com [Impeller] Encode directly to command buffer for Metal. (flutter/engine#49785) 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 jonahwilliams@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
Part of flutter/flutter#140804
Rather than using impeller::Command, the impeller::RenderPass records most state directly into the Vulkan command buffer. This should remove allocation/free overhead of the intermediary structures and make further improvements to the backend even easier.
This completely removes the background worker threads used for encoding, which should lower overall CPU usage without decreasing performance by much (though it may be a tad slower or a tad faster).