-
Notifications
You must be signed in to change notification settings - Fork 29.1k
Closed
flutter/engine
#47808Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work liste: impellerImpeller rendering backend issues and features requestsImpeller rendering backend issues and features requestsengineflutter/engine repository. See also e: labels.flutter/engine repository. See also e: labels.team-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Description
Consider the following example:
code
import 'dart:ui';
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
const kSigma = 1.0;
const kNumberOfBlurs = 6;
class _Blur extends StatelessWidget {
const _Blur();
@override
Widget build(BuildContext context) {
return ClipRRect(
child: BackdropFilter(
blendMode: BlendMode.srcIn,
filter: ImageFilter.blur(
sigmaX: kSigma,
sigmaY: kSigma,
),
child: Container(
color: Colors.red.withAlpha(30),
child: const Text('Blur'),
),
),
);
}
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Stack(
children: [
ListView.builder(
itemBuilder: (context, index) {
return Container(
padding: const EdgeInsets.all(10),
child: Text('Item $index'),
);
},
itemCount: 1000),
for (var i = 0; i < kNumberOfBlurs; ++i) ...[
Positioned(
left: 0,
right: 0,
top: i * 150,
height: 60,
child: const _Blur(),
),
]
],
),
),
);
}
}
It has 6 blur backdrops with sigma=1 (to focus on render pass overhead and not blur filter performance).
This is the performance on A15 (iPhone 13 Pro) with wide gamut disabled:
I tried couple of things to figure out why the regression is so large:
I noticed that there is quite a lot of texture allocation per frame. Caching textures improved the frame time by around 1-1.5ms.
Biggest bottleneck by far seems to be the blits for MSAA backdrop
. They take around 80% of frame time.
Disabling MSAA backdrop
(reverting back to LoadAction::kLoad
+ StoreAction::kStoreAndMultisampleResolve
/kMultisampleResolve
) seems to improve the performance considerably:
Lev09
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work liste: impellerImpeller rendering backend issues and features requestsImpeller rendering backend issues and features requestsengineflutter/engine repository. See also e: labels.flutter/engine repository. See also e: labels.team-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team