From 89f27d1edaefc001daf363076c66f8109d7fa103 Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Thu, 2 May 2024 13:28:35 -0700 Subject: [PATCH] [Impeller] Remove checkerboard. (flutter/engine#52524) I added this feature a long time ago on a rainy afternoon, and @gaaclarke mentioned that it's being removed from the framework anyway. We should just remove this if that's the case. --- .../flutter/ci/licenses_golden/excluded_files | 1 - .../ci/licenses_golden/licenses_flutter | 8 - .../flutter/impeller/aiks/aiks_unittests.cc | 24 -- engine/src/flutter/impeller/aiks/canvas.cc | 2 - engine/src/flutter/impeller/aiks/canvas.h | 8 - engine/src/flutter/impeller/entity/BUILD.gn | 15 - .../entity/contents/checkerboard_contents.cc | 64 ---- .../entity/contents/checkerboard_contents.h | 45 --- .../checkerboard_contents_unittests.cc | 58 --- .../contents/clip_contents_unittests.cc | 1 - .../entity/contents/content_context.cc | 4 - .../entity/contents/content_context.h | 21 -- .../flutter/impeller/entity/entity_pass.cc | 33 -- .../src/flutter/impeller/entity/entity_pass.h | 3 - .../entity/shaders/debug/checkerboard.frag | 18 - .../entity/shaders/debug/checkerboard.vert | 9 - .../shader_stage_compatibility_checker.h | 8 - engine/src/flutter/impeller/tools/malioc.json | 352 ------------------ .../testing/impeller_golden_tests_output.txt | 3 - 19 files changed, 677 deletions(-) delete mode 100644 engine/src/flutter/impeller/entity/contents/checkerboard_contents.cc delete mode 100644 engine/src/flutter/impeller/entity/contents/checkerboard_contents.h delete mode 100644 engine/src/flutter/impeller/entity/contents/checkerboard_contents_unittests.cc delete mode 100644 engine/src/flutter/impeller/entity/shaders/debug/checkerboard.frag delete mode 100644 engine/src/flutter/impeller/entity/shaders/debug/checkerboard.vert diff --git a/engine/src/flutter/ci/licenses_golden/excluded_files b/engine/src/flutter/ci/licenses_golden/excluded_files index e18be4cb23..b92e0fea6d 100644 --- a/engine/src/flutter/ci/licenses_golden/excluded_files +++ b/engine/src/flutter/ci/licenses_golden/excluded_files @@ -143,7 +143,6 @@ ../../../flutter/impeller/display_list/dl_unittests.cc ../../../flutter/impeller/display_list/skia_conversions_unittests.cc ../../../flutter/impeller/docs -../../../flutter/impeller/entity/contents/checkerboard_contents_unittests.cc ../../../flutter/impeller/entity/contents/clip_contents_unittests.cc ../../../flutter/impeller/entity/contents/content_context_unittests.cc ../../../flutter/impeller/entity/contents/filters/gaussian_blur_filter_contents_unittests.cc diff --git a/engine/src/flutter/ci/licenses_golden/licenses_flutter b/engine/src/flutter/ci/licenses_golden/licenses_flutter index f8bc98d099..92405fcf72 100644 --- a/engine/src/flutter/ci/licenses_golden/licenses_flutter +++ b/engine/src/flutter/ci/licenses_golden/licenses_flutter @@ -40358,8 +40358,6 @@ 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 @@ -40478,8 +40476,6 @@ ORIGIN: ../../../flutter/impeller/entity/shaders/blending/porter_duff_blend.vert ORIGIN: ../../../flutter/impeller/entity/shaders/blending/vertices_uber.frag + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/clip.frag + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/clip.vert + ../../../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/filters/border_mask_blur.frag + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/filters/color_matrix_color_filter.frag + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/filters/filter_position.vert + ../../../flutter/LICENSE @@ -43245,8 +43241,6 @@ 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 @@ -43365,8 +43359,6 @@ FILE: ../../../flutter/impeller/entity/shaders/blending/porter_duff_blend.vert FILE: ../../../flutter/impeller/entity/shaders/blending/vertices_uber.frag FILE: ../../../flutter/impeller/entity/shaders/clip.frag FILE: ../../../flutter/impeller/entity/shaders/clip.vert -FILE: ../../../flutter/impeller/entity/shaders/debug/checkerboard.frag -FILE: ../../../flutter/impeller/entity/shaders/debug/checkerboard.vert FILE: ../../../flutter/impeller/entity/shaders/filters/border_mask_blur.frag FILE: ../../../flutter/impeller/entity/shaders/filters/color_matrix_color_filter.frag FILE: ../../../flutter/impeller/entity/shaders/filters/filter_position.vert diff --git a/engine/src/flutter/impeller/aiks/aiks_unittests.cc b/engine/src/flutter/impeller/aiks/aiks_unittests.cc index 5bf6cb10c0..61d22cab72 100644 --- a/engine/src/flutter/impeller/aiks/aiks_unittests.cc +++ b/engine/src/flutter/impeller/aiks/aiks_unittests.cc @@ -2218,30 +2218,6 @@ 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())); -} - TEST_P(AiksTest, OpaqueEntitiesGetCoercedToSource) { Canvas canvas; canvas.Scale(Vector2(1.618, 1.618)); diff --git a/engine/src/flutter/impeller/aiks/canvas.cc b/engine/src/flutter/impeller/aiks/canvas.cc index 0528013b3d..4692d11098 100644 --- a/engine/src/flutter/impeller/aiks/canvas.cc +++ b/engine/src/flutter/impeller/aiks/canvas.cc @@ -227,8 +227,6 @@ void Canvas::Save(bool create_subpass, if (create_subpass) { entry.rendering_mode = Entity::RenderingMode::kSubpass; auto subpass = std::make_unique(); - subpass->SetEnableOffscreenCheckerboard( - debug_options.offscreen_texture_checkerboard); if (backdrop_filter) { EntityPass::BackdropFilterProc backdrop_filter_proc = [backdrop_filter = backdrop_filter->Clone()]( diff --git a/engine/src/flutter/impeller/aiks/canvas.h b/engine/src/flutter/impeller/aiks/canvas.h index fff12a8a47..c8a814a235 100644 --- a/engine/src/flutter/impeller/aiks/canvas.h +++ b/engine/src/flutter/impeller/aiks/canvas.h @@ -60,14 +60,6 @@ class Canvas { public: static constexpr uint32_t kMaxDepth = 1 << 24; - 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(); explicit Canvas(Rect cull_rect); diff --git a/engine/src/flutter/impeller/entity/BUILD.gn b/engine/src/flutter/impeller/entity/BUILD.gn index 2038888652..9bd3fb78df 100644 --- a/engine/src/flutter/impeller/entity/BUILD.gn +++ b/engine/src/flutter/impeller/entity/BUILD.gn @@ -49,13 +49,6 @@ impeller_shaders("entity_shaders") { "shaders/filters/morphology_filter.frag", "shaders/blending/vertices_uber.frag", ] - - if (impeller_debug) { - shaders += [ - "shaders/debug/checkerboard.frag", - "shaders/debug/checkerboard.vert", - ] - } } impeller_shaders("modern_entity_shaders") { @@ -208,13 +201,6 @@ impeller_component("entity") { "render_target_cache.h", ] - if (impeller_debug) { - sources += [ - "contents/checkerboard_contents.cc", - "contents/checkerboard_contents.h", - ] - } - public_deps = [ ":entity_shaders", ":framebuffer_blend_entity_shaders", @@ -252,7 +238,6 @@ impeller_component("entity_unittests") { testonly = true sources = [ - "contents/checkerboard_contents_unittests.cc", "contents/clip_contents_unittests.cc", "contents/content_context_unittests.cc", "contents/filters/gaussian_blur_filter_contents_unittests.cc", diff --git a/engine/src/flutter/impeller/entity/contents/checkerboard_contents.cc b/engine/src/flutter/impeller/entity/contents/checkerboard_contents.cc deleted file mode 100644 index e8d0de7795..0000000000 --- a/engine/src/flutter/impeller/entity/contents/checkerboard_contents.cc +++ /dev/null @@ -1,64 +0,0 @@ -// 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 "impeller/core/formats.h" -#include "impeller/entity/contents/content_context.h" -#include "impeller/renderer/render_pass.h" -#include "impeller/renderer/vertex_buffer_builder.h" - -namespace impeller { - -CheckerboardContents::CheckerboardContents() = default; - -CheckerboardContents::~CheckerboardContents() = default; - -bool CheckerboardContents::Render(const ContentContext& renderer, - const Entity& entity, - RenderPass& pass) const { - auto& host_buffer = renderer.GetTransientsBuffer(); - - using VS = CheckerboardPipeline::VertexShader; - using FS = CheckerboardPipeline::FragmentShader; - - auto options = OptionsFromPass(pass); - options.blend_mode = BlendMode::kSourceOver; - options.stencil_mode = ContentContextOptions::StencilMode::kIgnore; - options.primitive_type = PrimitiveType::kTriangleStrip; - - VertexBufferBuilder vtx_builder; - vtx_builder.AddVertices({ - {Point(-1, -1)}, - {Point(1, -1)}, - {Point(-1, 1)}, - {Point(1, 1)}, - }); - - pass.SetCommandLabel("Checkerboard"); - pass.SetPipeline(renderer.GetCheckerboardPipeline(options)); - pass.SetVertexBuffer(vtx_builder.CreateVertexBuffer(host_buffer)); - - FS::FragInfo frag_info; - frag_info.color = color_; - frag_info.square_size = square_size_; - FS::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info)); - - return pass.Draw().ok(); -} - -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 deleted file mode 100644 index 43b2ae7942..0000000000 --- a/engine/src/flutter/impeller/entity/contents/checkerboard_contents.h +++ /dev/null @@ -1,45 +0,0 @@ -// 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. - -#ifndef FLUTTER_IMPELLER_ENTITY_CONTENTS_CHECKERBOARD_CONTENTS_H_ -#define FLUTTER_IMPELLER_ENTITY_CONTENTS_CHECKERBOARD_CONTENTS_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; - - CheckerboardContents(const CheckerboardContents&) = delete; - - CheckerboardContents& operator=(const CheckerboardContents&) = delete; -}; - -} // namespace impeller - -#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_CHECKERBOARD_CONTENTS_H_ diff --git a/engine/src/flutter/impeller/entity/contents/checkerboard_contents_unittests.cc b/engine/src/flutter/impeller/entity/contents/checkerboard_contents_unittests.cc deleted file mode 100644 index a79cc115f5..0000000000 --- a/engine/src/flutter/impeller/entity/contents/checkerboard_contents_unittests.cc +++ /dev/null @@ -1,58 +0,0 @@ -// 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 -#include - -#include "gtest/gtest.h" - -#include "impeller/entity/contents/checkerboard_contents.h" -#include "impeller/entity/contents/contents.h" -#include "impeller/entity/contents/test/recording_render_pass.h" -#include "impeller/entity/entity.h" -#include "impeller/entity/entity_playground.h" -#include "impeller/renderer/render_target.h" - -namespace impeller { -namespace testing { - -using EntityTest = EntityPlayground; - -#ifdef IMPELLER_DEBUG -TEST(EntityTest, HasNulloptCoverage) { - auto contents = std::make_shared(); - - Entity entity; - ASSERT_EQ(contents->GetCoverage(entity), std::nullopt); -} - -TEST_P(EntityTest, RendersWithoutError) { - auto contents = std::make_shared(); - contents->SetColor(Color::Aqua()); - contents->SetSquareSize(10); - - auto content_context = GetContentContext(); - auto buffer = content_context->GetContext()->CreateCommandBuffer(); - auto render_target = - GetContentContext()->GetRenderTargetCache()->CreateOffscreenMSAA( - *content_context->GetContext(), {100, 100}, - /*mip_count=*/1); - auto render_pass = buffer->CreateRenderPass(render_target); - auto recording_pass = std::make_shared( - render_pass, GetContext(), render_target); - - Entity entity; - - ASSERT_TRUE(recording_pass->GetCommands().empty()); - ASSERT_TRUE(contents->Render(*content_context, entity, *recording_pass)); - ASSERT_FALSE(recording_pass->GetCommands().empty()); - - if (GetParam() == PlaygroundBackend::kMetal) { - recording_pass->EncodeCommands(); - } -} -#endif // IMPELLER_DEBUG - -} // namespace testing -} // namespace impeller diff --git a/engine/src/flutter/impeller/entity/contents/clip_contents_unittests.cc b/engine/src/flutter/impeller/entity/contents/clip_contents_unittests.cc index a664a5f331..f9c23cb6db 100644 --- a/engine/src/flutter/impeller/entity/contents/clip_contents_unittests.cc +++ b/engine/src/flutter/impeller/entity/contents/clip_contents_unittests.cc @@ -7,7 +7,6 @@ #include "gtest/gtest.h" -#include "impeller/entity/contents/checkerboard_contents.h" #include "impeller/entity/contents/clip_contents.h" #include "impeller/entity/contents/content_context.h" #include "impeller/entity/contents/contents.h" diff --git a/engine/src/flutter/impeller/entity/contents/content_context.cc b/engine/src/flutter/impeller/entity/contents/content_context.cc index 31d9d6c6b6..428ef5bd04 100644 --- a/engine/src/flutter/impeller/entity/contents/content_context.cc +++ b/engine/src/flutter/impeller/entity/contents/content_context.cc @@ -280,10 +280,6 @@ ContentContext::ContentContext( const auto supports_decal = static_cast( context_->GetCapabilities()->SupportsDecalSamplerAddressMode()); -#ifdef IMPELLER_DEBUG - checkerboard_pipelines_.CreateDefault(*context_, options); -#endif // IMPELLER_DEBUG - { solid_fill_pipelines_.CreateDefault(*context_, options); texture_pipelines_.CreateDefault(*context_, options); diff --git a/engine/src/flutter/impeller/entity/contents/content_context.h b/engine/src/flutter/impeller/entity/contents/content_context.h index 0d748f323e..1888845a22 100644 --- a/engine/src/flutter/impeller/entity/contents/content_context.h +++ b/engine/src/flutter/impeller/entity/contents/content_context.h @@ -24,11 +24,6 @@ #include "impeller/renderer/render_target.h" #include "impeller/typographer/typographer_context.h" -#ifdef IMPELLER_DEBUG -#include "impeller/entity/checkerboard.frag.h" -#include "impeller/entity/checkerboard.vert.h" -#endif // IMPELLER_DEBUG - #include "impeller/entity/border_mask_blur.frag.h" #include "impeller/entity/clip.frag.h" #include "impeller/entity/clip.vert.h" @@ -84,11 +79,6 @@ namespace impeller { -#ifdef IMPELLER_DEBUG -using CheckerboardPipeline = - RenderPipelineHandle; -#endif // IMPELLER_DEBUG - using LinearGradientFillPipeline = RenderPipelineHandle; @@ -389,13 +379,6 @@ 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); @@ -875,10 +858,6 @@ class ContentContext { // 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/entity_pass.cc b/engine/src/flutter/impeller/entity/entity_pass.cc index 305fe6c225..596f4412da 100644 --- a/engine/src/flutter/impeller/entity/entity_pass.cc +++ b/engine/src/flutter/impeller/entity/entity_pass.cc @@ -28,10 +28,6 @@ #include "impeller/geometry/size.h" #include "impeller/renderer/command_buffer.h" -#ifdef IMPELLER_DEBUG -#include "impeller/entity/contents/checkerboard_contents.h" -#endif // IMPELLER_DEBUG - namespace impeller { namespace { @@ -1003,31 +999,6 @@ bool EntityPass::OnRender( } } -#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; } @@ -1190,8 +1161,4 @@ void EntityPass::SetBackdropFilter(BackdropFilterProc 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 2d6bdcd549..4fcf7f6cf3 100644 --- a/engine/src/flutter/impeller/entity/entity_pass.h +++ b/engine/src/flutter/impeller/entity/entity_pass.h @@ -174,8 +174,6 @@ class EntityPass { void SetBackdropFilter(BackdropFilterProc proc); - void SetEnableOffscreenCheckerboard(bool enabled); - int32_t GetRequiredMipCount() const { return required_mip_count_; } void SetRequiredMipCount(int32_t mip_count) { @@ -334,7 +332,6 @@ class EntityPass { uint32_t clip_depth_ = 1u; BlendMode blend_mode_ = BlendMode::kSourceOver; bool flood_clip_ = false; - bool enable_offscreen_debug_checkerboard_ = false; std::optional bounds_limit_; ContentBoundsPromise bounds_promise_ = ContentBoundsPromise::kUnknown; int32_t required_mip_count_ = 1; diff --git a/engine/src/flutter/impeller/entity/shaders/debug/checkerboard.frag b/engine/src/flutter/impeller/entity/shaders/debug/checkerboard.frag deleted file mode 100644 index cd711965c1..0000000000 --- a/engine/src/flutter/impeller/entity/shaders/debug/checkerboard.frag +++ /dev/null @@ -1,18 +0,0 @@ -// 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. - -precision mediump float; - -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 deleted file mode 100644 index 12942363ab..0000000000 --- a/engine/src/flutter/impeller/entity/shaders/debug/checkerboard.vert +++ /dev/null @@ -1,9 +0,0 @@ -// 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/renderer/shader_stage_compatibility_checker.h b/engine/src/flutter/impeller/renderer/shader_stage_compatibility_checker.h index 5a16e64b6d..5d59422ecd 100644 --- a/engine/src/flutter/impeller/renderer/shader_stage_compatibility_checker.h +++ b/engine/src/flutter/impeller/renderer/shader_stage_compatibility_checker.h @@ -57,16 +57,8 @@ class ShaderStageCompatibilityChecker { // The following shaders don't define output slots. // TODO(https://github.com/flutter/flutter/issues/146852): Make impellerc emit // an empty array for output slots. -struct CheckerboardVertexShader; struct ClipVertexShader; -template -class ShaderStageCompatibilityChecker { - public: - static constexpr bool Check() { return true; } -}; - template class ShaderStageCompatibilityChecker { public: diff --git a/engine/src/flutter/impeller/tools/malioc.json b/engine/src/flutter/impeller/tools/malioc.json index b3deba04be..856dc2c6a6 100644 --- a/engine/src/flutter/impeller/tools/malioc.json +++ b/engine/src/flutter/impeller/tools/malioc.json @@ -257,137 +257,6 @@ } } }, - "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": 80, - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "load_store" - ], - "longest_path_cycles": [ - 0.125, - 0.125, - 0.125, - 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.125, - 0.125, - 0.125, - 0.0625, - 1.0, - 0.0, - 0.0 - ], - "total_bound_pipelines": [ - "load_store" - ], - "total_cycles": [ - 0.125, - 0.125, - 0.125, - 0.0625, - 1.0, - 0.0, - 0.0 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 100, - "uniform_registers_used": 6, - "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/clip.frag.vkspv": { "Mali-G78": { "core": "Mali-G78", @@ -1432,227 +1301,6 @@ } } }, - "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": 27, - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "load_store" - ], - "longest_path_cycles": [ - 0.234375, - 0.234375, - 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.234375, - 0.234375, - 0.140625, - 0.0625, - 1.0, - 0.0, - 0.0 - ], - "total_bound_pipelines": [ - "load_store" - ], - "total_cycles": [ - 0.234375, - 0.234375, - 0.171875, - 0.0625, - 1.0, - 0.0, - 0.0 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 100, - "uniform_registers_used": 12, - "work_registers_used": 21 - } - } - }, - "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/clip.frag.gles": { "Mali-G78": { "core": "Mali-G78", diff --git a/engine/src/flutter/testing/impeller_golden_tests_output.txt b/engine/src/flutter/testing/impeller_golden_tests_output.txt index c79b5c696f..86a0cd9c7a 100644 --- a/engine/src/flutter/testing/impeller_golden_tests_output.txt +++ b/engine/src/flutter/testing/impeller_golden_tests_output.txt @@ -376,9 +376,6 @@ impeller_Play_AiksTest_CanRenderMaskBlurHugeSigma_Vulkan.png impeller_Play_AiksTest_CanRenderNestedClips_Metal.png impeller_Play_AiksTest_CanRenderNestedClips_OpenGLES.png impeller_Play_AiksTest_CanRenderNestedClips_Vulkan.png -impeller_Play_AiksTest_CanRenderOffscreenCheckerboard_Metal.png -impeller_Play_AiksTest_CanRenderOffscreenCheckerboard_OpenGLES.png -impeller_Play_AiksTest_CanRenderOffscreenCheckerboard_Vulkan.png impeller_Play_AiksTest_CanRenderOverlappingMultiContourPath_Metal.png impeller_Play_AiksTest_CanRenderOverlappingMultiContourPath_OpenGLES.png impeller_Play_AiksTest_CanRenderOverlappingMultiContourPath_Vulkan.png