diff --git a/DEPS b/DEPS index e0bdf43fd5f3b..a61b6ec1c263e 100644 --- a/DEPS +++ b/DEPS @@ -62,7 +62,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/main/DEPS # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': 'acd54f86bdbba3cb4128c7a3e962135b454a9397', + 'dart_revision': '6a670b60eb06b66c98eecf033cc66e5acd7b24fb', # WARNING: DO NOT EDIT MANUALLY # The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py @@ -1027,7 +1027,7 @@ deps = { 'packages': [ { 'package': 'fuchsia/sdk/core/linux-amd64', - 'version': 'L533ubzhjWwW7jxbcG6mdIXyhn56LmfjD8txTzJB5w0C' + 'version': 'le_-uFgRD5DjvvqgLusDPJslo2yi3XsomslUljzSyWsC' } ], 'condition': 'download_fuchsia_deps and not download_fuchsia_sdk', diff --git a/ci/licenses_golden/licenses_dart b/ci/licenses_golden/licenses_dart index 6475ed0252279..34e875694b16a 100644 --- a/ci/licenses_golden/licenses_dart +++ b/ci/licenses_golden/licenses_dart @@ -1,4 +1,4 @@ -Signature: cf8dc06c8a8c0cd2c58018a11b17cd32 +Signature: 7918463c47c3cc9464624cfaa494e64b ==================================================================================================== LIBRARY: dart @@ -4739,7 +4739,7 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. -You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/acd54f86bdbba3cb4128c7a3e962135b454a9397 +You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/6a670b60eb06b66c98eecf033cc66e5acd7b24fb /third_party/fallback_root_certificates/ ==================================================================================================== diff --git a/ci/licenses_golden/licenses_flutter b/ci/licenses_golden/licenses_flutter index b52c469b2f816..294be38c5868a 100644 --- a/ci/licenses_golden/licenses_flutter +++ b/ci/licenses_golden/licenses_flutter @@ -40377,6 +40377,8 @@ ORIGIN: ../../../flutter/impeller/entity/shaders/blending/framebuffer_blend.frag ORIGIN: ../../../flutter/impeller/entity/shaders/blending/framebuffer_blend.vert + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/blending/porter_duff_blend.frag + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/blending/porter_duff_blend.vert + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/impeller/entity/shaders/blending/vertices_uber.frag + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/impeller/entity/shaders/blending/vertices_uber.vert + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/border_mask_blur.frag + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/border_mask_blur.vert + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/clip.frag + ../../../flutter/LICENSE @@ -43257,6 +43259,8 @@ FILE: ../../../flutter/impeller/entity/shaders/blending/framebuffer_blend.frag FILE: ../../../flutter/impeller/entity/shaders/blending/framebuffer_blend.vert FILE: ../../../flutter/impeller/entity/shaders/blending/porter_duff_blend.frag FILE: ../../../flutter/impeller/entity/shaders/blending/porter_duff_blend.vert +FILE: ../../../flutter/impeller/entity/shaders/blending/vertices_uber.frag +FILE: ../../../flutter/impeller/entity/shaders/blending/vertices_uber.vert FILE: ../../../flutter/impeller/entity/shaders/border_mask_blur.frag FILE: ../../../flutter/impeller/entity/shaders/border_mask_blur.vert FILE: ../../../flutter/impeller/entity/shaders/clip.frag diff --git a/ci/licenses_golden/licenses_fuchsia b/ci/licenses_golden/licenses_fuchsia index de45db2f19612..1398e2c2284a9 100644 --- a/ci/licenses_golden/licenses_fuchsia +++ b/ci/licenses_golden/licenses_fuchsia @@ -1,4 +1,4 @@ -Signature: 81b502c3dc279835bc53d680ebf27d3b +Signature: 3c55d32e3ddca914fb59db1423361bf2 ==================================================================================================== LIBRARY: fuchsia_sdk @@ -13148,6 +13148,7 @@ ORIGIN: ../../../fuchsia/sdk/linux/fidl/fuchsia.images2/overview.fidl + ../../.. ORIGIN: ../../../fuchsia/sdk/linux/fidl/fuchsia.kernel/debuglog-resource.fidl + ../../../fuchsia/sdk/linux/LICENSE ORIGIN: ../../../fuchsia/sdk/linux/fidl/fuchsia.kernel/msi-resource.fidl + ../../../fuchsia/sdk/linux/LICENSE ORIGIN: ../../../fuchsia/sdk/linux/fidl/fuchsia.lowpan.thread/capabilities.fidl + ../../../fuchsia/sdk/linux/LICENSE +ORIGIN: ../../../fuchsia/sdk/linux/fidl/fuchsia.net.routes/rules.fidl + ../../../fuchsia/sdk/linux/LICENSE ORIGIN: ../../../fuchsia/sdk/linux/fidl/fuchsia.sysmem2/error.fidl + ../../../fuchsia/sdk/linux/LICENSE ORIGIN: ../../../fuchsia/sdk/linux/pkg/driver_node_cpp/add_child.cc + ../../../fuchsia/sdk/linux/LICENSE ORIGIN: ../../../fuchsia/sdk/linux/pkg/driver_node_cpp/include/lib/driver/node/cpp/add_child.h + ../../../fuchsia/sdk/linux/LICENSE @@ -13161,6 +13162,7 @@ FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.images2/overview.fidl FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.kernel/debuglog-resource.fidl FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.kernel/msi-resource.fidl FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.lowpan.thread/capabilities.fidl +FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.net.routes/rules.fidl FILE: ../../../fuchsia/sdk/linux/fidl/fuchsia.sysmem2/error.fidl FILE: ../../../fuchsia/sdk/linux/pkg/driver_node_cpp/add_child.cc FILE: ../../../fuchsia/sdk/linux/pkg/driver_node_cpp/include/lib/driver/node/cpp/add_child.h diff --git a/impeller/aiks/aiks_unittests.cc b/impeller/aiks/aiks_unittests.cc index abd0eeb72ae33..e1b860465775d 100644 --- a/impeller/aiks/aiks_unittests.cc +++ b/impeller/aiks/aiks_unittests.cc @@ -2773,6 +2773,38 @@ TEST_P(AiksTest, VerticesGeometryColorUVPositionData) { ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture())); } +TEST_P(AiksTest, VerticesGeometryColorUVPositionDataAdvancedBlend) { + Canvas canvas; + Paint paint; + auto texture = CreateTextureForFixture("table_mountain_nx.png"); + + paint.color_source = + ColorSource::MakeImage(texture, Entity::TileMode::kClamp, + Entity::TileMode::kClamp, {}, Matrix()); + + auto vertices = { + Point(0, 0), + Point(texture->GetSize().width, 0), + Point(0, texture->GetSize().height), + Point(texture->GetSize().width, 0), + Point(0, 0), + Point(texture->GetSize().width, texture->GetSize().height), + }; + std::vector indices = {}; + std::vector texture_coordinates = {}; + std::vector vertex_colors = { + Color::Red().WithAlpha(0.5), Color::Blue().WithAlpha(0.5), + Color::Green().WithAlpha(0.5), Color::Red().WithAlpha(0.5), + Color::Blue().WithAlpha(0.5), Color::Green().WithAlpha(0.5), + }; + auto geometry = std::make_shared( + vertices, indices, texture_coordinates, vertex_colors, + Rect::MakeLTRB(0, 0, 1, 1), VerticesGeometry::VertexMode::kTriangles); + + canvas.DrawVertices(geometry, BlendMode::kColorBurn, paint); + ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture())); +} + TEST_P(AiksTest, MatrixImageFilterMagnify) { Canvas canvas; canvas.Scale(GetContentScale()); diff --git a/impeller/aiks/canvas.cc b/impeller/aiks/canvas.cc index efab9b302d6c4..d5ba43fe7e8c8 100644 --- a/impeller/aiks/canvas.cc +++ b/impeller/aiks/canvas.cc @@ -938,23 +938,21 @@ void Canvas::DrawVertices(const std::shared_ptr& vertices, // If there is are per-vertex colors, an image, and the blend mode // is simple we can draw without a sub-renderpass. - if (blend_mode <= BlendMode::kModulate && vertices->HasVertexColors()) { - if (std::optional maybe_image_data = - GetImageColorSourceData(paint.color_source)) { - const ImageData& image_data = maybe_image_data.value(); - auto contents = std::make_shared(); - contents->SetBlendMode(blend_mode); - contents->SetAlpha(paint.color.alpha); - contents->SetGeometry(vertices); - - contents->SetEffectTransform(image_data.effect_transform); - contents->SetTexture(image_data.texture); - contents->SetTileMode(image_data.x_tile_mode, image_data.y_tile_mode); - - entity.SetContents(paint.WithFilters(std::move(contents))); - AddRenderEntityToCurrentPass(std::move(entity)); - return; - } + if (std::optional maybe_image_data = + GetImageColorSourceData(paint.color_source)) { + const ImageData& image_data = maybe_image_data.value(); + auto contents = std::make_shared(); + contents->SetBlendMode(blend_mode); + contents->SetAlpha(paint.color.alpha); + contents->SetGeometry(vertices); + + contents->SetEffectTransform(image_data.effect_transform); + contents->SetTexture(image_data.texture); + contents->SetTileMode(image_data.x_tile_mode, image_data.y_tile_mode); + + entity.SetContents(paint.WithFilters(std::move(contents))); + AddRenderEntityToCurrentPass(std::move(entity)); + return; } auto src_paint = paint; diff --git a/impeller/entity/BUILD.gn b/impeller/entity/BUILD.gn index 42d0a32a3f244..61ca78ca7eca6 100644 --- a/impeller/entity/BUILD.gn +++ b/impeller/entity/BUILD.gn @@ -52,6 +52,8 @@ impeller_shaders("entity_shaders") { "shaders/filters/linear_to_srgb_filter.frag", "shaders/filters/morphology_filter.frag", "shaders/filters/morphology_filter.vert", + "shaders/blending/vertices_uber.frag", + "shaders/blending/vertices_uber.vert", ] if (impeller_debug) { diff --git a/impeller/entity/contents/content_context.cc b/impeller/entity/contents/content_context.cc index bd3e05c135f6a..10372a2480e70 100644 --- a/impeller/entity/contents/content_context.cc +++ b/impeller/entity/contents/content_context.cc @@ -372,54 +372,54 @@ ContentContext::ContentContext( framebuffer_blend_softlight_pipelines_.CreateDefault( *context_, options_trianglestrip, {static_cast(BlendSelectValues::kSoftLight), supports_decal}); + } else { + blend_color_pipelines_.CreateDefault( + *context_, options_trianglestrip, + {static_cast(BlendSelectValues::kColor), supports_decal}); + blend_colorburn_pipelines_.CreateDefault( + *context_, options_trianglestrip, + {static_cast(BlendSelectValues::kColorBurn), supports_decal}); + blend_colordodge_pipelines_.CreateDefault( + *context_, options_trianglestrip, + {static_cast(BlendSelectValues::kColorDodge), supports_decal}); + blend_darken_pipelines_.CreateDefault( + *context_, options_trianglestrip, + {static_cast(BlendSelectValues::kDarken), supports_decal}); + blend_difference_pipelines_.CreateDefault( + *context_, options_trianglestrip, + {static_cast(BlendSelectValues::kDifference), supports_decal}); + blend_exclusion_pipelines_.CreateDefault( + *context_, options_trianglestrip, + {static_cast(BlendSelectValues::kExclusion), supports_decal}); + blend_hardlight_pipelines_.CreateDefault( + *context_, options_trianglestrip, + {static_cast(BlendSelectValues::kHardLight), supports_decal}); + blend_hue_pipelines_.CreateDefault( + *context_, options_trianglestrip, + {static_cast(BlendSelectValues::kHue), supports_decal}); + blend_lighten_pipelines_.CreateDefault( + *context_, options_trianglestrip, + {static_cast(BlendSelectValues::kLighten), supports_decal}); + blend_luminosity_pipelines_.CreateDefault( + *context_, options_trianglestrip, + {static_cast(BlendSelectValues::kLuminosity), supports_decal}); + blend_multiply_pipelines_.CreateDefault( + *context_, options_trianglestrip, + {static_cast(BlendSelectValues::kMultiply), supports_decal}); + blend_overlay_pipelines_.CreateDefault( + *context_, options_trianglestrip, + {static_cast(BlendSelectValues::kOverlay), supports_decal}); + blend_saturation_pipelines_.CreateDefault( + *context_, options_trianglestrip, + {static_cast(BlendSelectValues::kSaturation), supports_decal}); + blend_screen_pipelines_.CreateDefault( + *context_, options_trianglestrip, + {static_cast(BlendSelectValues::kScreen), supports_decal}); + blend_softlight_pipelines_.CreateDefault( + *context_, options_trianglestrip, + {static_cast(BlendSelectValues::kSoftLight), supports_decal}); } - blend_color_pipelines_.CreateDefault( - *context_, options_trianglestrip, - {static_cast(BlendSelectValues::kColor), supports_decal}); - blend_colorburn_pipelines_.CreateDefault( - *context_, options_trianglestrip, - {static_cast(BlendSelectValues::kColorBurn), supports_decal}); - blend_colordodge_pipelines_.CreateDefault( - *context_, options_trianglestrip, - {static_cast(BlendSelectValues::kColorDodge), supports_decal}); - blend_darken_pipelines_.CreateDefault( - *context_, options_trianglestrip, - {static_cast(BlendSelectValues::kDarken), supports_decal}); - blend_difference_pipelines_.CreateDefault( - *context_, options_trianglestrip, - {static_cast(BlendSelectValues::kDifference), supports_decal}); - blend_exclusion_pipelines_.CreateDefault( - *context_, options_trianglestrip, - {static_cast(BlendSelectValues::kExclusion), supports_decal}); - blend_hardlight_pipelines_.CreateDefault( - *context_, options_trianglestrip, - {static_cast(BlendSelectValues::kHardLight), supports_decal}); - blend_hue_pipelines_.CreateDefault( - *context_, options_trianglestrip, - {static_cast(BlendSelectValues::kHue), supports_decal}); - blend_lighten_pipelines_.CreateDefault( - *context_, options_trianglestrip, - {static_cast(BlendSelectValues::kLighten), supports_decal}); - blend_luminosity_pipelines_.CreateDefault( - *context_, options_trianglestrip, - {static_cast(BlendSelectValues::kLuminosity), supports_decal}); - blend_multiply_pipelines_.CreateDefault( - *context_, options_trianglestrip, - {static_cast(BlendSelectValues::kMultiply), supports_decal}); - blend_overlay_pipelines_.CreateDefault( - *context_, options_trianglestrip, - {static_cast(BlendSelectValues::kOverlay), supports_decal}); - blend_saturation_pipelines_.CreateDefault( - *context_, options_trianglestrip, - {static_cast(BlendSelectValues::kSaturation), supports_decal}); - blend_screen_pipelines_.CreateDefault( - *context_, options_trianglestrip, - {static_cast(BlendSelectValues::kScreen), supports_decal}); - blend_softlight_pipelines_.CreateDefault( - *context_, options_trianglestrip, - {static_cast(BlendSelectValues::kSoftLight), supports_decal}); - rrect_blur_pipelines_.CreateDefault(*context_, options_trianglestrip); texture_strict_src_pipelines_.CreateDefault(*context_, options); position_uv_pipelines_.CreateDefault(*context_, options); @@ -445,6 +445,7 @@ ContentContext::ContentContext( yuv_to_rgb_filter_pipelines_.CreateDefault(*context_, options_trianglestrip); porter_duff_blend_pipelines_.CreateDefault(*context_, options_trianglestrip, {supports_decal}); + vertices_uber_shader_.CreateDefault(*context_, options); // GLES only shader that is unsupported on macOS. #if defined(IMPELLER_ENABLE_OPENGLES) && !defined(FML_OS_MACOSX) if (GetContext()->GetBackendType() == Context::BackendType::kOpenGLES) { diff --git a/impeller/entity/contents/content_context.h b/impeller/entity/contents/content_context.h index 361cd6650dc2e..7c877b34ba9e8 100644 --- a/impeller/entity/contents/content_context.h +++ b/impeller/entity/contents/content_context.h @@ -81,6 +81,9 @@ #include "impeller/entity/framebuffer_blend.frag.h" #include "impeller/entity/framebuffer_blend.vert.h" +#include "impeller/entity/vertices_uber.frag.h" +#include "impeller/entity/vertices_uber.vert.h" + #ifdef IMPELLER_ENABLE_OPENGLES #include "impeller/entity/tiled_texture_fill_external.frag.h" #endif // IMPELLER_ENABLE_OPENGLES @@ -251,6 +254,10 @@ using FramebufferBlendSoftLightPipeline = RenderPipelineHandle; +/// Draw Vertices/Atlas Uber Shader +using VerticesUberShader = + RenderPipelineHandle; + /// Geometry Pipelines using PointsComputeShaderPipeline = ComputePipelineBuilder; using UvComputeShaderPipeline = ComputePipelineBuilder; @@ -721,6 +728,11 @@ class ContentContext { return GetPipeline(framebuffer_blend_softlight_pipelines_, opts); } + std::shared_ptr> GetDrawVerticesUberShader( + ContentContextOptions opts) const { + return GetPipeline(vertices_uber_shader_, opts); + } + std::shared_ptr> GetPointComputePipeline() const { FML_DCHECK(GetDeviceCapabilities().SupportsCompute()); @@ -995,6 +1007,7 @@ class ContentContext { framebuffer_blend_screen_pipelines_; mutable Variants framebuffer_blend_softlight_pipelines_; + mutable Variants vertices_uber_shader_; mutable std::shared_ptr> point_field_compute_pipelines_; mutable std::shared_ptr> diff --git a/impeller/entity/contents/filters/blend_filter_contents.cc b/impeller/entity/contents/filters/blend_filter_contents.cc index 2e353dbafa691..7f3ac8e322af1 100644 --- a/impeller/entity/contents/filters/blend_filter_contents.cc +++ b/impeller/entity/contents/filters/blend_filter_contents.cc @@ -8,8 +8,11 @@ #include #include +#include "flutter/fml/logging.h" #include "impeller/base/strings.h" #include "impeller/core/formats.h" +#include "impeller/core/sampler_descriptor.h" +#include "impeller/core/texture_descriptor.h" #include "impeller/entity/contents/anonymous_contents.h" #include "impeller/entity/contents/content_context.h" #include "impeller/entity/contents/contents.h" @@ -17,6 +20,8 @@ #include "impeller/entity/contents/filters/inputs/filter_input.h" #include "impeller/entity/contents/solid_color_contents.h" #include "impeller/entity/entity.h" +#include "impeller/entity/texture_fill.frag.h" +#include "impeller/entity/texture_fill.vert.h" #include "impeller/geometry/color.h" #include "impeller/renderer/render_pass.h" #include "impeller/renderer/snapshot.h" @@ -660,6 +665,235 @@ static std::optional PipelineBlend( entity.GetBlendMode()); } +std::optional BlendFilterContents::CreateFramebufferAdvancedBlend( + const FilterInput::Vector& inputs, + const ContentContext& renderer, + const Entity& entity, + const Rect& coverage, + std::optional foreground_color, + BlendMode blend_mode, + std::optional alpha, + ColorFilterContents::AbsorbOpacity absorb_opacity) const { + // This works with either 2 contents or 1 contents and a foreground color. + FML_DCHECK(inputs.size() == 2u || + (inputs.size() == 1u && foreground_color.has_value())); + + auto dst_snapshot = + inputs[0]->GetSnapshot("ForegroundAdvancedBlend", renderer, entity); + if (!dst_snapshot.has_value()) { + return std::nullopt; + } + + ContentContext::SubpassCallback subpass_callback = [&](const ContentContext& + renderer, + RenderPass& pass) { + // First, we create a new render pass and populate it with the contents + // of the first (dst) input. + HostBuffer& host_buffer = renderer.GetTransientsBuffer(); + + { + using FS = TextureFillFragmentShader; + using VS = TextureFillVertexShader; + + pass.SetCommandLabel("Framebuffer Advanced Blend"); + auto pipeline_options = OptionsFromPass(pass); + pipeline_options.primitive_type = PrimitiveType::kTriangleStrip; + pass.SetPipeline(renderer.GetTexturePipeline(pipeline_options)); + + VS::FrameInfo frame_info; + frame_info.mvp = Matrix::MakeOrthographic(ISize(1, 1)); + frame_info.texture_sampler_y_coord_scale = 1.0; + + FS::FragInfo frag_info; + frag_info.alpha = 1.0; + + VertexBufferBuilder vtx_builder; + vtx_builder.AddVertices({ + {{0, 0}, {0, 0}}, + {Point(1, 0), {1, 0}}, + {Point(0, 1), {0, 1}}, + {Point(1, 1), {1, 1}}, + }); + auto vtx_buffer = vtx_builder.CreateVertexBuffer(host_buffer); + pass.SetVertexBuffer(std::move(vtx_buffer)); + + VS::BindFrameInfo(pass, host_buffer.EmplaceUniform(frame_info)); + FS::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info)); + FS::BindTextureSampler( + pass, dst_snapshot->texture, + renderer.GetContext()->GetSamplerLibrary()->GetSampler({})); + + if (!pass.Draw().ok()) { + return false; + } + } + + { + using VS = FramebufferBlendScreenPipeline::VertexShader; + using FS = FramebufferBlendScreenPipeline::FragmentShader; + + // Next, we render the second contents to a snapshot, or create a 1x1 + // texture for the foreground color. + std::shared_ptr src_texture; + if (foreground_color.has_value()) { + TextureDescriptor desc; + desc.size = {1, 1}; + desc.format = PixelFormat::kR8G8B8A8UNormInt; + desc.storage_mode = StorageMode::kHostVisible; + src_texture = + renderer.GetContext()->GetResourceAllocator()->CreateTexture(desc); + if (!src_texture) { + return false; + } + + if (!src_texture->SetContents( + foreground_color->Premultiply().ToR8G8B8A8().data(), 4u)) { + return false; + } + } else { + auto src_snapshot = + inputs[0]->GetSnapshot("ForegroundAdvancedBlend", renderer, entity); + if (!src_snapshot.has_value()) { + return false; + } + // This doesn't really handle the case where the transforms are wildly + // different, but we only need to support blending two contents together + // in limited circumstances (mask blur). + src_texture = src_snapshot->texture; + } + + VertexBufferBuilder vtx_builder; + vtx_builder.AddVertices({ + {Point(0, 0), Point(0, 0)}, + {Point(1, 0), Point(1, 0)}, + {Point(0, 1), Point(0, 1)}, + {Point(1, 1), Point(1, 1)}, + }); + + auto options = OptionsFromPass(pass); + options.blend_mode = BlendMode::kSource; + options.primitive_type = PrimitiveType::kTriangleStrip; + + pass.SetCommandLabel("Framebuffer Advanced Blend Filter"); + pass.SetVertexBuffer(vtx_builder.CreateVertexBuffer(host_buffer)); + + switch (blend_mode) { + case BlendMode::kScreen: + pass.SetPipeline(renderer.GetFramebufferBlendScreenPipeline(options)); + break; + case BlendMode::kOverlay: + pass.SetPipeline( + renderer.GetFramebufferBlendOverlayPipeline(options)); + break; + case BlendMode::kDarken: + pass.SetPipeline(renderer.GetFramebufferBlendDarkenPipeline(options)); + break; + case BlendMode::kLighten: + pass.SetPipeline( + renderer.GetFramebufferBlendLightenPipeline(options)); + break; + case BlendMode::kColorDodge: + pass.SetPipeline( + renderer.GetFramebufferBlendColorDodgePipeline(options)); + break; + case BlendMode::kColorBurn: + pass.SetPipeline( + renderer.GetFramebufferBlendColorBurnPipeline(options)); + break; + case BlendMode::kHardLight: + pass.SetPipeline( + renderer.GetFramebufferBlendHardLightPipeline(options)); + break; + case BlendMode::kSoftLight: + pass.SetPipeline( + renderer.GetFramebufferBlendSoftLightPipeline(options)); + break; + case BlendMode::kDifference: + pass.SetPipeline( + renderer.GetFramebufferBlendDifferencePipeline(options)); + break; + case BlendMode::kExclusion: + pass.SetPipeline( + renderer.GetFramebufferBlendExclusionPipeline(options)); + break; + case BlendMode::kMultiply: + pass.SetPipeline( + renderer.GetFramebufferBlendMultiplyPipeline(options)); + break; + case BlendMode::kHue: + pass.SetPipeline(renderer.GetFramebufferBlendHuePipeline(options)); + break; + case BlendMode::kSaturation: + pass.SetPipeline( + renderer.GetFramebufferBlendSaturationPipeline(options)); + break; + case BlendMode::kColor: + pass.SetPipeline(renderer.GetFramebufferBlendColorPipeline(options)); + break; + case BlendMode::kLuminosity: + pass.SetPipeline( + renderer.GetFramebufferBlendLuminosityPipeline(options)); + break; + default: + return false; + } + + VS::FrameInfo frame_info; + FS::FragInfo frag_info; + + auto src_sampler_descriptor = SamplerDescriptor{}; + if (renderer.GetDeviceCapabilities().SupportsDecalSamplerAddressMode()) { + src_sampler_descriptor.width_address_mode = SamplerAddressMode::kDecal; + src_sampler_descriptor.height_address_mode = SamplerAddressMode::kDecal; + } + const std::unique_ptr& src_sampler = + renderer.GetContext()->GetSamplerLibrary()->GetSampler( + src_sampler_descriptor); + FS::BindTextureSamplerSrc(pass, src_texture, src_sampler); + + frame_info.mvp = Matrix::MakeOrthographic(ISize(1, 1)); + frame_info.src_y_coord_scale = src_texture->GetYCoordScale(); + VS::BindFrameInfo(pass, host_buffer.EmplaceUniform(frame_info)); + + frag_info.src_input_alpha = 1.0; + FS::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info)); + + return pass.Draw().ok(); + } + }; + + std::shared_ptr cmd_buffer = + renderer.GetContext()->CreateCommandBuffer(); + auto render_target = + renderer.MakeSubpass("FramebufferBlend", dst_snapshot->texture->GetSize(), + cmd_buffer, subpass_callback); + + if (!render_target.ok()) { + return std::nullopt; + } + + if (!renderer.GetContext() + ->GetCommandQueue() + ->Submit(/*buffers=*/{std::move(cmd_buffer)}) + .ok()) { + return std::nullopt; + } + + return Entity::FromSnapshot( + Snapshot{ + .texture = render_target.value().GetRenderTargetTexture(), + .transform = dst_snapshot->transform, + // Since we absorbed the transform of the inputs and used the + // respective snapshot sampling modes when blending, pass on + // the default NN clamp sampler. + .sampler_descriptor = {}, + .opacity = (absorb_opacity == ColorFilterContents::AbsorbOpacity::kYes + ? 1.0f + : dst_snapshot->opacity) * + alpha.value_or(1.0)}, + entity.GetBlendMode()); +} + #define BLEND_CASE(mode) \ case BlendMode::k##mode: \ advanced_blend_proc_ = \ @@ -739,6 +973,11 @@ std::optional BlendFilterContents::RenderFilter( } if (blend_mode_ <= Entity::kLastAdvancedBlendMode) { + if (renderer.GetDeviceCapabilities().SupportsFramebufferFetch()) { + return CreateFramebufferAdvancedBlend(inputs, renderer, entity, coverage, + foreground_color_, blend_mode_, + GetAlpha(), GetAbsorbOpacity()); + } if (inputs.size() == 1 && foreground_color_.has_value() && GetAbsorbOpacity() == ColorFilterContents::AbsorbOpacity::kYes) { return CreateForegroundAdvancedBlend( diff --git a/impeller/entity/contents/filters/blend_filter_contents.h b/impeller/entity/contents/filters/blend_filter_contents.h index 562f306034ebd..468ff18ae0e36 100644 --- a/impeller/entity/contents/filters/blend_filter_contents.h +++ b/impeller/entity/contents/filters/blend_filter_contents.h @@ -78,6 +78,23 @@ class BlendFilterContents : public ColorFilterContents { std::optional alpha, ColorFilterContents::AbsorbOpacity absorb_opacity) const; + /// @brief Implements the advanced blends filters in terms of the framebuffer + /// blend filters. + /// + /// This requires device support for frameuffer fetch, + /// `Capabilities::SupportsFramebufferFetch` must be true + /// This allows a substantial reduction in the number of bootstrapped + /// shaders. + std::optional CreateFramebufferAdvancedBlend( + const FilterInput::Vector& inputs, + const ContentContext& renderer, + const Entity& entity, + const Rect& coverage, + std::optional foreground_color, + BlendMode blend_mode, + std::optional alpha, + ColorFilterContents::AbsorbOpacity absorb_opacity) const; + /// @brief Optimized porter-duff blend that avoids a second subpass when there /// is only a single input and a foreground color. /// diff --git a/impeller/entity/contents/vertices_contents.cc b/impeller/entity/contents/vertices_contents.cc index 9aeaa83023b83..dafc7b6e9edfb 100644 --- a/impeller/entity/contents/vertices_contents.cc +++ b/impeller/entity/contents/vertices_contents.cc @@ -243,7 +243,6 @@ void VerticesSimpleBlendContents::SetAlpha(Scalar alpha) { } void VerticesSimpleBlendContents::SetBlendMode(BlendMode blend_mode) { - FML_DCHECK(blend_mode <= BlendMode::kModulate); blend_mode_ = blend_mode; } @@ -275,11 +274,22 @@ bool VerticesSimpleBlendContents::Render(const ContentContext& renderer, const Entity& entity, RenderPass& pass) const { FML_DCHECK(texture_); - FML_DCHECK(geometry_->HasVertexColors()); + BlendMode blend_mode = blend_mode_; + if (!geometry_->HasVertexColors()) { + blend_mode = BlendMode::kSource; + } + + auto dst_sampler_descriptor = descriptor_; + dst_sampler_descriptor.width_address_mode = + TileModeToAddressMode(tile_mode_x_, renderer.GetDeviceCapabilities()) + .value_or(SamplerAddressMode::kClampToEdge); + dst_sampler_descriptor.height_address_mode = + TileModeToAddressMode(tile_mode_y_, renderer.GetDeviceCapabilities()) + .value_or(SamplerAddressMode::kClampToEdge); - // Simple Porter-Duff blends can be accomplished without a sub renderpass. - using VS = PorterDuffBlendPipeline::VertexShader; - using FS = PorterDuffBlendPipeline::FragmentShader; + const std::unique_ptr& dst_sampler = + renderer.GetContext()->GetSamplerLibrary()->GetSampler( + dst_sampler_descriptor); GeometryResult geometry_result = geometry_->GetPositionUVColorBuffer( Rect::MakeSize(texture_->GetSize()), inverse_matrix_, renderer, entity, @@ -289,53 +299,76 @@ bool VerticesSimpleBlendContents::Render(const ContentContext& renderer, } FML_DCHECK(geometry_result.mode == GeometryResult::Mode::kNormal); + if (blend_mode <= Entity::kLastPipelineBlendMode) { + using VS = PorterDuffBlendPipeline::VertexShader; + using FS = PorterDuffBlendPipeline::FragmentShader; + +#ifdef IMPELLER_DEBUG + pass.SetCommandLabel(SPrintF("DrawVertices Porterduff Blend (%s)", + BlendModeToString(blend_mode))); +#endif // IMPELLER_DEBUG + pass.SetVertexBuffer(std::move(geometry_result.vertex_buffer)); + + auto options = OptionsFromPassAndEntity(pass, entity); + options.primitive_type = geometry_result.type; + pass.SetPipeline(renderer.GetPorterDuffBlendPipeline(options)); + + FS::BindTextureSamplerDst(pass, texture_, dst_sampler); + + VS::FrameInfo frame_info; + FS::FragInfo frag_info; + + frame_info.texture_sampler_y_coord_scale = texture_->GetYCoordScale(); + frame_info.mvp = geometry_result.transform; + + frag_info.output_alpha = alpha_; + frag_info.input_alpha = 1.0; + + auto inverted_blend_mode = + InvertPorterDuffBlend(blend_mode).value_or(BlendMode::kSource); + auto blend_coefficients = + kPorterDuffCoefficients[static_cast(inverted_blend_mode)]; + frag_info.src_coeff = blend_coefficients[0]; + frag_info.src_coeff_dst_alpha = blend_coefficients[1]; + frag_info.dst_coeff = blend_coefficients[2]; + frag_info.dst_coeff_src_alpha = blend_coefficients[3]; + frag_info.dst_coeff_src_color = blend_coefficients[4]; + // Only used on devices that do not natively support advanced blends. + frag_info.tmx = static_cast(tile_mode_x_); + frag_info.tmy = static_cast(tile_mode_y_); + + auto& host_buffer = renderer.GetTransientsBuffer(); + FS::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info)); + VS::BindFrameInfo(pass, host_buffer.EmplaceUniform(frame_info)); + + return pass.Draw().ok(); + } + + using VS = VerticesUberShader::VertexShader; + using FS = VerticesUberShader::FragmentShader; + #ifdef IMPELLER_DEBUG - pass.SetCommandLabel(SPrintF("DrawVertices Porterduff Blend (%s)", - BlendModeToString(blend_mode_))); + pass.SetCommandLabel(SPrintF("DrawVertices Advanced Blend (%s)", + BlendModeToString(blend_mode))); #endif // IMPELLER_DEBUG pass.SetVertexBuffer(std::move(geometry_result.vertex_buffer)); auto options = OptionsFromPassAndEntity(pass, entity); options.primitive_type = geometry_result.type; - pass.SetPipeline(renderer.GetPorterDuffBlendPipeline(options)); - - auto dst_sampler_descriptor = descriptor_; - dst_sampler_descriptor.width_address_mode = - TileModeToAddressMode(tile_mode_x_, renderer.GetDeviceCapabilities()) - .value_or(SamplerAddressMode::kClampToEdge); - dst_sampler_descriptor.height_address_mode = - TileModeToAddressMode(tile_mode_y_, renderer.GetDeviceCapabilities()) - .value_or(SamplerAddressMode::kClampToEdge); + pass.SetPipeline(renderer.GetDrawVerticesUberShader(options)); + FS::BindTextureSampler(pass, texture_, dst_sampler); - const std::unique_ptr& dst_sampler = - renderer.GetContext()->GetSamplerLibrary()->GetSampler( - dst_sampler_descriptor); - FS::BindTextureSamplerDst(pass, texture_, dst_sampler); - - FS::FragInfo frag_info; VS::FrameInfo frame_info; + FS::FragInfo frag_info; frame_info.texture_sampler_y_coord_scale = texture_->GetYCoordScale(); - frag_info.output_alpha = alpha_; - frag_info.input_alpha = 1.0; - - auto inverted_blend_mode = - InvertPorterDuffBlend(blend_mode_).value_or(BlendMode::kSource); - auto blend_coefficients = - kPorterDuffCoefficients[static_cast(inverted_blend_mode)]; - frag_info.src_coeff = blend_coefficients[0]; - frag_info.src_coeff_dst_alpha = blend_coefficients[1]; - frag_info.dst_coeff = blend_coefficients[2]; - frag_info.dst_coeff_src_alpha = blend_coefficients[3]; - frag_info.dst_coeff_src_color = blend_coefficients[4]; + frame_info.mvp = geometry_result.transform; + frag_info.alpha = alpha_; + frag_info.blend_mode = static_cast(blend_mode); auto& host_buffer = renderer.GetTransientsBuffer(); FS::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info)); - - frame_info.mvp = geometry_result.transform; - - auto uniform_view = host_buffer.EmplaceUniform(frame_info); - VS::BindFrameInfo(pass, uniform_view); + VS::BindFrameInfo(pass, host_buffer.EmplaceUniform(frame_info)); return pass.Draw().ok(); } diff --git a/impeller/entity/contents/vertices_contents.h b/impeller/entity/contents/vertices_contents.h index 8a28a8d6751c2..01bd369c4e5a0 100644 --- a/impeller/entity/contents/vertices_contents.h +++ b/impeller/entity/contents/vertices_contents.h @@ -108,8 +108,8 @@ class VerticesUVContents final : public Contents { VerticesUVContents& operator=(const VerticesUVContents&) = delete; }; -/// A vertices contents for per-color vertices + texture and porter duff -/// blended. +/// A vertices contents for (optional) per-color vertices + texture and any +/// blend mode. class VerticesSimpleBlendContents final : public Contents { public: VerticesSimpleBlendContents(); diff --git a/impeller/entity/entity_unittests.cc b/impeller/entity/entity_unittests.cc index 61594bd4d2e64..a739fc71b6088 100644 --- a/impeller/entity/entity_unittests.cc +++ b/impeller/entity/entity_unittests.cc @@ -2688,22 +2688,23 @@ TEST_P(EntityTest, AdvancedBlendCoverageHintIsNotResetByEntityPass) { TEST_P(EntityTest, SpecializationConstantsAreAppliedToVariants) { auto content_context = GetContentContext(); - auto default_color_burn = content_context->GetBlendColorBurnPipeline({ + auto default_gyph = content_context->GetGlyphAtlasPipeline({ .color_attachment_pixel_format = PixelFormat::kR8G8B8A8UNormInt, .has_depth_stencil_attachments = false, }); - auto alt_color_burn = content_context->GetBlendColorBurnPipeline( + auto alt_gyph = content_context->GetGlyphAtlasPipeline( {.color_attachment_pixel_format = PixelFormat::kR8G8B8A8UNormInt, .has_depth_stencil_attachments = true}); - ASSERT_NE(default_color_burn, alt_color_burn); - ASSERT_EQ(default_color_burn->GetDescriptor().GetSpecializationConstants(), - alt_color_burn->GetDescriptor().GetSpecializationConstants()); + EXPECT_NE(default_gyph, alt_gyph); + EXPECT_EQ(default_gyph->GetDescriptor().GetSpecializationConstants(), + alt_gyph->GetDescriptor().GetSpecializationConstants()); - auto decal_supported = static_cast( - GetContext()->GetCapabilities()->SupportsDecalSamplerAddressMode()); - std::vector expected_constants = {5, decal_supported}; - ASSERT_EQ(default_color_burn->GetDescriptor().GetSpecializationConstants(), + auto use_a8 = GetContext()->GetCapabilities()->GetDefaultGlyphAtlasFormat() == + PixelFormat::kA8UNormInt; + + std::vector expected_constants = {static_cast(use_a8)}; + EXPECT_EQ(default_gyph->GetDescriptor().GetSpecializationConstants(), expected_constants); } diff --git a/impeller/entity/geometry/vertices_geometry.cc b/impeller/entity/geometry/vertices_geometry.cc index a352a212c59d5..83b27e9e7ba24 100644 --- a/impeller/entity/geometry/vertices_geometry.cc +++ b/impeller/entity/geometry/vertices_geometry.cc @@ -256,6 +256,7 @@ GeometryResult VerticesGeometry::GetPositionUVColorBuffer( auto uv_transform = texture_coverage.GetNormalizingTransform() * effect_transform; auto has_texture_coordinates = HasTextureCoordinates(); + auto has_colors = HasVertexColors(); size_t total_vtx_bytes = vertices_.size() * sizeof(VS::PerVertexData); auto vertex_buffer = renderer.GetTransientsBuffer().Emplace( @@ -274,7 +275,7 @@ GeometryResult VerticesGeometry::GetPositionUVColorBuffer( .texture_coords = Point(std::clamp(uv.x, 0.0f, 1.0f - kEhCloseEnough), std::clamp(uv.y, 0.0f, 1.0f - kEhCloseEnough)), - .color = colors_[i], + .color = has_colors ? colors_[i] : Color::BlackTransparent(), }; std::memcpy(vtx_contents++, &vertex_data, sizeof(VS::PerVertexData)); } diff --git a/impeller/entity/shaders/blending/porter_duff_blend.frag b/impeller/entity/shaders/blending/porter_duff_blend.frag index 2b6631f9d57f7..348253387e187 100644 --- a/impeller/entity/shaders/blending/porter_duff_blend.frag +++ b/impeller/entity/shaders/blending/porter_duff_blend.frag @@ -21,6 +21,8 @@ uniform FragInfo { float16_t dst_coeff_src_color; float16_t input_alpha; float16_t output_alpha; + float tmx; + float tmy; } frag_info; @@ -29,16 +31,20 @@ in f16vec4 v_color; out f16vec4 frag_color; -f16vec4 Sample(f16sampler2D texture_sampler, vec2 texture_coords) { +f16vec4 Sample(f16sampler2D texture_sampler, + vec2 texture_coords, + float tmx, + float tmy) { if (supports_decal > 0.0) { return texture(texture_sampler, texture_coords); } - return IPHalfSampleDecal(texture_sampler, texture_coords); + return IPHalfSampleWithTileMode(texture_sampler, texture_coords, tmx, tmy); } void main() { - f16vec4 dst = - texture(texture_sampler_dst, v_texture_coords) * frag_info.input_alpha; + f16vec4 dst = Sample(texture_sampler_dst, v_texture_coords, frag_info.tmx, + frag_info.tmy) * + frag_info.input_alpha; f16vec4 src = v_color; frag_color = src * (frag_info.src_coeff + dst.a * frag_info.src_coeff_dst_alpha) + diff --git a/impeller/entity/shaders/blending/vertices_uber.frag b/impeller/entity/shaders/blending/vertices_uber.frag new file mode 100644 index 0000000000000..472c3da377aa3 --- /dev/null +++ b/impeller/entity/shaders/blending/vertices_uber.frag @@ -0,0 +1,33 @@ +// 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 "blend_select.glsl" + +uniform FragInfo { + float16_t alpha; + float16_t blend_mode; +} +frag_info; + +uniform f16sampler2D texture_sampler; + +in highp vec2 v_texture_coords; +in mediump f16vec4 v_color; + +out f16vec4 frag_color; + +// A shader that implements the required src/dst blending for drawVertices and +// drawAtlas advanced blends without requiring an offscreen render pass. This is +// done in a single shader to reduce the permutations of PSO needed at runtime +// for rarely used features. +void main() { + f16vec4 dst = IPHalfUnpremultiply(v_color); + f16vec4 src = IPHalfUnpremultiply(texture(texture_sampler, v_texture_coords)); + f16vec3 blend_result = + AdvancedBlend(dst.rgb, src.rgb, int(frag_info.blend_mode - 14.0)); + frag_color = IPApplyBlendedColor(dst, src, blend_result); + frag_color *= frag_info.alpha; +} diff --git a/impeller/entity/shaders/blending/vertices_uber.vert b/impeller/entity/shaders/blending/vertices_uber.vert new file mode 100644 index 0000000000000..f7fe022c14a3d --- /dev/null +++ b/impeller/entity/shaders/blending/vertices_uber.vert @@ -0,0 +1,26 @@ +// 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 + +uniform FrameInfo { + mat4 mvp; + float texture_sampler_y_coord_scale; +} +frame_info; + +in vec2 vertices; +in vec2 texture_coords; +in vec4 color; + +out vec2 v_texture_coords; +out mediump f16vec4 v_color; + +void main() { + gl_Position = frame_info.mvp * vec4(vertices, 0.0, 1.0); + v_color = f16vec4(color); + v_texture_coords = + IPRemapCoords(texture_coords, frame_info.texture_sampler_y_coord_scale); +} diff --git a/impeller/tools/malioc.json b/impeller/tools/malioc.json index a0e3a966be0aa..550bc626a14d3 100644 --- a/impeller/tools/malioc.json +++ b/impeller/tools/malioc.json @@ -6062,6 +6062,280 @@ } } }, + "flutter/impeller/entity/gles/vertices_uber.frag.gles": { + "Mali-G78": { + "core": "Mali-G78", + "filename": "flutter/impeller/entity/gles/vertices_uber.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": [ + "arith_total", + "arith_fma" + ], + "longest_path_cycles": [ + 1.2625000476837158, + 1.2625000476837158, + 0.699999988079071, + 0.3125, + 0.0, + 0.5, + 0.25 + ], + "pipelines": [ + "arith_total", + "arith_fma", + "arith_cvt", + "arith_sfu", + "load_store", + "varying", + "texture" + ], + "shortest_path_bound_pipelines": [ + "varying" + ], + "shortest_path_cycles": [ + 0.390625, + 0.375, + 0.390625, + 0.0, + 0.0, + 0.5, + 0.25 + ], + "total_bound_pipelines": [ + "arith_total", + "arith_fma" + ], + "total_cycles": [ + 3.862499952316284, + 3.862499952316284, + 2.825000047683716, + 0.9375, + 0.0, + 0.5, + 0.25 + ] + }, + "stack_spill_bytes": 0, + "thread_occupancy": 100, + "uniform_registers_used": 14, + "work_registers_used": 32 + } + } + }, + "Mali-T880": { + "core": "Mali-T880", + "filename": "flutter/impeller/entity/gles/vertices_uber.frag.gles", + "has_uniform_computation": false, + "type": "Fragment", + "variants": { + "Main": { + "has_stack_spilling": true, + "performance": { + "longest_path_bound_pipelines": [ + "arithmetic" + ], + "longest_path_cycles": [ + 14.1899995803833, + 5.0, + 1.0 + ], + "pipelines": [ + "arithmetic", + "load_store", + "texture" + ], + "shortest_path_bound_pipelines": [ + "arithmetic" + ], + "shortest_path_cycles": [ + 4.289999961853027, + 1.0, + 1.0 + ], + "total_bound_pipelines": [ + "arithmetic" + ], + "total_cycles": [ + 47.33333206176758, + 6.0, + 1.0 + ] + }, + "thread_occupancy": 50, + "uniform_registers_used": 1, + "work_registers_used": 8 + } + } + } + }, + "flutter/impeller/entity/gles/vertices_uber.vert.gles": { + "Mali-G78": { + "core": "Mali-G78", + "filename": "flutter/impeller/entity/gles/vertices_uber.vert.gles", + "has_uniform_computation": true, + "type": "Vertex", + "variants": { + "Position": { + "fp16_arithmetic": 0, + "has_stack_spilling": false, + "performance": { + "longest_path_bound_pipelines": [ + "load_store" + ], + "longest_path_cycles": [ + 0.140625, + 0.140625, + 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.140625, + 0.140625, + 0.0, + 0.0, + 2.0, + 0.0 + ], + "total_bound_pipelines": [ + "load_store" + ], + "total_cycles": [ + 0.140625, + 0.140625, + 0.0, + 0.0, + 2.0, + 0.0 + ] + }, + "stack_spill_bytes": 0, + "thread_occupancy": 100, + "uniform_registers_used": 22, + "work_registers_used": 32 + }, + "Varying": { + "fp16_arithmetic": 0, + "has_stack_spilling": false, + "performance": { + "longest_path_bound_pipelines": [ + "load_store" + ], + "longest_path_cycles": [ + 0.015625, + 0.015625, + 0.015625, + 0.0, + 4.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.015625, + 0.015625, + 0.0, + 4.0, + 0.0 + ], + "total_bound_pipelines": [ + "load_store" + ], + "total_cycles": [ + 0.015625, + 0.015625, + 0.015625, + 0.0, + 4.0, + 0.0 + ] + }, + "stack_spill_bytes": 0, + "thread_occupancy": 100, + "uniform_registers_used": 10, + "work_registers_used": 9 + } + } + }, + "Mali-T880": { + "core": "Mali-T880", + "filename": "flutter/impeller/entity/gles/vertices_uber.vert.gles", + "has_uniform_computation": false, + "type": "Vertex", + "variants": { + "Main": { + "has_stack_spilling": false, + "performance": { + "longest_path_bound_pipelines": [ + "load_store" + ], + "longest_path_cycles": [ + 2.9700000286102295, + 7.0, + 0.0 + ], + "pipelines": [ + "arithmetic", + "load_store", + "texture" + ], + "shortest_path_bound_pipelines": [ + "load_store" + ], + "shortest_path_cycles": [ + 2.9700000286102295, + 7.0, + 0.0 + ], + "total_bound_pipelines": [ + "load_store" + ], + "total_cycles": [ + 3.0, + 7.0, + 0.0 + ] + }, + "thread_occupancy": 100, + "uniform_registers_used": 6, + "work_registers_used": 2 + } + } + } + }, "flutter/impeller/entity/gles/yuv_to_rgb_filter.frag.gles": { "Mali-G78": { "core": "Mali-G78", @@ -8932,6 +9206,191 @@ } } }, + "flutter/impeller/entity/vertices_uber.frag.vkspv": { + "Mali-G78": { + "core": "Mali-G78", + "filename": "flutter/impeller/entity/vertices_uber.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": [ + "arith_total", + "arith_fma" + ], + "longest_path_cycles": [ + 1.1124999523162842, + 1.1124999523162842, + 0.84375, + 0.3125, + 0.0, + 0.5, + 0.25 + ], + "pipelines": [ + "arith_total", + "arith_fma", + "arith_cvt", + "arith_sfu", + "load_store", + "varying", + "texture" + ], + "shortest_path_bound_pipelines": [ + "arith_total", + "arith_fma" + ], + "shortest_path_cycles": [ + 0.5625, + 0.5625, + 0.21875, + 0.125, + 0.0, + 0.5, + 0.25 + ], + "total_bound_pipelines": [ + "arith_total", + "arith_fma" + ], + "total_cycles": [ + 3.875, + 3.875, + 2.40625, + 0.9375, + 0.0, + 0.5, + 0.25 + ] + }, + "stack_spill_bytes": 0, + "thread_occupancy": 100, + "uniform_registers_used": 14, + "work_registers_used": 32 + } + } + } + }, + "flutter/impeller/entity/vertices_uber.vert.vkspv": { + "Mali-G78": { + "core": "Mali-G78", + "filename": "flutter/impeller/entity/vertices_uber.vert.vkspv", + "has_uniform_computation": true, + "type": "Vertex", + "variants": { + "Position": { + "fp16_arithmetic": 0, + "has_stack_spilling": false, + "performance": { + "longest_path_bound_pipelines": [ + "load_store" + ], + "longest_path_cycles": [ + 0.125, + 0.125, + 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.125, + 0.125, + 0.0, + 0.0, + 2.0, + 0.0 + ], + "total_bound_pipelines": [ + "load_store" + ], + "total_cycles": [ + 0.125, + 0.125, + 0.0, + 0.0, + 2.0, + 0.0 + ] + }, + "stack_spill_bytes": 0, + "thread_occupancy": 100, + "uniform_registers_used": 30, + "work_registers_used": 32 + }, + "Varying": { + "fp16_arithmetic": 0, + "has_stack_spilling": false, + "performance": { + "longest_path_bound_pipelines": [ + "load_store" + ], + "longest_path_cycles": [ + 0.015625, + 0.015625, + 0.015625, + 0.0, + 4.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.015625, + 0.015625, + 0.0, + 4.0, + 0.0 + ], + "total_bound_pipelines": [ + "load_store" + ], + "total_cycles": [ + 0.015625, + 0.015625, + 0.015625, + 0.0, + 4.0, + 0.0 + ] + }, + "stack_spill_bytes": 0, + "thread_occupancy": 100, + "uniform_registers_used": 22, + "work_registers_used": 9 + } + } + } + }, "flutter/impeller/entity/yuv_to_rgb_filter.frag.vkspv": { "Mali-G78": { "core": "Mali-G78", diff --git a/sky/packages/sky_engine/LICENSE b/sky/packages/sky_engine/LICENSE index 364689012aeb1..2c5fa6f7c8a28 100644 --- a/sky/packages/sky_engine/LICENSE +++ b/sky/packages/sky_engine/LICENSE @@ -32293,7 +32293,7 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. -You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/acd54f86bdbba3cb4128c7a3e962135b454a9397 +You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/6a670b60eb06b66c98eecf033cc66e5acd7b24fb /third_party/fallback_root_certificates/ -------------------------------------------------------------------------------- diff --git a/testing/impeller_golden_tests_output.txt b/testing/impeller_golden_tests_output.txt index 491482dabf944..33562e0ffd6d5 100644 --- a/testing/impeller_golden_tests_output.txt +++ b/testing/impeller_golden_tests_output.txt @@ -757,6 +757,9 @@ impeller_Play_AiksTest_TranslucentSaveLayerWithColorMatrixColorFilterDrawsCorrec impeller_Play_AiksTest_TranslucentSaveLayerWithColorMatrixImageFilterDrawsCorrectly_Metal.png impeller_Play_AiksTest_TranslucentSaveLayerWithColorMatrixImageFilterDrawsCorrectly_OpenGLES.png impeller_Play_AiksTest_TranslucentSaveLayerWithColorMatrixImageFilterDrawsCorrectly_Vulkan.png +impeller_Play_AiksTest_VerticesGeometryColorUVPositionDataAdvancedBlend_Metal.png +impeller_Play_AiksTest_VerticesGeometryColorUVPositionDataAdvancedBlend_OpenGLES.png +impeller_Play_AiksTest_VerticesGeometryColorUVPositionDataAdvancedBlend_Vulkan.png impeller_Play_AiksTest_VerticesGeometryColorUVPositionData_Metal.png impeller_Play_AiksTest_VerticesGeometryColorUVPositionData_OpenGLES.png impeller_Play_AiksTest_VerticesGeometryColorUVPositionData_Vulkan.png