## Description
This PR completes the documentation for `RasterStatus::kSkipAndRetry` in the `compositor_context.h` file. The previous comment ended abruptly, leaving ambiguity regarding the behavior when the thread merger is disabled.
### Changes:
- Added clarification on the behavior when the thread merger is disabled.
- Explained the potential performance implications when threads are not merged.
## Related Issues
https://github.com/flutter/flutter/issues/131814
## Tests
No tests were added as this PR only involves documentation changes.
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Reverts flutter/engine#45097
Many failures on CI like:
```
ld: warning: ignoring file ../../../../out/ios_debug_sim_arm64_extension_safe/libocmock_shared.dylib, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
ld: warning: ignoring file ../../../../out/ios_debug_sim_arm64_extension_safe/libios_test_flutter.dylib, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64
```
https://ci.chromium.org/ui/p/flutter/builders/prod/Mac%20Production%20Engine%20Drone/131188/overview
Not sure if there are also other tests failing in different ways.
We call allocateAndBindDescriptorSets once for every cmd rendered, so this time can bubble up quite a bit. From the traces I've gathered map emplacement (emplace_unique_key_args) and std::vector growth (__push_back_slow_path) contribute the most to this trace.
I think we have physical limits on the number of descriptors we can bind, though I'm not sure if we enforce that anywhere?
This refactor makes recycling render passes easier since it starts to
split out setting the layout of textures with creating the render pass
description.
I didn't fully implement the split since it would technically be slower.
Until we get caching of render passes working it would require us to
calculate the attachment descriptions twice, once to make the render
pass and once to set the texture layout.
teases out some of the work from:
https://github.com/flutter/engine/pull/44527
in the service of implementing:
https://github.com/flutter/engine/pull/44861
issue: https://github.com/flutter/flutter/issues/133182
The final split will have this function for recycled render passes:
```c++
void SetTextureLayouts(const RenderTarget& render_target,
const std::shared_ptr<CommandBufferVK>& command_buffer) {
for (const auto& [bind_point, color] : render_target.GetColorAttachments()) {
SetTextureLayout(color,
CreateAttachmentDescription(color, &Attachment::texture),
command_buffer, &Attachment::texture);
if (color.resolve_texture) {
SetTextureLayout(
color,
CreateAttachmentDescription(color, &Attachment::resolve_texture),
command_buffer, &Attachment::resolve_texture);
}
}
if (auto depth = render_target.GetDepthAttachment(); depth.has_value()) {
SetTextureLayout(
depth.value(),
CreateAttachmentDescription(depth.value(), &Attachment::texture),
command_buffer, &Attachment::texture);
}
if (auto stencil = render_target.GetStencilAttachment();
stencil.has_value()) {
SetTextureLayout(
stencil.value(),
CreateAttachmentDescription(stencil.value(), &Attachment::texture),
command_buffer, &Attachment::texture);
}
}
```
## Pre-launch Checklist
- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or Hixie said the PR is test-exempt. See [testing the engine]
for instructions on writing and running engine tests.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel
on [Discord].
<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
Reverts flutter/engine#45029
It appears this is causing a regression in the length of time some of our integration tests are taking, causing them to take twice as long, which is causing timeouts in CI. We should revert while we investigate.
This flag removes some code from CanvasKit to reduce size by a little bit. I went ahead and did a run of the benchmarks (https://github.com/flutter/flutter/pull/133208) to see if it negatively affected anything, and there was no difference beyond noise between the current benchmark numbers and the benchmarks with this flag enabled.
The size differences are as follows:
Before the change:
```
total 30616
drwxr-xr-x 11 jacksongardner primarygroup 352 Aug 23 14:33 .
drwxr-xr-x 7 jacksongardner primarygroup 224 Aug 10 18:14 ..
-rw-r--r--@ 1 jacksongardner primarygroup 6148 May 12 17:41 .DS_Store
-rw-r--r-- 2 jacksongardner primarygroup 94899 Aug 23 14:23 canvaskit.js
-rwxr-xr-x 2 jacksongardner primarygroup 6631693 Aug 23 14:23 canvaskit.wasm
-rwxr-xr-x 1 jacksongardner primarygroup 2102151 Aug 23 14:23 canvaskit.wasm.br
drwxr-xr-x 5 jacksongardner primarygroup 160 Aug 23 14:33 chromium
-rw-r--r-- 2 jacksongardner primarygroup 161478 Aug 23 14:28 skwasm.js
-rwxr-xr-x 2 jacksongardner primarygroup 3296038 Aug 23 14:28 skwasm.wasm
-rwxr-xr-x 1 jacksongardner primarygroup 1101502 Aug 23 14:28 skwasm.wasm.br
-rw-r--r-- 2 jacksongardner primarygroup 3095 Aug 23 14:28 skwasm.worker.js
./chromium:
total 15520
drwxr-xr-x 5 jacksongardner primarygroup 160 Aug 23 14:33 .
drwxr-xr-x 11 jacksongardner primarygroup 352 Aug 23 14:33 ..
-rw-r--r-- 2 jacksongardner primarygroup 94545 Aug 23 14:25 canvaskit.js
-rwxr-xr-x 2 jacksongardner primarygroup 5223378 Aug 23 14:25 canvaskit.wasm
-rwxr-xr-x 1 jacksongardner primarygroup 1492433 Aug 23 14:25 canvaskit.wasm.br
```
After the change:
```
total 28568
drwxr-xr-x 11 jacksongardner primarygroup 352 Aug 23 14:42 .
drwxr-xr-x 7 jacksongardner primarygroup 224 Aug 10 18:14 ..
-rw-r--r--@ 1 jacksongardner primarygroup 6148 May 12 17:41 .DS_Store
-rw-r--r-- 2 jacksongardner primarygroup 94899 Aug 23 14:37 canvaskit.js
-rwxr-xr-x 2 jacksongardner primarygroup 6401703 Aug 23 14:37 canvaskit.wasm
-rwxr-xr-x 1 jacksongardner primarygroup 2038390 Aug 23 14:37 canvaskit.wasm.br
drwxr-xr-x 5 jacksongardner primarygroup 160 Aug 23 14:42 chromium
-rw-r--r-- 2 jacksongardner primarygroup 161478 Aug 23 14:41 skwasm.js
-rwxr-xr-x 2 jacksongardner primarygroup 3143431 Aug 23 14:41 skwasm.wasm
-rwxr-xr-x 1 jacksongardner primarygroup 1050854 Aug 23 14:41 skwasm.wasm.br
-rw-r--r-- 2 jacksongardner primarygroup 3095 Aug 23 14:41 skwasm.worker.js
./chromium:
total 15392
drwxr-xr-x 5 jacksongardner primarygroup 160 Aug 23 14:42 .
drwxr-xr-x 11 jacksongardner primarygroup 352 Aug 23 14:42 ..
-rw-r--r-- 2 jacksongardner primarygroup 94545 Aug 23 14:39 canvaskit.js
-rwxr-xr-x 2 jacksongardner primarygroup 4993586 Aug 23 14:39 canvaskit.wasm
-rwxr-xr-x 1 jacksongardner primarygroup 1427979 Aug 23 14:39 canvaskit.wasm.br
```
The brotli-compressed wasm modules save about 50-70kb each with this flag.
The metal backend is the only backend that doesn't treat binding the vertex buffer specially. For the GLES and Vulkan backend, we can instead pull it out of the cmd map entirely.
This will make it easier to partially inline the map into the bindings object.
https://github.com/flutter/flutter/issues/133199
â¦r creation. (#44837)"
This reverts commit 539e3833d2a2b9d89ba813c97f2951c07fc84275.
*Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.*
*List which issues are fixed by this PR. You must list at least one issue.*
These trace events aren't super useful, since we've tracked down the issues as either 1) phone is overloaded due to image decoding at large size or 2) https://github.com/flutter/flutter/issues/133198
Weekend project! Press `C` to capture in the Aiks playground.
Decided to finally give this a go and attempt to relieve some of the print debugging/mindfuck around investigation of coverage-related issues lately. :)
Captures:
* Capture documents from anywhere in Impeller.
* Easily implement inspectors for those documents.
* Replay documents with live editing.
* No overhead when capturing is build time disabled (that's the idea, anyway).
* Low overhead when capturing is runtime disabled.
Aiks inspector:
* Outline passes and rendered entities.
* Identify collapsed passes.
* Visibly highlight coverage.
* Live edit scene properties.
Possible future work:
* Filters!
* Blend mode property.
* Pointer + release proc property.
* Support captures in the DL playground.
* Text atlas visualization.
* Multi-frame capture and scrubbing.
* Menus instead of key bindings?
https://github.com/flutter/engine/assets/919017/a7a63e24-f72f-4140-a21e-6ca02a05fc20
In the change here b653a2823f, an intentional ABI breaking change was introduced to the clang runtime library for macOS and iOS. That change caused a symbol requiring dynamic linkage to be exposed that triggers iOS App Store checks for usage of private API.
This PR resolves that issue by rolling clang forward and introducing a definition of `_availability_version_check`. The declaration with weak linkage in the clang runtime library [here](b653a2823f/compiler-rt/lib/builtins/os_version_check.c (L89)) will then be resolved against the definition introduced in this PR. Since the declaration in the clang runtime library will now be resolved by static linking, the Flutter dylib will no longer require it to be dynamically linked, and will therefore not trigger the App Store check for using private API.
The definition of `_availability_version_check` is implemented using the `dlsym` strategy used by the old version of clang [here](f9ac557567/compiler-rt/lib/builtins/os_version_check.c (L97)).
Fixes https://github.com/flutter/flutter/issues/132130
Follow up from https://github.com/flutter/engine/pull/44990
We're spending a ton of time deallocating mostly empty maps, by reducing the number of maps we reduce the amount of memory used, and reduce map lookups.