diff --git a/engine/src/flutter/ci/licenses_golden/licenses_flutter b/engine/src/flutter/ci/licenses_golden/licenses_flutter index df13666e28..74af083d28 100644 --- a/engine/src/flutter/ci/licenses_golden/licenses_flutter +++ b/engine/src/flutter/ci/licenses_golden/licenses_flutter @@ -1158,6 +1158,8 @@ ORIGIN: ../../../flutter/impeller/entity/contents/anonymous_contents.cc + ../../ ORIGIN: ../../../flutter/impeller/entity/contents/anonymous_contents.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/contents/atlas_contents.cc + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/contents/atlas_contents.h + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/impeller/entity/contents/checkerboard_contents.cc + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/impeller/entity/contents/checkerboard_contents.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/contents/clip_contents.cc + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/contents/clip_contents.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/contents/color_source_contents.cc + ../../../flutter/LICENSE @@ -1285,6 +1287,8 @@ ORIGIN: ../../../flutter/impeller/entity/shaders/color_matrix_color_filter.frag ORIGIN: ../../../flutter/impeller/entity/shaders/color_matrix_color_filter.vert + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/conical_gradient_fill.frag + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/conical_gradient_ssbo_fill.frag + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/impeller/entity/shaders/debug/checkerboard.frag + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/impeller/entity/shaders/debug/checkerboard.vert + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/gaussian_blur/gaussian_blur.glsl + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/gaussian_blur/gaussian_blur.vert + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/gaussian_blur/gaussian_blur_alpha_decal.frag + ../../../flutter/LICENSE @@ -3748,6 +3752,8 @@ FILE: ../../../flutter/impeller/entity/contents/anonymous_contents.cc FILE: ../../../flutter/impeller/entity/contents/anonymous_contents.h FILE: ../../../flutter/impeller/entity/contents/atlas_contents.cc FILE: ../../../flutter/impeller/entity/contents/atlas_contents.h +FILE: ../../../flutter/impeller/entity/contents/checkerboard_contents.cc +FILE: ../../../flutter/impeller/entity/contents/checkerboard_contents.h FILE: ../../../flutter/impeller/entity/contents/clip_contents.cc FILE: ../../../flutter/impeller/entity/contents/clip_contents.h FILE: ../../../flutter/impeller/entity/contents/color_source_contents.cc @@ -3875,6 +3881,8 @@ FILE: ../../../flutter/impeller/entity/shaders/color_matrix_color_filter.frag FILE: ../../../flutter/impeller/entity/shaders/color_matrix_color_filter.vert FILE: ../../../flutter/impeller/entity/shaders/conical_gradient_fill.frag FILE: ../../../flutter/impeller/entity/shaders/conical_gradient_ssbo_fill.frag +FILE: ../../../flutter/impeller/entity/shaders/debug/checkerboard.frag +FILE: ../../../flutter/impeller/entity/shaders/debug/checkerboard.vert FILE: ../../../flutter/impeller/entity/shaders/gaussian_blur/gaussian_blur.glsl FILE: ../../../flutter/impeller/entity/shaders/gaussian_blur/gaussian_blur.vert FILE: ../../../flutter/impeller/entity/shaders/gaussian_blur/gaussian_blur_alpha_decal.frag diff --git a/engine/src/flutter/impeller/BUILD.gn b/engine/src/flutter/impeller/BUILD.gn index dc91b18aa2..6ca7bde884 100644 --- a/engine/src/flutter/impeller/BUILD.gn +++ b/engine/src/flutter/impeller/BUILD.gn @@ -9,6 +9,10 @@ config("impeller_public_config") { defines = [] + if (impeller_debug) { + defines += [ "IMPELLER_DEBUG=1" ] + } + if (impeller_supports_rendering) { defines += [ "IMPELLER_SUPPORTS_RENDERING=1" ] } diff --git a/engine/src/flutter/impeller/aiks/aiks_unittests.cc b/engine/src/flutter/impeller/aiks/aiks_unittests.cc index 765260d28c..a2738b7262 100644 --- a/engine/src/flutter/impeller/aiks/aiks_unittests.cc +++ b/engine/src/flutter/impeller/aiks/aiks_unittests.cc @@ -2139,5 +2139,29 @@ TEST_P(AiksTest, CanRenderTinyOverlappingSubpasses) { ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture())); } +/// Tests that the debug checkerboard displays for offscreen textures when +/// enabled. Most of the complexity here is just to future proof by making pass +/// collapsing hard. +TEST_P(AiksTest, CanRenderOffscreenCheckerboard) { + Canvas canvas; + canvas.debug_options.offscreen_texture_checkerboard = true; + + canvas.DrawPaint({.color = Color::AntiqueWhite()}); + canvas.DrawCircle({400, 300}, 200, + {.color = Color::CornflowerBlue().WithAlpha(0.75)}); + + canvas.SaveLayer({.blend_mode = BlendMode::kMultiply}); + { + canvas.DrawCircle({500, 400}, 200, + {.color = Color::DarkBlue().WithAlpha(0.75)}); + canvas.DrawCircle({550, 450}, 200, + {.color = Color::LightCoral().WithAlpha(0.75), + .blend_mode = BlendMode::kLuminosity}); + } + canvas.Restore(); + + ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture())); +} + } // namespace testing } // namespace impeller diff --git a/engine/src/flutter/impeller/aiks/canvas.cc b/engine/src/flutter/impeller/aiks/canvas.cc index ae468d4c5a..5ae23036fd 100644 --- a/engine/src/flutter/impeller/aiks/canvas.cc +++ b/engine/src/flutter/impeller/aiks/canvas.cc @@ -75,6 +75,8 @@ void Canvas::Save( if (create_subpass) { entry.is_subpass = true; auto subpass = std::make_unique(); + subpass->SetEnableOffscreenCheckerboard( + debug_options.offscreen_texture_checkerboard); subpass->SetBackdropFilter(std::move(backdrop_filter)); subpass->SetBlendMode(blend_mode); current_pass_ = GetCurrentPass().AddSubpass(std::move(subpass)); diff --git a/engine/src/flutter/impeller/aiks/canvas.h b/engine/src/flutter/impeller/aiks/canvas.h index 226ef14c8c..7a6fc349b2 100644 --- a/engine/src/flutter/impeller/aiks/canvas.h +++ b/engine/src/flutter/impeller/aiks/canvas.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include #include #include @@ -29,6 +30,14 @@ class Entity; class Canvas { public: + struct DebugOptions { + /// When enabled, layers that are rendered to an offscreen texture + /// internally get a translucent checkerboard pattern painted over them. + /// + /// Requires the `IMPELLER_DEBUG` preprocessor flag. + bool offscreen_texture_checkerboard = false; + } debug_options; + Canvas(); ~Canvas(); diff --git a/engine/src/flutter/impeller/base/validation.cc b/engine/src/flutter/impeller/base/validation.cc index d3f54a7ad8..5e2e3e76b5 100644 --- a/engine/src/flutter/impeller/base/validation.cc +++ b/engine/src/flutter/impeller/base/validation.cc @@ -39,7 +39,7 @@ std::ostream& ValidationLog::GetStream() { void ImpellerValidationBreak(const char* message) { // Nothing to do. Exists for the debugger. -#if FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE +#ifdef IMPELLER_DEBUG std::stringstream stream; stream << "Break on '" << __FUNCTION__ << "' to inspect point of failure: " << message; @@ -48,7 +48,7 @@ void ImpellerValidationBreak(const char* message) { } else { FML_LOG(INFO) << stream.str(); } -#endif // FLUTTER_RUNTIME_MODE != FLUTTER_RUNTIME_MODE_RELEASE +#endif // IMPELLER_DEBUG } } // namespace impeller diff --git a/engine/src/flutter/impeller/entity/BUILD.gn b/engine/src/flutter/impeller/entity/BUILD.gn index 8e5459bc8f..91ffdae65d 100644 --- a/engine/src/flutter/impeller/entity/BUILD.gn +++ b/engine/src/flutter/impeller/entity/BUILD.gn @@ -72,6 +72,13 @@ impeller_shaders("entity_shaders") { "shaders/yuv_to_rgb_filter.vert", "shaders/blending/porter_duff_blend.frag", ] + + if (impeller_debug) { + shaders += [ + "shaders/debug/checkerboard.frag", + "shaders/debug/checkerboard.vert", + ] + } } impeller_shaders("modern_entity_shaders") { @@ -221,6 +228,13 @@ impeller_component("entity") { "inline_pass_context.h", ] + if (impeller_debug) { + sources += [ + "contents/checkerboard_contents.cc", + "contents/checkerboard_contents.h", + ] + } + public_deps = [ ":entity_shaders", ":framebuffer_blend_entity_shaders", diff --git a/engine/src/flutter/impeller/entity/contents/checkerboard_contents.cc b/engine/src/flutter/impeller/entity/contents/checkerboard_contents.cc new file mode 100644 index 0000000000..0c80a632b0 --- /dev/null +++ b/engine/src/flutter/impeller/entity/contents/checkerboard_contents.cc @@ -0,0 +1,70 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "impeller/entity/contents/checkerboard_contents.h" + +#include + +#include "impeller/core/formats.h" +#include "impeller/entity/contents/content_context.h" +#include "impeller/renderer/command.h" +#include "impeller/renderer/render_pass.h" + +namespace impeller { + +CheckerboardContents::CheckerboardContents() = default; + +CheckerboardContents::~CheckerboardContents() = default; + +bool CheckerboardContents::Render(const ContentContext& renderer, + const Entity& entity, + RenderPass& pass) const { + auto& host_buffer = pass.GetTransientsBuffer(); + + using VS = CheckerboardPipeline::VertexShader; + using FS = CheckerboardPipeline::FragmentShader; + + Command cmd; + cmd.label = "Checkerboard"; + + auto options = OptionsFromPass(pass); + options.blend_mode = BlendMode::kSourceOver; + options.stencil_compare = CompareFunction::kAlways; // Ignore all clips. + options.stencil_operation = StencilOperation::kKeep; + options.primitive_type = PrimitiveType::kTriangleStrip; + cmd.pipeline = renderer.GetCheckerboardPipeline(options); + + VertexBufferBuilder vtx_builder; + vtx_builder.AddVertices({ + {Point(-1, -1)}, + {Point(1, -1)}, + {Point(-1, 1)}, + {Point(1, 1)}, + }); + cmd.BindVertices(vtx_builder.CreateVertexBuffer(host_buffer)); + + FS::FragInfo frag_info; + frag_info.color = color_; + frag_info.square_size = square_size_; + FS::BindFragInfo(cmd, host_buffer.EmplaceUniform(frag_info)); + + pass.AddCommand(cmd); + + return true; +} + +std::optional CheckerboardContents::GetCoverage( + const Entity& entity) const { + return std::nullopt; +} + +void CheckerboardContents::SetColor(Color color) { + color_ = color; +} + +void CheckerboardContents::SetSquareSize(Scalar square_size) { + square_size_ = square_size; +} + +} // namespace impeller diff --git a/engine/src/flutter/impeller/entity/contents/checkerboard_contents.h b/engine/src/flutter/impeller/entity/contents/checkerboard_contents.h new file mode 100644 index 0000000000..c00c065249 --- /dev/null +++ b/engine/src/flutter/impeller/entity/contents/checkerboard_contents.h @@ -0,0 +1,41 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#pragma once + +#include "flutter/fml/macros.h" +#include "impeller/entity/contents/contents.h" + +namespace impeller { + +/// A special Contents that renders a translucent checkerboard pattern with a +/// random color over the entire pass texture. This is useful for visualizing +/// offscreen textures. +class CheckerboardContents final : public Contents { + public: + CheckerboardContents(); + + // |Contents| + ~CheckerboardContents() override; + + // |Contents| + bool Render(const ContentContext& renderer, + const Entity& entity, + RenderPass& pass) const override; + + // |Contents| + std::optional GetCoverage(const Entity& entity) const override; + + void SetColor(Color color); + + void SetSquareSize(Scalar square_size); + + private: + Color color_ = Color::Red().WithAlpha(0.25); + Scalar square_size_ = 12; + + FML_DISALLOW_COPY_AND_ASSIGN(CheckerboardContents); +}; + +} // namespace impeller diff --git a/engine/src/flutter/impeller/entity/contents/content_context.cc b/engine/src/flutter/impeller/entity/contents/content_context.cc index 1afde11e40..a8f1e8e541 100644 --- a/engine/src/flutter/impeller/entity/contents/content_context.cc +++ b/engine/src/flutter/impeller/entity/contents/content_context.cc @@ -170,6 +170,11 @@ ContentContext::ContentContext(std::shared_ptr context) return; } +#ifdef IMPELLER_DEBUG + checkerboard_pipelines_[{}] = + CreateDefaultPipeline(*context_); +#endif // IMPELLER_DEBUG + solid_fill_pipelines_[{}] = CreateDefaultPipeline(*context_); linear_gradient_fill_pipelines_[{}] = diff --git a/engine/src/flutter/impeller/entity/contents/content_context.h b/engine/src/flutter/impeller/entity/contents/content_context.h index 73323c9208..65941ceda1 100644 --- a/engine/src/flutter/impeller/entity/contents/content_context.h +++ b/engine/src/flutter/impeller/entity/contents/content_context.h @@ -18,6 +18,11 @@ #include "impeller/renderer/pipeline.h" #include "impeller/scene/scene_context.h" +#ifdef IMPELLER_DEBUG +#include "impeller/entity/checkerboard.frag.h" +#include "impeller/entity/checkerboard.vert.h" +#endif // IMPELLER_DEBUG + #include "impeller/entity/blend.frag.h" #include "impeller/entity/blend.vert.h" #include "impeller/entity/border_mask_blur.frag.h" @@ -103,6 +108,11 @@ namespace impeller { +#ifdef IMPELLER_DEBUG +using CheckerboardPipeline = + RenderPipelineT; +#endif // IMPELLER_DEBUG + using LinearGradientFillPipeline = RenderPipelineT; using SolidFillPipeline = @@ -327,6 +337,13 @@ class ContentContext { std::shared_ptr GetTessellator() const; +#ifdef IMPELLER_DEBUG + std::shared_ptr> GetCheckerboardPipeline( + ContentContextOptions opts) const { + return GetPipeline(checkerboard_pipelines_, opts); + } +#endif // IMPELLER_DEBUG + std::shared_ptr> GetLinearGradientFillPipeline( ContentContextOptions opts) const { return GetPipeline(linear_gradient_fill_pipelines_, opts); @@ -674,6 +691,11 @@ class ContentContext { // These are mutable because while the prototypes are created eagerly, any // variants requested from that are lazily created and cached in the variants // map. + +#ifdef IMPELLER_DEBUG + mutable Variants checkerboard_pipelines_; +#endif // IMPELLER_DEBUG + mutable Variants solid_fill_pipelines_; mutable Variants linear_gradient_fill_pipelines_; mutable Variants radial_gradient_fill_pipelines_; diff --git a/engine/src/flutter/impeller/entity/contents/contents.cc b/engine/src/flutter/impeller/entity/contents/contents.cc index c56fe8b1a6..86e32eacd0 100644 --- a/engine/src/flutter/impeller/entity/contents/contents.cc +++ b/engine/src/flutter/impeller/entity/contents/contents.cc @@ -29,12 +29,7 @@ ContentContextOptions OptionsFromPass(const RenderPass& pass) { ContentContextOptions OptionsFromPassAndEntity(const RenderPass& pass, const Entity& entity) { - ContentContextOptions opts; - opts.sample_count = pass.GetRenderTarget().GetSampleCount(); - opts.color_attachment_pixel_format = - pass.GetRenderTarget().GetRenderTargetPixelFormat(); - opts.has_stencil_attachment = - pass.GetRenderTarget().GetStencilAttachment().has_value(); + ContentContextOptions opts = OptionsFromPass(pass); opts.blend_mode = entity.GetBlendMode(); return opts; } diff --git a/engine/src/flutter/impeller/entity/entity_pass.cc b/engine/src/flutter/impeller/entity/entity_pass.cc index bad785ad90..c9a00df681 100644 --- a/engine/src/flutter/impeller/entity/entity_pass.cc +++ b/engine/src/flutter/impeller/entity/entity_pass.cc @@ -24,11 +24,16 @@ #include "impeller/entity/contents/texture_contents.h" #include "impeller/entity/entity.h" #include "impeller/entity/inline_pass_context.h" +#include "impeller/geometry/color.h" #include "impeller/geometry/path_builder.h" #include "impeller/renderer/command.h" #include "impeller/renderer/command_buffer.h" #include "impeller/renderer/render_pass.h" +#ifdef IMPELLER_DEBUG +#include "impeller/entity/contents/checkerboard_contents.h" +#endif // IMPELLER_DEBUG + namespace impeller { EntityPass::EntityPass() = default; @@ -481,23 +486,23 @@ EntityPass::EntityResult EntityPass::GetEntityForElement( return EntityPass::EntityResult::Success(element_entity); } -bool EntityPass::OnRender(ContentContext& renderer, - ISize root_pass_size, - EntityPassTarget& pass_target, - Point global_pass_position, - Point local_pass_position, - uint32_t pass_depth, - StencilCoverageStack& stencil_coverage_stack, - size_t stencil_depth_floor, - std::shared_ptr backdrop_filter_contents, - std::optional - collapsed_parent_pass) const { +bool EntityPass::OnRender( + ContentContext& renderer, + ISize root_pass_size, + EntityPassTarget& pass_target, + Point global_pass_position, + Point local_pass_position, + uint32_t pass_depth, + StencilCoverageStack& stencil_coverage_stack, + size_t stencil_depth_floor, + std::shared_ptr backdrop_filter_contents, + const std::optional& + collapsed_parent_pass) const { TRACE_EVENT0("impeller", "EntityPass::OnRender"); auto context = renderer.GetContext(); - InlinePassContext pass_context(context, pass_target, - GetTotalPassReads(renderer), - std::move(collapsed_parent_pass)); + InlinePassContext pass_context( + context, pass_target, GetTotalPassReads(renderer), collapsed_parent_pass); if (!pass_context.IsValid()) { VALIDATION_LOG << SPrintF("Pass context invalid (Depth=%d)", pass_depth); return false; @@ -725,6 +730,31 @@ bool EntityPass::OnRender(ContentContext& renderer, } } +#ifdef IMPELLER_DEBUG + //-------------------------------------------------------------------------- + /// Draw debug checkerboard over offscreen textures. + /// + + // When the pass depth is > 0, this EntityPass is being rendered to an + // offscreen texture. + if (enable_offscreen_debug_checkerboard_ && + !collapsed_parent_pass.has_value() && pass_depth > 0) { + auto result = pass_context.GetRenderPass(pass_depth); + if (!result.pass) { + // Failure to produce a render pass should be explained by specific errors + // in `InlinePassContext::GetRenderPass()`. + return false; + } + auto checkerboard = CheckerboardContents(); + auto color = ColorHSB(0, // hue + 1, // saturation + std::max(0.0, 0.6 - pass_depth / 5), // brightness + 0.25); // alpha + checkerboard.SetColor(Color(color)); + checkerboard.Render(renderer, {}, *result.pass); + } +#endif + return true; } @@ -822,4 +852,8 @@ void EntityPass::SetBackdropFilter(std::optional proc) { backdrop_filter_proc_ = std::move(proc); } +void EntityPass::SetEnableOffscreenCheckerboard(bool enabled) { + enable_offscreen_debug_checkerboard_ = enabled; +} + } // namespace impeller diff --git a/engine/src/flutter/impeller/entity/entity_pass.h b/engine/src/flutter/impeller/entity/entity_pass.h index faad3cb74e..4868128a68 100644 --- a/engine/src/flutter/impeller/entity/entity_pass.h +++ b/engine/src/flutter/impeller/entity/entity_pass.h @@ -92,6 +92,8 @@ class EntityPass { void SetBackdropFilter(std::optional proc); + void SetEnableOffscreenCheckerboard(bool enabled); + std::optional GetSubpassCoverage( const EntityPass& subpass, std::optional coverage_crop) const; @@ -196,7 +198,7 @@ class EntityPass { StencilCoverageStack& stencil_coverage_stack, size_t stencil_depth_floor = 0, std::shared_ptr backdrop_filter_contents = nullptr, - std::optional + const std::optional& collapsed_parent_pass = std::nullopt) const; /// The list of renderable items in the scene. Each of these items is @@ -209,6 +211,7 @@ class EntityPass { BlendMode blend_mode_ = BlendMode::kSourceOver; bool cover_whole_screen_ = false; Color clear_color_ = Color::BlackTransparent(); + bool enable_offscreen_debug_checkerboard_ = false; /// These values are incremented whenever something is added to the pass that /// requires reading from the backdrop texture. Currently, this can happen in diff --git a/engine/src/flutter/impeller/entity/shaders/debug/checkerboard.frag b/engine/src/flutter/impeller/entity/shaders/debug/checkerboard.frag new file mode 100644 index 0000000000..bdc77691f2 --- /dev/null +++ b/engine/src/flutter/impeller/entity/shaders/debug/checkerboard.frag @@ -0,0 +1,16 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +uniform FragInfo { + vec4 color; + float square_size; +} +frag_info; + +out vec4 frag_color; + +void main() { + vec2 square = floor(gl_FragCoord.xy / frag_info.square_size); + frag_color = mod(square.x + square.y, 2.0) * frag_info.color; +} diff --git a/engine/src/flutter/impeller/entity/shaders/debug/checkerboard.vert b/engine/src/flutter/impeller/entity/shaders/debug/checkerboard.vert new file mode 100644 index 0000000000..12942363ab --- /dev/null +++ b/engine/src/flutter/impeller/entity/shaders/debug/checkerboard.vert @@ -0,0 +1,9 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +in vec2 position; + +void main() { + gl_Position = vec4(position, 0.0, 1.0); +} diff --git a/engine/src/flutter/impeller/geometry/size.h b/engine/src/flutter/impeller/geometry/size.h index f0b3a815da..146f198f3b 100644 --- a/engine/src/flutter/impeller/geometry/size.h +++ b/engine/src/flutter/impeller/geometry/size.h @@ -118,6 +118,18 @@ struct TSize { } }; +// RHS algebraic operations with arithmetic types. + +template >> +constexpr TSize operator*(U s, const TSize& p) { + return p * s; +} + +template >> +constexpr TSize operator/(U s, const TSize& p) { + return {static_cast(s) / p.x, static_cast(s) / p.y}; +} + using Size = TSize; using ISize = TSize; diff --git a/engine/src/flutter/impeller/tools/impeller.gni b/engine/src/flutter/impeller/tools/impeller.gni index 94289cff75..c4f85e60df 100644 --- a/engine/src/flutter/impeller/tools/impeller.gni +++ b/engine/src/flutter/impeller/tools/impeller.gni @@ -8,6 +8,9 @@ import("//flutter/impeller/tools/malioc.gni") import("//flutter/testing/testing.gni") declare_args() { + impeller_debug = + flutter_runtime_mode == "debug" || flutter_runtime_mode == "profile" + # Whether the Metal backend is enabled. impeller_enable_metal = is_mac || is_ios diff --git a/engine/src/flutter/impeller/tools/malioc.json b/engine/src/flutter/impeller/tools/malioc.json index 1a8ea2116e..b258b53546 100644 --- a/engine/src/flutter/impeller/tools/malioc.json +++ b/engine/src/flutter/impeller/tools/malioc.json @@ -1578,6 +1578,137 @@ } } }, + "flutter/impeller/entity/checkerboard.frag.vkspv": { + "Mali-G78": { + "core": "Mali-G78", + "filename": "flutter/impeller/entity/checkerboard.frag.vkspv", + "has_side_effects": false, + "has_uniform_computation": true, + "modifies_coverage": false, + "reads_color_buffer": false, + "type": "Fragment", + "uses_late_zs_test": false, + "uses_late_zs_update": false, + "variants": { + "Main": { + "fp16_arithmetic": 0, + "has_stack_spilling": false, + "performance": { + "longest_path_bound_pipelines": [ + "load_store" + ], + "longest_path_cycles": [ + 0.171875, + 0.171875, + 0.140625, + 0.0625, + 1.0, + 0.0, + 0.0 + ], + "pipelines": [ + "arith_total", + "arith_fma", + "arith_cvt", + "arith_sfu", + "load_store", + "varying", + "texture" + ], + "shortest_path_bound_pipelines": [ + "load_store" + ], + "shortest_path_cycles": [ + 0.171875, + 0.171875, + 0.140625, + 0.0625, + 1.0, + 0.0, + 0.0 + ], + "total_bound_pipelines": [ + "load_store" + ], + "total_cycles": [ + 0.171875, + 0.171875, + 0.140625, + 0.0625, + 1.0, + 0.0, + 0.0 + ] + }, + "stack_spill_bytes": 0, + "thread_occupancy": 100, + "uniform_registers_used": 8, + "work_registers_used": 7 + } + } + } + }, + "flutter/impeller/entity/checkerboard.vert.vkspv": { + "Mali-G78": { + "core": "Mali-G78", + "filename": "flutter/impeller/entity/checkerboard.vert.vkspv", + "has_uniform_computation": false, + "type": "Vertex", + "variants": { + "Position": { + "fp16_arithmetic": null, + "has_stack_spilling": false, + "performance": { + "longest_path_bound_pipelines": [ + "load_store" + ], + "longest_path_cycles": [ + 0.0, + 0.0, + 0.0, + 0.0, + 2.0, + 0.0 + ], + "pipelines": [ + "arith_total", + "arith_fma", + "arith_cvt", + "arith_sfu", + "load_store", + "texture" + ], + "shortest_path_bound_pipelines": [ + "load_store" + ], + "shortest_path_cycles": [ + 0.0, + 0.0, + 0.0, + 0.0, + 2.0, + 0.0 + ], + "total_bound_pipelines": [ + "load_store" + ], + "total_cycles": [ + 0.0, + 0.0, + 0.0, + 0.0, + 2.0, + 0.0 + ] + }, + "stack_spill_bytes": 0, + "thread_occupancy": 100, + "uniform_registers_used": 8, + "work_registers_used": 32 + } + } + } + }, "flutter/impeller/entity/color_matrix_color_filter.frag.vkspv": { "Mali-G78": { "core": "Mali-G78", @@ -6035,6 +6166,227 @@ } } }, + "flutter/impeller/entity/gles/checkerboard.frag.gles": { + "Mali-G78": { + "core": "Mali-G78", + "filename": "flutter/impeller/entity/gles/checkerboard.frag.gles", + "has_side_effects": false, + "has_uniform_computation": true, + "modifies_coverage": false, + "reads_color_buffer": false, + "type": "Fragment", + "uses_late_zs_test": false, + "uses_late_zs_update": false, + "variants": { + "Main": { + "fp16_arithmetic": 0, + "has_stack_spilling": false, + "performance": { + "longest_path_bound_pipelines": [ + "load_store" + ], + "longest_path_cycles": [ + 0.265625, + 0.265625, + 0.171875, + 0.0625, + 1.0, + 0.0, + 0.0 + ], + "pipelines": [ + "arith_total", + "arith_fma", + "arith_cvt", + "arith_sfu", + "load_store", + "varying", + "texture" + ], + "shortest_path_bound_pipelines": [ + "load_store" + ], + "shortest_path_cycles": [ + 0.265625, + 0.265625, + 0.140625, + 0.0625, + 1.0, + 0.0, + 0.0 + ], + "total_bound_pipelines": [ + "load_store" + ], + "total_cycles": [ + 0.265625, + 0.265625, + 0.171875, + 0.0625, + 1.0, + 0.0, + 0.0 + ] + }, + "stack_spill_bytes": 0, + "thread_occupancy": 100, + "uniform_registers_used": 14, + "work_registers_used": 20 + } + } + }, + "Mali-T880": { + "core": "Mali-T880", + "filename": "flutter/impeller/entity/gles/checkerboard.frag.gles", + "has_uniform_computation": false, + "type": "Fragment", + "variants": { + "Main": { + "has_stack_spilling": false, + "performance": { + "longest_path_bound_pipelines": [ + "arithmetic" + ], + "longest_path_cycles": [ + 1.9800000190734863, + 1.0, + 0.0 + ], + "pipelines": [ + "arithmetic", + "load_store", + "texture" + ], + "shortest_path_bound_pipelines": [ + "arithmetic" + ], + "shortest_path_cycles": [ + 1.9800000190734863, + 1.0, + 0.0 + ], + "total_bound_pipelines": [ + "arithmetic" + ], + "total_cycles": [ + 2.3333332538604736, + 1.0, + 0.0 + ] + }, + "thread_occupancy": 100, + "uniform_registers_used": 2, + "work_registers_used": 2 + } + } + } + }, + "flutter/impeller/entity/gles/checkerboard.vert.gles": { + "Mali-G78": { + "core": "Mali-G78", + "filename": "flutter/impeller/entity/gles/checkerboard.vert.gles", + "has_uniform_computation": false, + "type": "Vertex", + "variants": { + "Position": { + "fp16_arithmetic": null, + "has_stack_spilling": false, + "performance": { + "longest_path_bound_pipelines": [ + "load_store" + ], + "longest_path_cycles": [ + 0.015625, + 0.0, + 0.015625, + 0.0, + 2.0, + 0.0 + ], + "pipelines": [ + "arith_total", + "arith_fma", + "arith_cvt", + "arith_sfu", + "load_store", + "texture" + ], + "shortest_path_bound_pipelines": [ + "load_store" + ], + "shortest_path_cycles": [ + 0.015625, + 0.0, + 0.015625, + 0.0, + 2.0, + 0.0 + ], + "total_bound_pipelines": [ + "load_store" + ], + "total_cycles": [ + 0.015625, + 0.0, + 0.015625, + 0.0, + 2.0, + 0.0 + ] + }, + "stack_spill_bytes": 0, + "thread_occupancy": 100, + "uniform_registers_used": 8, + "work_registers_used": 32 + } + } + }, + "Mali-T880": { + "core": "Mali-T880", + "filename": "flutter/impeller/entity/gles/checkerboard.vert.gles", + "has_uniform_computation": false, + "type": "Vertex", + "variants": { + "Main": { + "has_stack_spilling": false, + "performance": { + "longest_path_bound_pipelines": [ + "load_store" + ], + "longest_path_cycles": [ + 1.3200000524520874, + 3.0, + 0.0 + ], + "pipelines": [ + "arithmetic", + "load_store", + "texture" + ], + "shortest_path_bound_pipelines": [ + "load_store" + ], + "shortest_path_cycles": [ + 1.3200000524520874, + 3.0, + 0.0 + ], + "total_bound_pipelines": [ + "load_store" + ], + "total_cycles": [ + 1.3333333730697632, + 3.0, + 0.0 + ] + }, + "thread_occupancy": 100, + "uniform_registers_used": 2, + "work_registers_used": 2 + } + } + } + }, "flutter/impeller/entity/gles/color_matrix_color_filter.frag.gles": { "Mali-G78": { "core": "Mali-G78",