mirror of
https://github.com/flutter/flutter
synced 2024-10-13 19:52:53 +00:00
Shader warm-up doc fixes (#28679)
See https://github.com/flutter/flutter/pull/28614#discussion_r261422778 and https://github.com/flutter/flutter/pull/28614#pullrequestreview-209359908
This commit is contained in:
parent
ec93468a14
commit
98739667ae
|
@ -39,7 +39,7 @@ mixin PaintingBinding on BindingBase, ServicesBinding {
|
|||
/// in the middle of an animation or interaction. In that case, set
|
||||
/// [shaderWarmUp] to a custom [ShaderWarmUp] before calling [initInstances]
|
||||
/// (usually before [runApp] for normal Flutter apps, and before
|
||||
/// [enableFlutterDriverExtension] for Flutter drive tests). Paint the scene
|
||||
/// [enableFlutterDriverExtension] for Flutter driver tests). Paint the scene
|
||||
/// in the custom [ShaderWarmUp] so Flutter can pre-compile and cache the
|
||||
/// shaders during startup. The warm up is only costly (100ms-200ms,
|
||||
/// depending on the shaders to compile) during the first run after the
|
||||
|
|
|
@ -23,17 +23,18 @@ import 'package:flutter/foundation.dart';
|
|||
/// done before calling [runApp].
|
||||
///
|
||||
/// To determine whether a draw operation is useful for warming up shaders,
|
||||
/// check the difference in the `worst_frame_rasterizer_time_millis` benchmarks.
|
||||
/// Also, tracing with `flutter run --profile --trace-skia` may reveal whether
|
||||
/// there is shader-compilation-related jank. If there is such jank, some long
|
||||
/// check whether it improves the slowest GPU frame. Also, tracing with
|
||||
/// `flutter run --profile --trace-skia` may reveal whether there is shader-
|
||||
/// compilation-related jank. If there is such jank, some long
|
||||
/// `GrGLProgramBuilder::finalize` calls would appear in the middle of an
|
||||
/// animation. Their parent calls, which look like `XyzOp` (e.g., `FillRecOp`,
|
||||
/// `CircularRRectOp`) would suggest Xyz draw operations are causing the shaders
|
||||
/// to be compiled. A useful shader warm-up draw operation would eliminate such
|
||||
/// long compilation calls in the animation. To double-check the warm-up, trace
|
||||
/// with `flutter run --profile --trace-skia --start-paused`. The
|
||||
/// `GrGLProgramBuilder` with the associated `XyzOp` should appear during
|
||||
/// startup rather than in the middle of a later animation.
|
||||
/// `CircularRRectOp`) would suggest Xyz draw operations are causing the
|
||||
/// shaders to be compiled. A useful shader warm-up draw operation would
|
||||
/// eliminate such long compilation calls in the animation. To double-check
|
||||
/// the warm-up, trace with `flutter run --profile --trace-skia --start-
|
||||
/// paused`. The `GrGLProgramBuilder` with the associated `XyzOp` should
|
||||
/// appear during startup rather than in the middle of a later animation.
|
||||
|
||||
///
|
||||
/// This warm-up needs to be run on each individual device because the shader
|
||||
/// compilation depends on the specific GPU hardware and driver a device has. It
|
||||
|
|
Loading…
Reference in a new issue