From 544625e0c3028cae11930f595c7c784ee6b16191 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Mon, 15 Apr 2024 14:59:51 -0700 Subject: [PATCH 1/9] [Impeller] organize texture shaders. --- impeller/entity/BUILD.gn | 4 - impeller/entity/contents/atlas_contents.cc | 6 +- impeller/entity/contents/content_context.cc | 5 - impeller/entity/contents/content_context.h | 30 ----- .../contents/filters/blend_filter_contents.cc | 12 +- .../filters/gaussian_blur_filter_contents.cc | 6 +- impeller/entity/contents/texture_contents.cc | 104 +++++++++++------- .../entity/contents/tiled_texture_contents.cc | 9 +- impeller/entity/contents/vertices_contents.cc | 4 +- impeller/entity/shaders/blending/blend.frag | 24 ---- impeller/entity/shaders/blending/blend.vert | 23 ---- impeller/entity/shaders/texture_fill.frag | 8 +- impeller/entity/shaders/texture_fill.vert | 3 - .../entity/shaders/texture_fill_external.frag | 16 --- .../shaders/texture_fill_strict_src.frag | 30 ----- .../entity/shaders/tiled_texture_fill.frag | 8 +- .../shaders/tiled_texture_fill_external.frag | 4 +- 17 files changed, 104 insertions(+), 192 deletions(-) delete mode 100644 impeller/entity/shaders/blending/blend.frag delete mode 100644 impeller/entity/shaders/blending/blend.vert delete mode 100644 impeller/entity/shaders/texture_fill_external.frag delete mode 100644 impeller/entity/shaders/texture_fill_strict_src.frag diff --git a/impeller/entity/BUILD.gn b/impeller/entity/BUILD.gn index d2c3428fd1a59..46da4d642063d 100644 --- a/impeller/entity/BUILD.gn +++ b/impeller/entity/BUILD.gn @@ -16,8 +16,6 @@ impeller_shaders("entity_shaders") { shaders = [ "shaders/blending/advanced_blend.vert", "shaders/blending/advanced_blend.frag", - "shaders/blending/blend.frag", - "shaders/blending/blend.vert", "shaders/border_mask_blur.frag", "shaders/border_mask_blur.vert", "shaders/clip.frag", @@ -41,8 +39,6 @@ impeller_shaders("entity_shaders") { "shaders/gradients/sweep_gradient_fill.frag", "shaders/texture_fill.frag", "shaders/texture_fill.vert", - "shaders/texture_fill_external.frag", - "shaders/texture_fill_strict_src.frag", "shaders/tiled_texture_fill.frag", "shaders/tiled_texture_fill_external.frag", "shaders/vertices.frag", diff --git a/impeller/entity/contents/atlas_contents.cc b/impeller/entity/contents/atlas_contents.cc index 9e01411f56a76..f8171692f2d8b 100644 --- a/impeller/entity/contents/atlas_contents.cc +++ b/impeller/entity/contents/atlas_contents.cc @@ -405,12 +405,16 @@ bool AtlasTextureContents::Render(const ContentContext& renderer, VS::FrameInfo frame_info; frame_info.mvp = entity.GetShaderTransform(pass); frame_info.texture_sampler_y_coord_scale = texture->GetYCoordScale(); - frame_info.alpha = alpha_; auto options = OptionsFromPassAndEntity(pass, entity); pass.SetPipeline(renderer.GetTexturePipeline(options)); pass.SetVertexBuffer(vertex_builder.CreateVertexBuffer(host_buffer)); VS::BindFrameInfo(pass, host_buffer.EmplaceUniform(frame_info)); + + FS::FragInfo frag_info; + frag_info.alpha = alpha_; + + FS::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info)); FS::BindTextureSampler(pass, texture, renderer.GetContext()->GetSamplerLibrary()->GetSampler( parent_.GetSamplerDescriptor())); diff --git a/impeller/entity/contents/content_context.cc b/impeller/entity/contents/content_context.cc index 947777105a445..2e150f0fbcf5b 100644 --- a/impeller/entity/contents/content_context.cc +++ b/impeller/entity/contents/content_context.cc @@ -400,9 +400,7 @@ ContentContext::ContentContext( {static_cast(BlendSelectValues::kSoftLight), supports_decal}); rrect_blur_pipelines_.CreateDefault(*context_, options_trianglestrip); - texture_blend_pipelines_.CreateDefault(*context_, options); texture_pipelines_.CreateDefault(*context_, options); - texture_strict_src_pipelines_.CreateDefault(*context_, options); position_uv_pipelines_.CreateDefault(*context_, options); tiled_texture_pipelines_.CreateDefault(*context_, options); kernel_decal_pipelines_.CreateDefault(*context_, options_trianglestrip); @@ -428,9 +426,6 @@ ContentContext::ContentContext( {supports_decal}); // GLES only shader that is unsupported on macOS. #if defined(IMPELLER_ENABLE_OPENGLES) && !defined(FML_OS_MACOSX) - if (GetContext()->GetBackendType() == Context::BackendType::kOpenGLES) { - texture_external_pipelines_.CreateDefault(*context_, options); - } if (GetContext()->GetBackendType() == Context::BackendType::kOpenGLES) { tiled_texture_external_pipelines_.CreateDefault(*context_, options); } diff --git a/impeller/entity/contents/content_context.h b/impeller/entity/contents/content_context.h index 78728839a3461..6a228dbf28df1 100644 --- a/impeller/entity/contents/content_context.h +++ b/impeller/entity/contents/content_context.h @@ -29,8 +29,6 @@ #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" #include "impeller/entity/border_mask_blur.vert.h" #include "impeller/entity/clip.frag.h" @@ -58,7 +56,6 @@ #include "impeller/entity/sweep_gradient_fill.frag.h" #include "impeller/entity/texture_fill.frag.h" #include "impeller/entity/texture_fill.vert.h" -#include "impeller/entity/texture_fill_strict_src.frag.h" #include "impeller/entity/tiled_texture_fill.frag.h" #include "impeller/entity/uv.comp.h" #include "impeller/entity/vertices.frag.h" @@ -124,12 +121,8 @@ using SweepGradientSSBOFillPipeline = SweepGradientSsboFillFragmentShader>; using RRectBlurPipeline = RenderPipelineT; -using BlendPipeline = RenderPipelineT; using TexturePipeline = RenderPipelineT; -using TextureStrictSrcPipeline = - RenderPipelineT; using PositionUVPipeline = RenderPipelineT; using TiledTexturePipeline = @@ -250,9 +243,6 @@ using PointsComputeShaderPipeline = ComputePipelineBuilder; using UvComputeShaderPipeline = ComputePipelineBuilder; #ifdef IMPELLER_ENABLE_OPENGLES -using TextureExternalPipeline = - RenderPipelineT; - using TiledTextureExternalPipeline = RenderPipelineT; @@ -456,29 +446,12 @@ class ContentContext { return GetPipeline(solid_fill_pipelines_, opts); } - std::shared_ptr> GetBlendPipeline( - ContentContextOptions opts) const { - return GetPipeline(texture_blend_pipelines_, opts); - } - std::shared_ptr> GetTexturePipeline( ContentContextOptions opts) const { return GetPipeline(texture_pipelines_, opts); } - std::shared_ptr> GetTextureStrictSrcPipeline( - ContentContextOptions opts) const { - return GetPipeline(texture_strict_src_pipelines_, opts); - } - #ifdef IMPELLER_ENABLE_OPENGLES - std::shared_ptr> GetTextureExternalPipeline( - ContentContextOptions opts) const { - FML_DCHECK(GetContext()->GetBackendType() == - Context::BackendType::kOpenGLES); - return GetPipeline(texture_external_pipelines_, opts); - } - std::shared_ptr> GetTiledTextureExternalPipeline( ContentContextOptions opts) const { FML_DCHECK(GetContext()->GetBackendType() == @@ -933,11 +906,8 @@ class ContentContext { mutable Variants sweep_gradient_ssbo_fill_pipelines_; mutable Variants rrect_blur_pipelines_; - mutable Variants texture_blend_pipelines_; mutable Variants texture_pipelines_; - mutable Variants texture_strict_src_pipelines_; #ifdef IMPELLER_ENABLE_OPENGLES - mutable Variants texture_external_pipelines_; mutable Variants tiled_texture_external_pipelines_; #endif // IMPELLER_ENABLE_OPENGLES diff --git a/impeller/entity/contents/filters/blend_filter_contents.cc b/impeller/entity/contents/filters/blend_filter_contents.cc index 2af8be96bb97f..1f762b37ef895 100644 --- a/impeller/entity/contents/filters/blend_filter_contents.cc +++ b/impeller/entity/contents/filters/blend_filter_contents.cc @@ -508,8 +508,8 @@ static std::optional PipelineBlend( std::optional foreground_color, ColorFilterContents::AbsorbOpacity absorb_opacity, std::optional alpha) { - using VS = BlendPipeline::VertexShader; - using FS = BlendPipeline::FragmentShader; + using VS = TexturePipeline::VertexShader; + using FS = TexturePipeline::FragmentShader; auto dst_snapshot = inputs[0]->GetSnapshot("PipelineBlend(Dst)", renderer, entity); @@ -555,7 +555,7 @@ static std::optional PipelineBlend( const std::unique_ptr& sampler = renderer.GetContext()->GetSamplerLibrary()->GetSampler( input->sampler_descriptor); - FS::BindTextureSamplerSrc(pass, input->texture, sampler); + FS::BindTextureSampler(pass, input->texture, sampler); auto size = input->texture->GetSize(); VertexBufferBuilder vtx_builder; @@ -575,7 +575,7 @@ static std::optional PipelineBlend( input->texture->GetYCoordScale(); FS::FragInfo frag_info; - frag_info.input_alpha = + frag_info.alpha = absorb_opacity == ColorFilterContents::AbsorbOpacity::kYes ? input->opacity : 1.0; @@ -587,7 +587,7 @@ static std::optional PipelineBlend( // Draw the first texture using kSource. options.blend_mode = BlendMode::kSource; - pass.SetPipeline(renderer.GetBlendPipeline(options)); + pass.SetPipeline(renderer.GetTexturePipeline(options)); if (!add_blend_command(dst_snapshot)) { return true; } @@ -596,7 +596,7 @@ static std::optional PipelineBlend( if (inputs.size() >= 2) { options.blend_mode = blend_mode; - pass.SetPipeline(renderer.GetBlendPipeline(options)); + pass.SetPipeline(renderer.GetTexturePipeline(options)); for (auto texture_i = inputs.begin() + 1; texture_i < inputs.end(); texture_i++) { diff --git a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc index 0840679de597f..c0a8a4538cc90 100644 --- a/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc +++ b/impeller/entity/contents/filters/gaussian_blur_filter_contents.cc @@ -95,7 +95,9 @@ fml::StatusOr MakeDownsampleSubpass( TextureFillVertexShader::FrameInfo frame_info; frame_info.mvp = Matrix::MakeOrthographic(ISize(1, 1)); frame_info.texture_sampler_y_coord_scale = 1.0; - frame_info.alpha = 1.0; + + TextureFillFragmentShader::FragInfo frag_info; + frag_info.alpha = 1.0; BindVertices(pass, host_buffer, { @@ -111,6 +113,8 @@ fml::StatusOr MakeDownsampleSubpass( linear_sampler_descriptor.min_filter = MinMagFilter::kLinear; TextureFillVertexShader::BindFrameInfo( pass, host_buffer.EmplaceUniform(frame_info)); + TextureFillFragmentShader::BindFragInfo( + pass, host_buffer.EmplaceUniform(frag_info)); TextureFillFragmentShader::BindTextureSampler( pass, input_texture, renderer.GetContext()->GetSamplerLibrary()->GetSampler( diff --git a/impeller/entity/contents/texture_contents.cc b/impeller/entity/contents/texture_contents.cc index f2f10207bf4be..cdd6a3783c110 100644 --- a/impeller/entity/contents/texture_contents.cc +++ b/impeller/entity/contents/texture_contents.cc @@ -13,13 +13,20 @@ #include "impeller/entity/entity.h" #include "impeller/entity/texture_fill.frag.h" #include "impeller/entity/texture_fill.vert.h" -#include "impeller/entity/texture_fill_external.frag.h" +#include "impeller/entity/tiled_texture_fill_external.frag.h" #include "impeller/geometry/constants.h" #include "impeller/renderer/render_pass.h" #include "impeller/renderer/vertex_buffer_builder.h" namespace impeller { +namespace { +constexpr Point ClampToSrcRect(const Point& input, const Rect& src_rect) { + return Point{std::clamp(input.x, src_rect.GetLeft(), src_rect.GetRight()), + std::clamp(input.y, src_rect.GetTop(), src_rect.GetBottom())}; +} +} // namespace + TextureContents::TextureContents() = default; TextureContents::~TextureContents() = default; @@ -113,8 +120,7 @@ bool TextureContents::Render(const ContentContext& renderer, using VS = TextureFillVertexShader; using FS = TextureFillFragmentShader; - using FSStrictSrc = TextureFillStrictSrcFragmentShader; - using FSExternal = TextureFillExternalFragmentShader; + using FSExternal = TiledTextureFillExternalFragmentShader; if (destination_rect_.IsEmpty() || source_rect_.IsEmpty() || texture_ == nullptr || texture_->GetSize().IsEmpty()) { @@ -130,21 +136,41 @@ bool TextureContents::Render(const ContentContext& renderer, VertexBufferBuilder vertex_builder; - auto destination_rect = - capture.AddRect("Destination rect", destination_rect_); - vertex_builder.AddVertices({ - {destination_rect.GetLeftTop(), texture_coords.GetLeftTop()}, - {destination_rect.GetRightTop(), texture_coords.GetRightTop()}, - {destination_rect.GetLeftBottom(), texture_coords.GetLeftBottom()}, - {destination_rect.GetRightBottom(), texture_coords.GetRightBottom()}, - }); + if (strict_source_rect_enabled_) { + auto destination_rect = + capture.AddRect("Destination rect", destination_rect_); + // For a strict source rect, shrink the texture coordinate range by half a + // texel to ensure that linear filtering does not sample anything outside + // the source rect bounds. + Rect strict_texture_coords = + Rect::MakeSize(texture_->GetSize()).Project(source_rect.Expand(-0.5)); + vertex_builder.AddVertices({ + {destination_rect.GetLeftTop(), + ClampToSrcRect(texture_coords.GetLeftTop(), strict_texture_coords)}, + {destination_rect.GetRightTop(), + ClampToSrcRect(texture_coords.GetRightTop(), strict_texture_coords)}, + {destination_rect.GetLeftBottom(), + ClampToSrcRect(texture_coords.GetLeftBottom(), strict_texture_coords)}, + {destination_rect.GetRightBottom(), + ClampToSrcRect(texture_coords.GetRightBottom(), + strict_texture_coords)}, + }); + } else { + auto destination_rect = + capture.AddRect("Destination rect", destination_rect_); + vertex_builder.AddVertices({ + {destination_rect.GetLeftTop(), texture_coords.GetLeftTop()}, + {destination_rect.GetRightTop(), texture_coords.GetRightTop()}, + {destination_rect.GetLeftBottom(), texture_coords.GetLeftBottom()}, + {destination_rect.GetRightBottom(), texture_coords.GetRightBottom()}, + }); + } auto& host_buffer = renderer.GetTransientsBuffer(); VS::FrameInfo frame_info; frame_info.mvp = entity.GetShaderTransform(pass); frame_info.texture_sampler_y_coord_scale = texture_->GetYCoordScale(); - frame_info.alpha = capture.AddScalar("Alpha", GetOpacity()); #ifdef IMPELLER_DEBUG if (label_.empty()) { @@ -160,44 +186,44 @@ bool TextureContents::Render(const ContentContext& renderer, } pipeline_options.primitive_type = PrimitiveType::kTriangleStrip; - std::shared_ptr> pipeline; #ifdef IMPELLER_ENABLE_OPENGLES if (is_external_texture) { - pipeline = renderer.GetTextureExternalPipeline(pipeline_options); - } -#endif // IMPELLER_ENABLE_OPENGLES - - if (!pipeline) { - if (strict_source_rect_enabled_) { - pipeline = renderer.GetTextureStrictSrcPipeline(pipeline_options); - } else { - pipeline = renderer.GetTexturePipeline(pipeline_options); - } + pass.SetPipeline( + renderer.GetTiledTextureExternalPipeline(pipeline_options)); + } else { + pass.SetPipeline(renderer.GetTexturePipeline(pipeline_options)); } - pass.SetPipeline(pipeline); +#else + pass.SetPipeline(renderer.GetTexturePipeline(pipeline_options)); +#endif // // IMPELLER_ENABLE_OPENGLES pass.SetVertexBuffer(vertex_builder.CreateVertexBuffer(host_buffer)); VS::BindFrameInfo(pass, host_buffer.EmplaceUniform(frame_info)); + if (is_external_texture) { + FSExternal::FragInfo frag_info; + frag_info.x_tile_mode = + static_cast(sampler_descriptor_.width_address_mode); + frag_info.y_tile_mode = + static_cast(sampler_descriptor_.height_address_mode); + frag_info.alpha = capture.AddScalar("Alpha", GetOpacity()); + + auto sampler_descriptor = sampler_descriptor_; + // OES_EGL_image_external states that only CLAMP_TO_EDGE is valid, so + // we emulate all other tile modes here by remapping the texture + // coordinates. + sampler_descriptor.width_address_mode = SamplerAddressMode::kClampToEdge; + sampler_descriptor.height_address_mode = SamplerAddressMode::kClampToEdge; + + FSExternal::BindFragInfo(pass, host_buffer.EmplaceUniform((frag_info))); FSExternal::BindSAMPLEREXTERNALOESTextureSampler( pass, texture_, renderer.GetContext()->GetSamplerLibrary()->GetSampler( - sampler_descriptor_)); - } else if (strict_source_rect_enabled_) { - // For a strict source rect, shrink the texture coordinate range by half a - // texel to ensure that linear filtering does not sample anything outside - // the source rect bounds. - auto strict_texture_coords = - Rect::MakeSize(texture_->GetSize()).Project(source_rect.Expand(-0.5)); - - FSStrictSrc::FragInfo frag_info; - frag_info.source_rect = Vector4(strict_texture_coords.GetLTRB()); - FSStrictSrc::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info)); - FSStrictSrc::BindTextureSampler( - pass, texture_, - renderer.GetContext()->GetSamplerLibrary()->GetSampler( - sampler_descriptor_)); + sampler_descriptor)); } else { + FS::FragInfo frag_info; + frag_info.alpha = capture.AddScalar("Alpha", GetOpacity()); + FS::BindFragInfo(pass, host_buffer.EmplaceUniform((frag_info))); FS::BindTextureSampler( pass, texture_, renderer.GetContext()->GetSamplerLibrary()->GetSampler( diff --git a/impeller/entity/contents/tiled_texture_contents.cc b/impeller/entity/contents/tiled_texture_contents.cc index b8baa2fef8f92..de6497033a307 100644 --- a/impeller/entity/contents/tiled_texture_contents.cc +++ b/impeller/entity/contents/tiled_texture_contents.cc @@ -6,6 +6,7 @@ #include "fml/logging.h" #include "impeller/entity/contents/content_context.h" +#include "impeller/entity/texture_fill.frag.h" #include "impeller/entity/texture_fill.vert.h" #include "impeller/entity/tiled_texture_fill.frag.h" #include "impeller/entity/tiled_texture_fill_external.frag.h" @@ -132,7 +133,6 @@ bool TiledTextureContents::Render(const ContentContext& renderer, VS::FrameInfo frame_info; frame_info.texture_sampler_y_coord_scale = texture_->GetYCoordScale(); - frame_info.alpha = GetOpacityFactor(); PipelineBuilderMethod pipeline_method; @@ -170,12 +170,19 @@ bool TiledTextureContents::Render(const ContentContext& renderer, FSExternal::FragInfo frag_info; frag_info.x_tile_mode = static_cast(x_tile_mode_); frag_info.y_tile_mode = static_cast(y_tile_mode_); + frag_info.alpha = GetOpacityFactor(); FSExternal::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info)); } else if (uses_emulated_tile_mode) { FS::FragInfo frag_info; frag_info.x_tile_mode = static_cast(x_tile_mode_); frag_info.y_tile_mode = static_cast(y_tile_mode_); + frag_info.alpha = GetOpacityFactor(); FS::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info)); + } else { + TextureFillFragmentShader::FragInfo frag_info; + frag_info.alpha = GetOpacityFactor(); + TextureFillFragmentShader::BindFragInfo( + pass, host_buffer.EmplaceUniform(frag_info)); } if (is_external_texture) { diff --git a/impeller/entity/contents/vertices_contents.cc b/impeller/entity/contents/vertices_contents.cc index 2db730e4e815a..9aeaa83023b83 100644 --- a/impeller/entity/contents/vertices_contents.cc +++ b/impeller/entity/contents/vertices_contents.cc @@ -169,9 +169,11 @@ bool VerticesUVContents::Render(const ContentContext& renderer, frame_info.mvp = geometry_result.transform; frame_info.texture_sampler_y_coord_scale = snapshot->texture->GetYCoordScale(); - frame_info.alpha = alpha_ * snapshot->opacity; VS::BindFrameInfo(pass, host_buffer.EmplaceUniform(frame_info)); + FS::FragInfo frag_info; + frag_info.alpha = alpha_ * snapshot->opacity; + FS::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info)); FS::BindTextureSampler(pass, snapshot->texture, renderer.GetContext()->GetSamplerLibrary()->GetSampler( snapshot->sampler_descriptor)); diff --git a/impeller/entity/shaders/blending/blend.frag b/impeller/entity/shaders/blending/blend.frag deleted file mode 100644 index d8eb5b806f894..0000000000000 --- a/impeller/entity/shaders/blending/blend.frag +++ /dev/null @@ -1,24 +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; - -#include -#include - -uniform f16sampler2D texture_sampler_src; - -uniform FragInfo { - float16_t input_alpha; -} -frag_info; - -in vec2 v_texture_coords; - -out f16vec4 frag_color; - -void main() { - frag_color = - texture(texture_sampler_src, v_texture_coords) * frag_info.input_alpha; -} diff --git a/impeller/entity/shaders/blending/blend.vert b/impeller/entity/shaders/blending/blend.vert deleted file mode 100644 index f8a08ecee3b37..0000000000000 --- a/impeller/entity/shaders/blending/blend.vert +++ /dev/null @@ -1,23 +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 - -uniform FrameInfo { - mat4 mvp; - float texture_sampler_y_coord_scale; -} -frame_info; - -in vec2 vertices; -in vec2 texture_coords; - -out vec2 v_texture_coords; - -void main() { - gl_Position = frame_info.mvp * vec4(vertices, 0.0, 1.0); - v_texture_coords = - IPRemapCoords(texture_coords, frame_info.texture_sampler_y_coord_scale); -} diff --git a/impeller/entity/shaders/texture_fill.frag b/impeller/entity/shaders/texture_fill.frag index c520b4701ce8d..515ec87acbe11 100644 --- a/impeller/entity/shaders/texture_fill.frag +++ b/impeller/entity/shaders/texture_fill.frag @@ -9,13 +9,17 @@ precision mediump float; uniform f16sampler2D texture_sampler; +uniform FragInfo { + float alpha; +} +frag_info; + in highp vec2 v_texture_coords; -IMPELLER_MAYBE_FLAT in float16_t v_alpha; out f16vec4 frag_color; void main() { f16vec4 sampled = texture(texture_sampler, v_texture_coords, kDefaultMipBiasHalf); - frag_color = sampled * v_alpha; + frag_color = sampled * float16_t(frag_info.alpha); } diff --git a/impeller/entity/shaders/texture_fill.vert b/impeller/entity/shaders/texture_fill.vert index baf56360fe72b..0dbc6fd4bfad4 100644 --- a/impeller/entity/shaders/texture_fill.vert +++ b/impeller/entity/shaders/texture_fill.vert @@ -8,7 +8,6 @@ uniform FrameInfo { mat4 mvp; float texture_sampler_y_coord_scale; - float16_t alpha; } frame_info; @@ -16,11 +15,9 @@ in vec2 position; in vec2 texture_coords; out vec2 v_texture_coords; -IMPELLER_MAYBE_FLAT out mediump float16_t v_alpha; void main() { gl_Position = frame_info.mvp * vec4(position, 0.0, 1.0); - v_alpha = frame_info.alpha; v_texture_coords = IPRemapCoords(texture_coords, frame_info.texture_sampler_y_coord_scale); } diff --git a/impeller/entity/shaders/texture_fill_external.frag b/impeller/entity/shaders/texture_fill_external.frag deleted file mode 100644 index b402c113eb950..0000000000000 --- a/impeller/entity/shaders/texture_fill_external.frag +++ /dev/null @@ -1,16 +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. - -uniform sampler2D SAMPLER_EXTERNAL_OES_texture_sampler; - -in vec2 v_texture_coords; -in float v_alpha; - -out vec4 frag_color; - -void main() { - vec4 sampled = - texture(SAMPLER_EXTERNAL_OES_texture_sampler, v_texture_coords); - frag_color = sampled * v_alpha; -} diff --git a/impeller/entity/shaders/texture_fill_strict_src.frag b/impeller/entity/shaders/texture_fill_strict_src.frag deleted file mode 100644 index 04f40298441f9..0000000000000 --- a/impeller/entity/shaders/texture_fill_strict_src.frag +++ /dev/null @@ -1,30 +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; - -#include -#include - -uniform f16sampler2D texture_sampler; - -uniform FragInfo { - vec4 source_rect; -} -frag_info; - -in highp vec2 v_texture_coords; -IMPELLER_MAYBE_FLAT in float16_t v_alpha; - -out f16vec4 frag_color; - -void main() { - vec2 texture_coords = vec2(clamp(v_texture_coords.x, frag_info.source_rect.x, - frag_info.source_rect.z), - clamp(v_texture_coords.y, frag_info.source_rect.y, - frag_info.source_rect.w)); - f16vec4 sampled = - texture(texture_sampler, texture_coords, kDefaultMipBiasHalf); - frag_color = sampled * v_alpha; -} diff --git a/impeller/entity/shaders/tiled_texture_fill.frag b/impeller/entity/shaders/tiled_texture_fill.frag index 5e8413ef98f9c..93f91cda12e84 100644 --- a/impeller/entity/shaders/tiled_texture_fill.frag +++ b/impeller/entity/shaders/tiled_texture_fill.frag @@ -10,13 +10,13 @@ precision mediump float; uniform f16sampler2D texture_sampler; uniform FragInfo { - float16_t x_tile_mode; - float16_t y_tile_mode; + float x_tile_mode; + float y_tile_mode; + float alpha; } frag_info; in highp vec2 v_texture_coords; -IMPELLER_MAYBE_FLAT in float16_t v_alpha; out f16vec4 frag_color; @@ -27,5 +27,5 @@ void main() { frag_info.x_tile_mode, // x tile mode frag_info.y_tile_mode // y tile mode ) * - v_alpha; + float16_t(frag_info.alpha); } diff --git a/impeller/entity/shaders/tiled_texture_fill_external.frag b/impeller/entity/shaders/tiled_texture_fill_external.frag index b0ece73193b66..7d744553ab066 100644 --- a/impeller/entity/shaders/tiled_texture_fill_external.frag +++ b/impeller/entity/shaders/tiled_texture_fill_external.frag @@ -11,11 +11,11 @@ uniform sampler2D SAMPLER_EXTERNAL_OES_texture_sampler; uniform FragInfo { float x_tile_mode; float y_tile_mode; + float alpha; } frag_info; in vec2 v_texture_coords; -in float v_alpha; out vec4 frag_color; @@ -26,5 +26,5 @@ void main() { frag_info.x_tile_mode, // x tile mode frag_info.y_tile_mode // y tile mode ) * - v_alpha; + frag_info.alpha; } From 1b0dede0219d437ec3fcb28bc463c9c62a59e6af Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Mon, 15 Apr 2024 15:39:40 -0700 Subject: [PATCH 2/9] delete old include. --- impeller/entity/contents/content_context.h | 1 - 1 file changed, 1 deletion(-) diff --git a/impeller/entity/contents/content_context.h b/impeller/entity/contents/content_context.h index 6a228dbf28df1..0da08d0318e33 100644 --- a/impeller/entity/contents/content_context.h +++ b/impeller/entity/contents/content_context.h @@ -81,7 +81,6 @@ #include "impeller/entity/framebuffer_blend.vert.h" #ifdef IMPELLER_ENABLE_OPENGLES -#include "impeller/entity/texture_fill_external.frag.h" #include "impeller/entity/tiled_texture_fill_external.frag.h" #endif // IMPELLER_ENABLE_OPENGLES From 80470b0498353d8b106ec8bfd3a8d2974fa6a31d Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Mon, 15 Apr 2024 15:41:29 -0700 Subject: [PATCH 3/9] delete files. --- ci/licenses_golden/licenses_flutter | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ci/licenses_golden/licenses_flutter b/ci/licenses_golden/licenses_flutter index 54ad49390de4d..da676625aeb30 100644 --- a/ci/licenses_golden/licenses_flutter +++ b/ci/licenses_golden/licenses_flutter @@ -40020,8 +40020,6 @@ ORIGIN: ../../../flutter/impeller/entity/render_target_cache.cc + ../../../flutt ORIGIN: ../../../flutter/impeller/entity/render_target_cache.h + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/blending/advanced_blend.frag + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/blending/advanced_blend.vert + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/impeller/entity/shaders/blending/blend.frag + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/impeller/entity/shaders/blending/blend.vert + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/blending/blend_select.glsl + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/blending/framebuffer_blend.frag + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/blending/framebuffer_blend.vert + ../../../flutter/LICENSE @@ -40066,8 +40064,6 @@ ORIGIN: ../../../flutter/impeller/entity/shaders/solid_fill.frag + ../../../flut ORIGIN: ../../../flutter/impeller/entity/shaders/solid_fill.vert + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/texture_fill.frag + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/texture_fill.vert + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/impeller/entity/shaders/texture_fill_external.frag + ../../../flutter/LICENSE -ORIGIN: ../../../flutter/impeller/entity/shaders/texture_fill_strict_src.frag + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/tiled_texture_fill.frag + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/tiled_texture_fill_external.frag + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/vertices.frag + ../../../flutter/LICENSE @@ -42900,8 +42896,6 @@ FILE: ../../../flutter/impeller/entity/render_target_cache.cc FILE: ../../../flutter/impeller/entity/render_target_cache.h FILE: ../../../flutter/impeller/entity/shaders/blending/advanced_blend.frag FILE: ../../../flutter/impeller/entity/shaders/blending/advanced_blend.vert -FILE: ../../../flutter/impeller/entity/shaders/blending/blend.frag -FILE: ../../../flutter/impeller/entity/shaders/blending/blend.vert FILE: ../../../flutter/impeller/entity/shaders/blending/blend_select.glsl FILE: ../../../flutter/impeller/entity/shaders/blending/framebuffer_blend.frag FILE: ../../../flutter/impeller/entity/shaders/blending/framebuffer_blend.vert @@ -42946,8 +42940,6 @@ FILE: ../../../flutter/impeller/entity/shaders/solid_fill.frag FILE: ../../../flutter/impeller/entity/shaders/solid_fill.vert FILE: ../../../flutter/impeller/entity/shaders/texture_fill.frag FILE: ../../../flutter/impeller/entity/shaders/texture_fill.vert -FILE: ../../../flutter/impeller/entity/shaders/texture_fill_external.frag -FILE: ../../../flutter/impeller/entity/shaders/texture_fill_strict_src.frag FILE: ../../../flutter/impeller/entity/shaders/tiled_texture_fill.frag FILE: ../../../flutter/impeller/entity/shaders/tiled_texture_fill_external.frag FILE: ../../../flutter/impeller/entity/shaders/vertices.frag From b6f7dad7d0453028533f713eda67483e69376204 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Mon, 15 Apr 2024 15:56:35 -0700 Subject: [PATCH 4/9] fix half types. --- impeller/entity/shaders/tiled_texture_fill.frag | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/impeller/entity/shaders/tiled_texture_fill.frag b/impeller/entity/shaders/tiled_texture_fill.frag index 93f91cda12e84..747bb646dac3d 100644 --- a/impeller/entity/shaders/tiled_texture_fill.frag +++ b/impeller/entity/shaders/tiled_texture_fill.frag @@ -22,10 +22,10 @@ out f16vec4 frag_color; void main() { frag_color = - IPHalfSampleWithTileMode(texture_sampler, // sampler - v_texture_coords, // texture coordinates - frag_info.x_tile_mode, // x tile mode - frag_info.y_tile_mode // y tile mode + IPHalfSampleWithTileMode(texture_sampler, // sampler + v_texture_coords, // texture coordinates + float16_t(frag_info.x_tile_mode), // x tile mode + float16_t(frag_info.y_tile_mode) // y tile mode ) * float16_t(frag_info.alpha); } From 283edfa136114fc692a97c7b394dbc82d06d4695 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Mon, 15 Apr 2024 17:18:10 -0700 Subject: [PATCH 5/9] update malioc. --- impeller/tools/malioc.json | 1284 +++++++----------------------------- 1 file changed, 229 insertions(+), 1055 deletions(-) diff --git a/impeller/tools/malioc.json b/impeller/tools/malioc.json index 81a7a27517de2..b7542bf00a4f0 100644 --- a/impeller/tools/malioc.json +++ b/impeller/tools/malioc.json @@ -184,191 +184,6 @@ } } }, - "flutter/impeller/entity/blend.frag.vkspv": { - "Mali-G78": { - "core": "Mali-G78", - "filename": "flutter/impeller/entity/blend.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": 100, - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "varying", - "texture" - ], - "longest_path_cycles": [ - 0.03125, - 0.03125, - 0.0, - 0.0, - 0.0, - 0.25, - 0.25 - ], - "pipelines": [ - "arith_total", - "arith_fma", - "arith_cvt", - "arith_sfu", - "load_store", - "varying", - "texture" - ], - "shortest_path_bound_pipelines": [ - "varying", - "texture" - ], - "shortest_path_cycles": [ - 0.03125, - 0.03125, - 0.0, - 0.0, - 0.0, - 0.25, - 0.25 - ], - "total_bound_pipelines": [ - "varying", - "texture" - ], - "total_cycles": [ - 0.03125, - 0.03125, - 0.0, - 0.0, - 0.0, - 0.25, - 0.25 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 100, - "uniform_registers_used": 4, - "work_registers_used": 4 - } - } - } - }, - "flutter/impeller/entity/blend.vert.vkspv": { - "Mali-G78": { - "core": "Mali-G78", - "filename": "flutter/impeller/entity/blend.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, - 3.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, - 3.0, - 0.0 - ], - "total_bound_pipelines": [ - "load_store" - ], - "total_cycles": [ - 0.015625, - 0.015625, - 0.015625, - 0.0, - 3.0, - 0.0 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 100, - "uniform_registers_used": 22, - "work_registers_used": 8 - } - } - } - }, "flutter/impeller/entity/border_mask_blur.frag.vkspv": { "Mali-G78": { "core": "Mali-G78", @@ -1428,12 +1243,12 @@ } } }, - "flutter/impeller/entity/gles/blend.frag.gles": { + "flutter/impeller/entity/gles/border_mask_blur.frag.gles": { "Mali-G78": { "core": "Mali-G78", - "filename": "flutter/impeller/entity/gles/blend.frag.gles", + "filename": "flutter/impeller/entity/gles/border_mask_blur.frag.gles", "has_side_effects": false, - "has_uniform_computation": false, + "has_uniform_computation": true, "modifies_coverage": false, "reads_color_buffer": false, "type": "Fragment", @@ -1441,18 +1256,18 @@ "uses_late_zs_update": false, "variants": { "Main": { - "fp16_arithmetic": 100, + "fp16_arithmetic": 81, "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ - "varying", - "texture" + "arith_total", + "arith_fma" ], "longest_path_cycles": [ - 0.03125, - 0.03125, - 0.03125, - 0.0, + 0.9375, + 0.9375, + 0.296875, + 0.25, 0.0, 0.25, 0.25 @@ -1467,27 +1282,27 @@ "texture" ], "shortest_path_bound_pipelines": [ - "varying", - "texture" + "arith_total", + "arith_fma" ], "shortest_path_cycles": [ - 0.03125, - 0.03125, - 0.0, - 0.0, + 0.9375, + 0.9375, + 0.265625, + 0.25, 0.0, 0.25, 0.25 ], "total_bound_pipelines": [ - "varying", - "texture" + "arith_total", + "arith_fma" ], "total_cycles": [ - 0.03125, - 0.03125, - 0.03125, - 0.0, + 0.9375, + 0.9375, + 0.296875, + 0.25, 0.0, 0.25, 0.25 @@ -1495,14 +1310,14 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 4, - "work_registers_used": 19 + "uniform_registers_used": 10, + "work_registers_used": 29 } } }, "Mali-T880": { "core": "Mali-T880", - "filename": "flutter/impeller/entity/gles/blend.frag.gles", + "filename": "flutter/impeller/entity/gles/border_mask_blur.frag.gles", "has_uniform_computation": false, "type": "Fragment", "variants": { @@ -1510,12 +1325,10 @@ "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ - "arithmetic", - "load_store", - "texture" + "arithmetic" ], "longest_path_cycles": [ - 1.0, + 8.579999923706055, 1.0, 1.0 ], @@ -1525,36 +1338,33 @@ "texture" ], "shortest_path_bound_pipelines": [ - "arithmetic", - "load_store", - "texture" + "arithmetic" ], "shortest_path_cycles": [ - 1.0, + 8.579999923706055, 1.0, 1.0 ], "total_bound_pipelines": [ - "load_store", - "texture" + "arithmetic" ], "total_cycles": [ - 0.6666666865348816, + 9.0, 1.0, 1.0 ] }, "thread_occupancy": 100, "uniform_registers_used": 1, - "work_registers_used": 2 + "work_registers_used": 3 } } } }, - "flutter/impeller/entity/gles/blend.vert.gles": { + "flutter/impeller/entity/gles/border_mask_blur.vert.gles": { "Mali-G78": { "core": "Mali-G78", - "filename": "flutter/impeller/entity/gles/blend.vert.gles", + "filename": "flutter/impeller/entity/gles/border_mask_blur.vert.gles", "has_uniform_computation": true, "type": "Vertex", "variants": { @@ -1664,7 +1474,7 @@ }, "Mali-T880": { "core": "Mali-T880", - "filename": "flutter/impeller/entity/gles/blend.vert.gles", + "filename": "flutter/impeller/entity/gles/border_mask_blur.vert.gles", "has_uniform_computation": false, "type": "Vertex", "variants": { @@ -1708,10 +1518,10 @@ } } }, - "flutter/impeller/entity/gles/border_mask_blur.frag.gles": { + "flutter/impeller/entity/gles/checkerboard.frag.gles": { "Mali-G78": { "core": "Mali-G78", - "filename": "flutter/impeller/entity/gles/border_mask_blur.frag.gles", + "filename": "flutter/impeller/entity/gles/checkerboard.frag.gles", "has_side_effects": false, "has_uniform_computation": true, "modifies_coverage": false, @@ -1721,21 +1531,20 @@ "uses_late_zs_update": false, "variants": { "Main": { - "fp16_arithmetic": 81, + "fp16_arithmetic": 27, "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ - "arith_total", - "arith_fma" + "load_store" ], "longest_path_cycles": [ - 0.9375, - 0.9375, - 0.296875, - 0.25, + 0.234375, + 0.234375, + 0.171875, + 0.0625, + 1.0, 0.0, - 0.25, - 0.25 + 0.0 ], "pipelines": [ "arith_total", @@ -1747,42 +1556,40 @@ "texture" ], "shortest_path_bound_pipelines": [ - "arith_total", - "arith_fma" + "load_store" ], "shortest_path_cycles": [ - 0.9375, - 0.9375, - 0.265625, - 0.25, + 0.234375, + 0.234375, + 0.140625, + 0.0625, + 1.0, 0.0, - 0.25, - 0.25 + 0.0 ], "total_bound_pipelines": [ - "arith_total", - "arith_fma" + "load_store" ], "total_cycles": [ - 0.9375, - 0.9375, - 0.296875, - 0.25, + 0.234375, + 0.234375, + 0.171875, + 0.0625, + 1.0, 0.0, - 0.25, - 0.25 + 0.0 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 10, - "work_registers_used": 29 + "uniform_registers_used": 12, + "work_registers_used": 21 } } }, "Mali-T880": { "core": "Mali-T880", - "filename": "flutter/impeller/entity/gles/border_mask_blur.frag.gles", + "filename": "flutter/impeller/entity/gles/checkerboard.frag.gles", "has_uniform_computation": false, "type": "Fragment", "variants": { @@ -1793,9 +1600,9 @@ "arithmetic" ], "longest_path_cycles": [ - 8.579999923706055, + 1.9800000190734863, 1.0, - 1.0 + 0.0 ], "pipelines": [ "arithmetic", @@ -1806,44 +1613,44 @@ "arithmetic" ], "shortest_path_cycles": [ - 8.579999923706055, + 1.9800000190734863, 1.0, - 1.0 + 0.0 ], "total_bound_pipelines": [ "arithmetic" ], "total_cycles": [ - 9.0, + 2.3333332538604736, 1.0, - 1.0 + 0.0 ] }, "thread_occupancy": 100, - "uniform_registers_used": 1, - "work_registers_used": 3 + "uniform_registers_used": 2, + "work_registers_used": 2 } } } }, - "flutter/impeller/entity/gles/border_mask_blur.vert.gles": { + "flutter/impeller/entity/gles/checkerboard.vert.gles": { "Mali-G78": { "core": "Mali-G78", - "filename": "flutter/impeller/entity/gles/border_mask_blur.vert.gles", - "has_uniform_computation": true, + "filename": "flutter/impeller/entity/gles/checkerboard.vert.gles", + "has_uniform_computation": false, "type": "Vertex", "variants": { "Position": { - "fp16_arithmetic": 0, + "fp16_arithmetic": null, "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ "load_store" ], "longest_path_cycles": [ - 0.140625, - 0.140625, + 0.015625, 0.0, + 0.015625, 0.0, 2.0, 0.0 @@ -1860,62 +1667,11 @@ "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, - 3.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, - 3.0, + 2.0, 0.0 ], "total_bound_pipelines": [ @@ -1923,23 +1679,23 @@ ], "total_cycles": [ 0.015625, - 0.015625, + 0.0, 0.015625, 0.0, - 3.0, + 2.0, 0.0 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 10, - "work_registers_used": 8 + "uniform_registers_used": 8, + "work_registers_used": 32 } } }, "Mali-T880": { "core": "Mali-T880", - "filename": "flutter/impeller/entity/gles/border_mask_blur.vert.gles", + "filename": "flutter/impeller/entity/gles/checkerboard.vert.gles", "has_uniform_computation": false, "type": "Vertex", "variants": { @@ -1950,8 +1706,8 @@ "load_store" ], "longest_path_cycles": [ - 2.9700000286102295, - 5.0, + 1.3200000524520874, + 3.0, 0.0 ], "pipelines": [ @@ -1963,32 +1719,32 @@ "load_store" ], "shortest_path_cycles": [ - 2.9700000286102295, - 5.0, + 1.3200000524520874, + 3.0, 0.0 ], "total_bound_pipelines": [ "load_store" ], "total_cycles": [ + 1.3333333730697632, 3.0, - 5.0, 0.0 ] }, "thread_occupancy": 100, - "uniform_registers_used": 6, + "uniform_registers_used": 2, "work_registers_used": 2 } } } }, - "flutter/impeller/entity/gles/checkerboard.frag.gles": { + "flutter/impeller/entity/gles/clip.frag.gles": { "Mali-G78": { "core": "Mali-G78", - "filename": "flutter/impeller/entity/gles/checkerboard.frag.gles", + "filename": "flutter/impeller/entity/gles/clip.frag.gles", "has_side_effects": false, - "has_uniform_computation": true, + "has_uniform_computation": false, "modifies_coverage": false, "reads_color_buffer": false, "type": "Fragment", @@ -1996,18 +1752,19 @@ "uses_late_zs_update": false, "variants": { "Main": { - "fp16_arithmetic": 27, + "fp16_arithmetic": null, "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ - "load_store" + "arith_total", + "arith_cvt" ], "longest_path_cycles": [ - 0.234375, - 0.234375, - 0.171875, - 0.0625, - 1.0, + 0.015625, + 0.0, + 0.015625, + 0.0, + 0.0, 0.0, 0.0 ], @@ -2021,40 +1778,42 @@ "texture" ], "shortest_path_bound_pipelines": [ - "load_store" + "arith_total", + "arith_cvt" ], "shortest_path_cycles": [ - 0.234375, - 0.234375, - 0.140625, - 0.0625, - 1.0, + 0.015625, + 0.0, + 0.015625, + 0.0, + 0.0, 0.0, 0.0 ], "total_bound_pipelines": [ - "load_store" + "arith_total", + "arith_cvt" ], "total_cycles": [ - 0.234375, - 0.234375, - 0.171875, - 0.0625, - 1.0, + 0.015625, + 0.0, + 0.015625, + 0.0, + 0.0, 0.0, 0.0 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 12, - "work_registers_used": 21 + "uniform_registers_used": 0, + "work_registers_used": 1 } } }, "Mali-T880": { "core": "Mali-T880", - "filename": "flutter/impeller/entity/gles/checkerboard.frag.gles", + "filename": "flutter/impeller/entity/gles/clip.frag.gles", "has_uniform_computation": false, "type": "Fragment", "variants": { @@ -2065,8 +1824,8 @@ "arithmetic" ], "longest_path_cycles": [ - 1.9800000190734863, 1.0, + 0.0, 0.0 ], "pipelines": [ @@ -2078,45 +1837,45 @@ "arithmetic" ], "shortest_path_cycles": [ - 1.9800000190734863, 1.0, + 0.0, 0.0 ], "total_bound_pipelines": [ "arithmetic" ], "total_cycles": [ - 2.3333332538604736, - 1.0, + 0.6666666865348816, + 0.0, 0.0 ] }, "thread_occupancy": 100, - "uniform_registers_used": 2, + "uniform_registers_used": 0, "work_registers_used": 2 } } } }, - "flutter/impeller/entity/gles/checkerboard.vert.gles": { + "flutter/impeller/entity/gles/clip.vert.gles": { "Mali-G78": { "core": "Mali-G78", - "filename": "flutter/impeller/entity/gles/checkerboard.vert.gles", - "has_uniform_computation": false, + "filename": "flutter/impeller/entity/gles/clip.vert.gles", + "has_uniform_computation": true, "type": "Vertex", "variants": { "Position": { - "fp16_arithmetic": null, + "fp16_arithmetic": 0, "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ "load_store" ], "longest_path_cycles": [ - 0.015625, - 0.0, - 0.015625, + 0.15625, + 0.15625, 0.0, + 0.0625, 2.0, 0.0 ], @@ -2132,10 +1891,10 @@ "load_store" ], "shortest_path_cycles": [ - 0.015625, - 0.0, - 0.015625, + 0.15625, + 0.15625, 0.0, + 0.0625, 2.0, 0.0 ], @@ -2143,24 +1902,24 @@ "load_store" ], "total_cycles": [ - 0.015625, - 0.0, - 0.015625, + 0.15625, + 0.15625, 0.0, + 0.0625, 2.0, 0.0 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 8, + "uniform_registers_used": 18, "work_registers_used": 32 } } }, "Mali-T880": { "core": "Mali-T880", - "filename": "flutter/impeller/entity/gles/checkerboard.vert.gles", + "filename": "flutter/impeller/entity/gles/clip.vert.gles", "has_uniform_computation": false, "type": "Vertex", "variants": { @@ -2171,7 +1930,7 @@ "load_store" ], "longest_path_cycles": [ - 1.3200000524520874, + 2.640000104904175, 3.0, 0.0 ], @@ -2184,7 +1943,7 @@ "load_store" ], "shortest_path_cycles": [ - 1.3200000524520874, + 2.640000104904175, 3.0, 0.0 ], @@ -2192,237 +1951,13 @@ "load_store" ], "total_cycles": [ - 1.3333333730697632, + 2.6666667461395264, 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", - "filename": "flutter/impeller/entity/gles/clip.frag.gles", - "has_side_effects": false, - "has_uniform_computation": false, - "modifies_coverage": false, - "reads_color_buffer": false, - "type": "Fragment", - "uses_late_zs_test": false, - "uses_late_zs_update": false, - "variants": { - "Main": { - "fp16_arithmetic": null, - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "arith_total", - "arith_cvt" - ], - "longest_path_cycles": [ - 0.015625, - 0.0, - 0.015625, - 0.0, - 0.0, - 0.0, - 0.0 - ], - "pipelines": [ - "arith_total", - "arith_fma", - "arith_cvt", - "arith_sfu", - "load_store", - "varying", - "texture" - ], - "shortest_path_bound_pipelines": [ - "arith_total", - "arith_cvt" - ], - "shortest_path_cycles": [ - 0.015625, - 0.0, - 0.015625, - 0.0, - 0.0, - 0.0, - 0.0 - ], - "total_bound_pipelines": [ - "arith_total", - "arith_cvt" - ], - "total_cycles": [ - 0.015625, - 0.0, - 0.015625, - 0.0, - 0.0, - 0.0, - 0.0 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 100, - "uniform_registers_used": 0, - "work_registers_used": 1 - } - } - }, - "Mali-T880": { - "core": "Mali-T880", - "filename": "flutter/impeller/entity/gles/clip.frag.gles", - "has_uniform_computation": false, - "type": "Fragment", - "variants": { - "Main": { - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "arithmetic" - ], - "longest_path_cycles": [ - 1.0, - 0.0, - 0.0 - ], - "pipelines": [ - "arithmetic", - "load_store", - "texture" - ], - "shortest_path_bound_pipelines": [ - "arithmetic" - ], - "shortest_path_cycles": [ - 1.0, - 0.0, - 0.0 - ], - "total_bound_pipelines": [ - "arithmetic" - ], - "total_cycles": [ - 0.6666666865348816, - 0.0, - 0.0 - ] - }, - "thread_occupancy": 100, - "uniform_registers_used": 0, - "work_registers_used": 2 - } - } - } - }, - "flutter/impeller/entity/gles/clip.vert.gles": { - "Mali-G78": { - "core": "Mali-G78", - "filename": "flutter/impeller/entity/gles/clip.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.15625, - 0.15625, - 0.0, - 0.0625, - 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.15625, - 0.15625, - 0.0, - 0.0625, - 2.0, - 0.0 - ], - "total_bound_pipelines": [ - "load_store" - ], - "total_cycles": [ - 0.15625, - 0.15625, - 0.0, - 0.0625, - 2.0, - 0.0 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 100, - "uniform_registers_used": 18, - "work_registers_used": 32 - } - } - }, - "Mali-T880": { - "core": "Mali-T880", - "filename": "flutter/impeller/entity/gles/clip.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.640000104904175, - 3.0, - 0.0 - ], - "pipelines": [ - "arithmetic", - "load_store", - "texture" - ], - "shortest_path_bound_pipelines": [ - "load_store" - ], - "shortest_path_cycles": [ - 2.640000104904175, - 3.0, - 0.0 - ], - "total_bound_pipelines": [ - "load_store" - ], - "total_cycles": [ - 2.6666667461395264, - 3.0, - 0.0 - ] - }, - "thread_occupancy": 100, - "uniform_registers_used": 6, + "uniform_registers_used": 6, "work_registers_used": 2 } } @@ -5788,7 +5323,8 @@ "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ - "varying" + "varying", + "texture" ], "longest_path_cycles": [ 0.046875, @@ -5796,7 +5332,7 @@ 0.046875, 0.0, 0.0, - 0.375, + 0.25, 0.25 ], "pipelines": [ @@ -5809,7 +5345,8 @@ "texture" ], "shortest_path_bound_pipelines": [ - "varying" + "varying", + "texture" ], "shortest_path_cycles": [ 0.03125, @@ -5817,11 +5354,12 @@ 0.015625, 0.0, 0.0, - 0.375, + 0.25, 0.25 ], "total_bound_pipelines": [ - "varying" + "varying", + "texture" ], "total_cycles": [ 0.046875, @@ -5829,13 +5367,13 @@ 0.046875, 0.0, 0.0, - 0.375, + 0.25, 0.25 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 2, + "uniform_registers_used": 4, "work_registers_used": 19 } } @@ -5885,7 +5423,7 @@ ] }, "thread_occupancy": 100, - "uniform_registers_used": 0, + "uniform_registers_used": 1, "work_registers_used": 2 } } @@ -5957,11 +5495,11 @@ "load_store" ], "longest_path_cycles": [ - 0.03125, 0.015625, - 0.03125, + 0.015625, + 0.015625, 0.0, - 4.0, + 3.0, 0.0 ], "pipelines": [ @@ -5976,29 +5514,29 @@ "load_store" ], "shortest_path_cycles": [ - 0.03125, 0.015625, - 0.03125, + 0.015625, + 0.015625, 0.0, - 4.0, + 3.0, 0.0 ], "total_bound_pipelines": [ "load_store" ], "total_cycles": [ - 0.03125, 0.015625, - 0.03125, + 0.015625, + 0.015625, 0.0, - 4.0, + 3.0, 0.0 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, "uniform_registers_used": 10, - "work_registers_used": 7 + "work_registers_used": 8 } } }, @@ -6016,7 +5554,7 @@ ], "longest_path_cycles": [ 2.9700000286102295, - 6.0, + 5.0, 0.0 ], "pipelines": [ @@ -6029,256 +5567,20 @@ ], "shortest_path_cycles": [ 2.9700000286102295, - 6.0, + 5.0, 0.0 ], "total_bound_pipelines": [ "load_store" ], "total_cycles": [ - 3.0, - 6.0, - 0.0 - ] - }, - "thread_occupancy": 100, - "uniform_registers_used": 6, - "work_registers_used": 2 - } - } - } - }, - "flutter/impeller/entity/gles/texture_fill_external.frag.gles": { - "Mali-G78": { - "core": "Mali-G78", - "filename": "flutter/impeller/entity/gles/texture_fill_external.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": [ - "varying" - ], - "longest_path_cycles": [ - 0.203125, - 0.203125, - 0.03125, - 0.0, - 0.0, - 0.375, - 0.25 - ], - "pipelines": [ - "arith_total", - "arith_fma", - "arith_cvt", - "arith_sfu", - "load_store", - "varying", - "texture" - ], - "shortest_path_bound_pipelines": [ - "varying" - ], - "shortest_path_cycles": [ - 0.203125, - 0.203125, - 0.0, - 0.0, - 0.0, - 0.375, - 0.25 - ], - "total_bound_pipelines": [ - "varying" - ], - "total_cycles": [ - 0.203125, - 0.203125, - 0.03125, - 0.0, - 0.0, - 0.375, - 0.25 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 100, - "uniform_registers_used": 14, - "work_registers_used": 19 - } - } - }, - "Mali-T880": { - "core": "Mali-T880", - "filename": "flutter/impeller/entity/gles/texture_fill_external.frag.gles", - "has_uniform_computation": false, - "type": "Fragment", - "variants": { - "Main": { - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "arithmetic" - ], - "longest_path_cycles": [ - 1.649999976158142, - 1.0, - 1.0 - ], - "pipelines": [ - "arithmetic", - "load_store", - "texture" - ], - "shortest_path_bound_pipelines": [ - "arithmetic" - ], - "shortest_path_cycles": [ - 1.649999976158142, - 1.0, - 1.0 - ], - "total_bound_pipelines": [ - "arithmetic" - ], - "total_cycles": [ - 2.0, - 1.0, - 1.0 - ] - }, - "thread_occupancy": 100, - "uniform_registers_used": 2, - "work_registers_used": 3 - } - } - } - }, - "flutter/impeller/entity/gles/texture_fill_strict_src.frag.gles": { - "Mali-G78": { - "core": "Mali-G78", - "filename": "flutter/impeller/entity/gles/texture_fill_strict_src.frag.gles", - "has_side_effects": false, - "has_uniform_computation": false, - "modifies_coverage": false, - "reads_color_buffer": false, - "type": "Fragment", - "uses_late_zs_test": false, - "uses_late_zs_update": false, - "variants": { - "Main": { - "fp16_arithmetic": 33, - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "varying" - ], - "longest_path_cycles": [ - 0.109375, - 0.03125, - 0.109375, - 0.0, - 0.0, - 0.375, - 0.25 - ], - "pipelines": [ - "arith_total", - "arith_fma", - "arith_cvt", - "arith_sfu", - "load_store", - "varying", - "texture" - ], - "shortest_path_bound_pipelines": [ - "varying" - ], - "shortest_path_cycles": [ - 0.078125, - 0.03125, - 0.078125, - 0.0, - 0.0, - 0.375, - 0.25 - ], - "total_bound_pipelines": [ - "varying" - ], - "total_cycles": [ - 0.109375, - 0.03125, - 0.109375, - 0.0, - 0.0, - 0.375, - 0.25 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 100, - "uniform_registers_used": 4, - "work_registers_used": 20 - } - } - }, - "Mali-T880": { - "core": "Mali-T880", - "filename": "flutter/impeller/entity/gles/texture_fill_strict_src.frag.gles", - "has_uniform_computation": false, - "type": "Fragment", - "variants": { - "Main": { - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "arithmetic", - "load_store", - "texture" - ], - "longest_path_cycles": [ - 1.0, - 1.0, - 1.0 - ], - "pipelines": [ - "arithmetic", - "load_store", - "texture" - ], - "shortest_path_bound_pipelines": [ - "arithmetic", - "load_store", - "texture" - ], - "shortest_path_cycles": [ - 1.0, - 1.0, - 1.0 - ], - "total_bound_pipelines": [ - "arithmetic", - "load_store", - "texture" - ], - "total_cycles": [ - 1.0, - 1.0, - 1.0 + 3.0, + 5.0, + 0.0 ] }, "thread_occupancy": 100, - "uniform_registers_used": 1, + "uniform_registers_used": 6, "work_registers_used": 2 } } @@ -6301,15 +5603,16 @@ "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ - "varying" + "arith_total", + "arith_cvt" ], "longest_path_cycles": [ - 0.25, + 0.265625, 0.03125, - 0.25, + 0.265625, 0.0, 0.0, - 0.375, + 0.25, 0.25 ], "pipelines": [ @@ -6322,27 +5625,29 @@ "texture" ], "shortest_path_bound_pipelines": [ - "varying" + "varying", + "texture" ], "shortest_path_cycles": [ - 0.046875, + 0.0625, 0.03125, - 0.046875, + 0.0625, 0.0, 0.0, - 0.375, + 0.25, 0.25 ], "total_bound_pipelines": [ - "varying" + "arith_total", + "arith_cvt" ], "total_cycles": [ - 0.25, + 0.265625, 0.03125, - 0.25, + 0.265625, 0.0, 0.0, - 0.375, + 0.25, 0.25 ] }, @@ -6367,7 +5672,7 @@ ], "longest_path_cycles": [ 3.299999952316284, - 2.0, + 1.0, 1.0 ], "pipelines": [ @@ -6376,11 +5681,11 @@ "texture" ], "shortest_path_bound_pipelines": [ - "load_store" + "arithmetic" ], "shortest_path_cycles": [ 1.3200000524520874, - 2.0, + 1.0, 0.0 ], "total_bound_pipelines": [ @@ -6388,7 +5693,7 @@ ], "total_cycles": [ 3.6666667461395264, - 2.0, + 1.0, 1.0 ] }, @@ -6425,7 +5730,7 @@ 0.421875, 0.0, 0.0, - 0.25, + 0.125, 0.25 ], "pipelines": [ @@ -6446,7 +5751,7 @@ 0.09375, 0.0, 0.0, - 0.25, + 0.125, 0.0 ], "total_bound_pipelines": [ @@ -6459,7 +5764,7 @@ 0.515625, 0.0, 0.0, - 0.25, + 0.125, 0.25 ] }, @@ -6484,7 +5789,7 @@ ], "longest_path_cycles": [ 7.920000076293945, - 2.0, + 1.0, 1.0 ], "pipelines": [ @@ -6493,11 +5798,11 @@ "texture" ], "shortest_path_bound_pipelines": [ - "load_store" + "arithmetic" ], "shortest_path_cycles": [ 1.3200000524520874, - 2.0, + 1.0, 0.0 ], "total_bound_pipelines": [ @@ -6505,7 +5810,7 @@ ], "total_cycles": [ 9.0, - 2.0, + 1.0, 1.0 ] }, @@ -8969,7 +8274,7 @@ "core": "Mali-G78", "filename": "flutter/impeller/entity/texture_fill.frag.vkspv", "has_side_effects": false, - "has_uniform_computation": false, + "has_uniform_computation": true, "modifies_coverage": false, "reads_color_buffer": false, "type": "Fragment", @@ -8981,7 +8286,8 @@ "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ - "varying" + "varying", + "texture" ], "longest_path_cycles": [ 0.03125, @@ -8989,7 +8295,7 @@ 0.015625, 0.0, 0.0, - 0.375, + 0.25, 0.25 ], "pipelines": [ @@ -9002,7 +8308,8 @@ "texture" ], "shortest_path_bound_pipelines": [ - "varying" + "varying", + "texture" ], "shortest_path_cycles": [ 0.03125, @@ -9010,11 +8317,12 @@ 0.015625, 0.0, 0.0, - 0.375, + 0.25, 0.25 ], "total_bound_pipelines": [ - "varying" + "varying", + "texture" ], "total_cycles": [ 0.03125, @@ -9022,14 +8330,14 @@ 0.015625, 0.0, 0.0, - 0.375, + 0.25, 0.25 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 2, - "work_registers_used": 6 + "uniform_registers_used": 4, + "work_registers_used": 5 } } } @@ -9100,11 +8408,11 @@ "load_store" ], "longest_path_cycles": [ - 0.03125, 0.015625, - 0.03125, + 0.015625, + 0.015625, 0.0, - 4.0, + 3.0, 0.0 ], "pipelines": [ @@ -9119,107 +8427,37 @@ "load_store" ], "shortest_path_cycles": [ - 0.03125, 0.015625, - 0.03125, + 0.015625, + 0.015625, 0.0, - 4.0, + 3.0, 0.0 ], "total_bound_pipelines": [ "load_store" ], "total_cycles": [ - 0.03125, 0.015625, - 0.03125, + 0.015625, + 0.015625, 0.0, - 4.0, + 3.0, 0.0 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, "uniform_registers_used": 22, - "work_registers_used": 7 - } - } - } - }, - "flutter/impeller/entity/texture_fill_external.frag.vkspv": { - "Mali-G78": { - "core": "Mali-G78", - "filename": "flutter/impeller/entity/texture_fill_external.frag.vkspv", - "has_side_effects": false, - "has_uniform_computation": false, - "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": [ - "varying" - ], - "longest_path_cycles": [ - 0.0625, - 0.0625, - 0.0, - 0.0, - 0.0, - 0.375, - 0.25 - ], - "pipelines": [ - "arith_total", - "arith_fma", - "arith_cvt", - "arith_sfu", - "load_store", - "varying", - "texture" - ], - "shortest_path_bound_pipelines": [ - "varying" - ], - "shortest_path_cycles": [ - 0.0625, - 0.0625, - 0.0, - 0.0, - 0.0, - 0.375, - 0.25 - ], - "total_bound_pipelines": [ - "varying" - ], - "total_cycles": [ - 0.0625, - 0.0625, - 0.0, - 0.0, - 0.0, - 0.375, - 0.25 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 100, - "uniform_registers_used": 4, - "work_registers_used": 10 + "work_registers_used": 8 } } } }, - "flutter/impeller/entity/texture_fill_strict_src.frag.vkspv": { + "flutter/impeller/entity/tiled_texture_fill.frag.vkspv": { "Mali-G78": { "core": "Mali-G78", - "filename": "flutter/impeller/entity/texture_fill_strict_src.frag.vkspv", + "filename": "flutter/impeller/entity/tiled_texture_fill.frag.vkspv", "has_side_effects": false, "has_uniform_computation": true, "modifies_coverage": false, @@ -9233,85 +8471,18 @@ "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ - "varying" - ], - "longest_path_cycles": [ - 0.078125, - 0.03125, - 0.078125, - 0.0, - 0.0, - 0.375, - 0.25 - ], - "pipelines": [ "arith_total", - "arith_fma", "arith_cvt", - "arith_sfu", - "load_store", "varying", "texture" ], - "shortest_path_bound_pipelines": [ - "varying" - ], - "shortest_path_cycles": [ - 0.078125, - 0.03125, - 0.078125, - 0.0, - 0.0, - 0.375, - 0.25 - ], - "total_bound_pipelines": [ - "varying" - ], - "total_cycles": [ - 0.078125, - 0.03125, - 0.078125, - 0.0, - 0.0, - 0.375, - 0.25 - ] - }, - "stack_spill_bytes": 0, - "thread_occupancy": 100, - "uniform_registers_used": 6, - "work_registers_used": 6 - } - } - } - }, - "flutter/impeller/entity/tiled_texture_fill.frag.vkspv": { - "Mali-G78": { - "core": "Mali-G78", - "filename": "flutter/impeller/entity/tiled_texture_fill.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": 33, - "has_stack_spilling": false, - "performance": { - "longest_path_bound_pipelines": [ - "varying" - ], "longest_path_cycles": [ 0.25, 0.03125, 0.25, 0.0625, 0.0, - 0.375, + 0.25, 0.25 ], "pipelines": [ @@ -9332,11 +8503,14 @@ 0.140625, 0.0625, 0.0, - 0.375, + 0.25, 0.0 ], "total_bound_pipelines": [ - "varying" + "arith_total", + "arith_cvt", + "varying", + "texture" ], "total_cycles": [ 0.25, @@ -9344,14 +8518,14 @@ 0.25, 0.0625, 0.0, - 0.375, + 0.25, 0.25 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, "uniform_registers_used": 4, - "work_registers_used": 8 + "work_registers_used": 7 } } } @@ -9382,7 +8556,7 @@ 0.328125, 0.0, 0.0, - 0.25, + 0.125, 0.25 ], "pipelines": [ @@ -9403,7 +8577,7 @@ 0.109375, 0.0, 0.0, - 0.25, + 0.125, 0.0 ], "total_bound_pipelines": [ @@ -9416,14 +8590,14 @@ 0.390625, 0.0, 0.0, - 0.25, + 0.125, 0.25 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, "uniform_registers_used": 6, - "work_registers_used": 7 + "work_registers_used": 6 } } } From 645dc4c556fd18efc2de64067796d5108e81b3ab Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Wed, 17 Apr 2024 17:14:18 -0700 Subject: [PATCH 6/9] add back strict src rect. --- impeller/entity/BUILD.gn | 1 + impeller/entity/contents/content_context.cc | 1 + impeller/entity/contents/content_context.h | 10 +++ impeller/entity/contents/texture_contents.cc | 81 +++++++++---------- .../shaders/texture_fill_strict_src.frag | 30 +++++++ 5 files changed, 79 insertions(+), 44 deletions(-) create mode 100644 impeller/entity/shaders/texture_fill_strict_src.frag diff --git a/impeller/entity/BUILD.gn b/impeller/entity/BUILD.gn index 46da4d642063d..42d0a32a3f244 100644 --- a/impeller/entity/BUILD.gn +++ b/impeller/entity/BUILD.gn @@ -41,6 +41,7 @@ impeller_shaders("entity_shaders") { "shaders/texture_fill.vert", "shaders/tiled_texture_fill.frag", "shaders/tiled_texture_fill_external.frag", + "shaders/texture_fill_strict_src.frag", "shaders/vertices.frag", "shaders/blending/porter_duff_blend.frag", "shaders/blending/porter_duff_blend.vert", diff --git a/impeller/entity/contents/content_context.cc b/impeller/entity/contents/content_context.cc index 2e150f0fbcf5b..7cbab8164f582 100644 --- a/impeller/entity/contents/content_context.cc +++ b/impeller/entity/contents/content_context.cc @@ -401,6 +401,7 @@ ContentContext::ContentContext( rrect_blur_pipelines_.CreateDefault(*context_, options_trianglestrip); texture_pipelines_.CreateDefault(*context_, options); + texture_strict_src_pipelines_.CreateDefault(*context_, options); position_uv_pipelines_.CreateDefault(*context_, options); tiled_texture_pipelines_.CreateDefault(*context_, options); kernel_decal_pipelines_.CreateDefault(*context_, options_trianglestrip); diff --git a/impeller/entity/contents/content_context.h b/impeller/entity/contents/content_context.h index 0da08d0318e33..ab650fe447521 100644 --- a/impeller/entity/contents/content_context.h +++ b/impeller/entity/contents/content_context.h @@ -56,6 +56,7 @@ #include "impeller/entity/sweep_gradient_fill.frag.h" #include "impeller/entity/texture_fill.frag.h" #include "impeller/entity/texture_fill.vert.h" +#include "impeller/entity/texture_fill_strict_src.frag.h" #include "impeller/entity/tiled_texture_fill.frag.h" #include "impeller/entity/uv.comp.h" #include "impeller/entity/vertices.frag.h" @@ -126,6 +127,9 @@ using PositionUVPipeline = RenderPipelineT; using TiledTexturePipeline = RenderPipelineT; +using TextureStrictSrcPipeline = + RenderPipelineT; using KernelDecalPipeline = RenderPipelineT; using KernelPipeline = @@ -450,6 +454,11 @@ class ContentContext { return GetPipeline(texture_pipelines_, opts); } + std::shared_ptr> GetTextureStrictSrcPipeline( + ContentContextOptions opts) const { + return GetPipeline(texture_strict_src_pipelines_, opts); + } + #ifdef IMPELLER_ENABLE_OPENGLES std::shared_ptr> GetTiledTextureExternalPipeline( ContentContextOptions opts) const { @@ -906,6 +915,7 @@ class ContentContext { sweep_gradient_ssbo_fill_pipelines_; mutable Variants rrect_blur_pipelines_; mutable Variants texture_pipelines_; + mutable Variants texture_strict_src_pipelines_; #ifdef IMPELLER_ENABLE_OPENGLES mutable Variants tiled_texture_external_pipelines_; diff --git a/impeller/entity/contents/texture_contents.cc b/impeller/entity/contents/texture_contents.cc index cdd6a3783c110..d48b4b6eaace2 100644 --- a/impeller/entity/contents/texture_contents.cc +++ b/impeller/entity/contents/texture_contents.cc @@ -13,6 +13,7 @@ #include "impeller/entity/entity.h" #include "impeller/entity/texture_fill.frag.h" #include "impeller/entity/texture_fill.vert.h" +#include "impeller/entity/texture_fill_strict_src.frag.h" #include "impeller/entity/tiled_texture_fill_external.frag.h" #include "impeller/geometry/constants.h" #include "impeller/renderer/render_pass.h" @@ -20,13 +21,6 @@ namespace impeller { -namespace { -constexpr Point ClampToSrcRect(const Point& input, const Rect& src_rect) { - return Point{std::clamp(input.x, src_rect.GetLeft(), src_rect.GetRight()), - std::clamp(input.y, src_rect.GetTop(), src_rect.GetBottom())}; -} -} // namespace - TextureContents::TextureContents() = default; TextureContents::~TextureContents() = default; @@ -121,6 +115,7 @@ bool TextureContents::Render(const ContentContext& renderer, using VS = TextureFillVertexShader; using FS = TextureFillFragmentShader; using FSExternal = TiledTextureFillExternalFragmentShader; + using FSStrict = TextureFillStrictSrcFragmentShader; if (destination_rect_.IsEmpty() || source_rect_.IsEmpty() || texture_ == nullptr || texture_->GetSize().IsEmpty()) { @@ -135,36 +130,14 @@ bool TextureContents::Render(const ContentContext& renderer, Rect::MakeSize(texture_->GetSize()).Project(source_rect); VertexBufferBuilder vertex_builder; - - if (strict_source_rect_enabled_) { - auto destination_rect = - capture.AddRect("Destination rect", destination_rect_); - // For a strict source rect, shrink the texture coordinate range by half a - // texel to ensure that linear filtering does not sample anything outside - // the source rect bounds. - Rect strict_texture_coords = - Rect::MakeSize(texture_->GetSize()).Project(source_rect.Expand(-0.5)); - vertex_builder.AddVertices({ - {destination_rect.GetLeftTop(), - ClampToSrcRect(texture_coords.GetLeftTop(), strict_texture_coords)}, - {destination_rect.GetRightTop(), - ClampToSrcRect(texture_coords.GetRightTop(), strict_texture_coords)}, - {destination_rect.GetLeftBottom(), - ClampToSrcRect(texture_coords.GetLeftBottom(), strict_texture_coords)}, - {destination_rect.GetRightBottom(), - ClampToSrcRect(texture_coords.GetRightBottom(), - strict_texture_coords)}, - }); - } else { - auto destination_rect = - capture.AddRect("Destination rect", destination_rect_); - vertex_builder.AddVertices({ - {destination_rect.GetLeftTop(), texture_coords.GetLeftTop()}, - {destination_rect.GetRightTop(), texture_coords.GetRightTop()}, - {destination_rect.GetLeftBottom(), texture_coords.GetLeftBottom()}, - {destination_rect.GetRightBottom(), texture_coords.GetRightBottom()}, - }); - } + auto destination_rect = + capture.AddRect("Destination rect", destination_rect_); + vertex_builder.AddVertices({ + {destination_rect.GetLeftTop(), texture_coords.GetLeftTop()}, + {destination_rect.GetRightTop(), texture_coords.GetRightTop()}, + {destination_rect.GetLeftBottom(), texture_coords.GetLeftBottom()}, + {destination_rect.GetRightBottom(), texture_coords.GetRightBottom()}, + }); auto& host_buffer = renderer.GetTransientsBuffer(); @@ -186,16 +159,21 @@ bool TextureContents::Render(const ContentContext& renderer, } pipeline_options.primitive_type = PrimitiveType::kTriangleStrip; + std::shared_ptr> pipeline; #ifdef IMPELLER_ENABLE_OPENGLES if (is_external_texture) { - pass.SetPipeline( - renderer.GetTiledTextureExternalPipeline(pipeline_options)); - } else { - pass.SetPipeline(renderer.GetTexturePipeline(pipeline_options)); + pipeline = renderer.GetTiledTextureExternalPipeline(pipeline_options); } -#else - pass.SetPipeline(renderer.GetTexturePipeline(pipeline_options)); -#endif // // IMPELLER_ENABLE_OPENGLES +#endif // IMPELLER_ENABLE_OPENGLES + + if (!pipeline) { + if (strict_source_rect_enabled_) { + pipeline = renderer.GetTextureStrictSrcPipeline(pipeline_options); + } else { + pipeline = renderer.GetTexturePipeline(pipeline_options); + } + } + pass.SetPipeline(pipeline); pass.SetVertexBuffer(vertex_builder.CreateVertexBuffer(host_buffer)); VS::BindFrameInfo(pass, host_buffer.EmplaceUniform(frame_info)); @@ -220,6 +198,21 @@ bool TextureContents::Render(const ContentContext& renderer, pass, texture_, renderer.GetContext()->GetSamplerLibrary()->GetSampler( sampler_descriptor)); + } else if (strict_source_rect_enabled_) { + // For a strict source rect, shrink the texture coordinate range by half a + // texel to ensure that linear filtering does not sample anything outside + // the source rect bounds. + auto strict_texture_coords = + Rect::MakeSize(texture_->GetSize()).Project(source_rect.Expand(-0.5)); + + FSStrict::FragInfo frag_info; + frag_info.source_rect = Vector4(strict_texture_coords.GetLTRB()); + frag_info.alpha = capture.AddScalar("Alpha", GetOpacity()); + FSStrict::BindFragInfo(pass, host_buffer.EmplaceUniform((frag_info))); + FSStrict::BindTextureSampler( + pass, texture_, + renderer.GetContext()->GetSamplerLibrary()->GetSampler( + sampler_descriptor_)); } else { FS::FragInfo frag_info; frag_info.alpha = capture.AddScalar("Alpha", GetOpacity()); diff --git a/impeller/entity/shaders/texture_fill_strict_src.frag b/impeller/entity/shaders/texture_fill_strict_src.frag new file mode 100644 index 0000000000000..15a2f3a4b3a89 --- /dev/null +++ b/impeller/entity/shaders/texture_fill_strict_src.frag @@ -0,0 +1,30 @@ +// 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; + +#include +#include + +uniform f16sampler2D texture_sampler; + +uniform FragInfo { + vec4 source_rect; + float alpha; +} +frag_info; + +in highp vec2 v_texture_coords; + +out f16vec4 frag_color; + +void main() { + vec2 texture_coords = vec2(clamp(v_texture_coords.x, frag_info.source_rect.x, + frag_info.source_rect.z), + clamp(v_texture_coords.y, frag_info.source_rect.y, + frag_info.source_rect.w)); + f16vec4 sampled = + texture(texture_sampler, texture_coords, kDefaultMipBiasHalf); + frag_color = sampled * float16_t(frag_info.alpha); +} From 3faa93751b452c41c412121f400c2d38c5880f0f Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Wed, 17 Apr 2024 18:09:25 -0700 Subject: [PATCH 7/9] update malioc and licenses. --- ci/licenses_golden/licenses_flutter | 2 + impeller/tools/malioc.json | 197 ++++++++++++++++++++++++++++ 2 files changed, 199 insertions(+) diff --git a/ci/licenses_golden/licenses_flutter b/ci/licenses_golden/licenses_flutter index da676625aeb30..f764062c73eef 100644 --- a/ci/licenses_golden/licenses_flutter +++ b/ci/licenses_golden/licenses_flutter @@ -40064,6 +40064,7 @@ ORIGIN: ../../../flutter/impeller/entity/shaders/solid_fill.frag + ../../../flut ORIGIN: ../../../flutter/impeller/entity/shaders/solid_fill.vert + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/texture_fill.frag + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/texture_fill.vert + ../../../flutter/LICENSE +ORIGIN: ../../../flutter/impeller/entity/shaders/texture_fill_strict_src.frag + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/tiled_texture_fill.frag + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/tiled_texture_fill_external.frag + ../../../flutter/LICENSE ORIGIN: ../../../flutter/impeller/entity/shaders/vertices.frag + ../../../flutter/LICENSE @@ -42940,6 +42941,7 @@ FILE: ../../../flutter/impeller/entity/shaders/solid_fill.frag FILE: ../../../flutter/impeller/entity/shaders/solid_fill.vert FILE: ../../../flutter/impeller/entity/shaders/texture_fill.frag FILE: ../../../flutter/impeller/entity/shaders/texture_fill.vert +FILE: ../../../flutter/impeller/entity/shaders/texture_fill_strict_src.frag FILE: ../../../flutter/impeller/entity/shaders/tiled_texture_fill.frag FILE: ../../../flutter/impeller/entity/shaders/tiled_texture_fill_external.frag FILE: ../../../flutter/impeller/entity/shaders/vertices.frag diff --git a/impeller/tools/malioc.json b/impeller/tools/malioc.json index b7542bf00a4f0..ba0c042a83c94 100644 --- a/impeller/tools/malioc.json +++ b/impeller/tools/malioc.json @@ -5586,6 +5586,130 @@ } } }, + "flutter/impeller/entity/gles/texture_fill_strict_src.frag.gles": { + "Mali-G78": { + "core": "Mali-G78", + "filename": "flutter/impeller/entity/gles/texture_fill_strict_src.frag.gles", + "has_side_effects": false, + "has_uniform_computation": false, + "modifies_coverage": false, + "reads_color_buffer": false, + "type": "Fragment", + "uses_late_zs_test": false, + "uses_late_zs_update": false, + "variants": { + "Main": { + "fp16_arithmetic": 33, + "has_stack_spilling": false, + "performance": { + "longest_path_bound_pipelines": [ + "varying", + "texture" + ], + "longest_path_cycles": [ + 0.109375, + 0.03125, + 0.109375, + 0.0, + 0.0, + 0.25, + 0.25 + ], + "pipelines": [ + "arith_total", + "arith_fma", + "arith_cvt", + "arith_sfu", + "load_store", + "varying", + "texture" + ], + "shortest_path_bound_pipelines": [ + "varying", + "texture" + ], + "shortest_path_cycles": [ + 0.078125, + 0.03125, + 0.078125, + 0.0, + 0.0, + 0.25, + 0.25 + ], + "total_bound_pipelines": [ + "varying", + "texture" + ], + "total_cycles": [ + 0.109375, + 0.03125, + 0.109375, + 0.0, + 0.0, + 0.25, + 0.25 + ] + }, + "stack_spill_bytes": 0, + "thread_occupancy": 100, + "uniform_registers_used": 6, + "work_registers_used": 19 + } + } + }, + "Mali-T880": { + "core": "Mali-T880", + "filename": "flutter/impeller/entity/gles/texture_fill_strict_src.frag.gles", + "has_uniform_computation": false, + "type": "Fragment", + "variants": { + "Main": { + "has_stack_spilling": false, + "performance": { + "longest_path_bound_pipelines": [ + "arithmetic", + "load_store", + "texture" + ], + "longest_path_cycles": [ + 1.0, + 1.0, + 1.0 + ], + "pipelines": [ + "arithmetic", + "load_store", + "texture" + ], + "shortest_path_bound_pipelines": [ + "arithmetic", + "load_store", + "texture" + ], + "shortest_path_cycles": [ + 1.0, + 1.0, + 1.0 + ], + "total_bound_pipelines": [ + "arithmetic", + "load_store", + "texture" + ], + "total_cycles": [ + 1.0, + 1.0, + 1.0 + ] + }, + "thread_occupancy": 100, + "uniform_registers_used": 1, + "work_registers_used": 2 + } + } + } + }, "flutter/impeller/entity/gles/tiled_texture_fill.frag.gles": { "Mali-G78": { "core": "Mali-G78", @@ -8454,6 +8578,79 @@ } } }, + "flutter/impeller/entity/texture_fill_strict_src.frag.vkspv": { + "Mali-G78": { + "core": "Mali-G78", + "filename": "flutter/impeller/entity/texture_fill_strict_src.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": 33, + "has_stack_spilling": false, + "performance": { + "longest_path_bound_pipelines": [ + "varying", + "texture" + ], + "longest_path_cycles": [ + 0.078125, + 0.03125, + 0.078125, + 0.0, + 0.0, + 0.25, + 0.25 + ], + "pipelines": [ + "arith_total", + "arith_fma", + "arith_cvt", + "arith_sfu", + "load_store", + "varying", + "texture" + ], + "shortest_path_bound_pipelines": [ + "varying", + "texture" + ], + "shortest_path_cycles": [ + 0.078125, + 0.03125, + 0.078125, + 0.0, + 0.0, + 0.25, + 0.25 + ], + "total_bound_pipelines": [ + "varying", + "texture" + ], + "total_cycles": [ + 0.078125, + 0.03125, + 0.078125, + 0.0, + 0.0, + 0.25, + 0.25 + ] + }, + "stack_spill_bytes": 0, + "thread_occupancy": 100, + "uniform_registers_used": 8, + "work_registers_used": 5 + } + } + } + }, "flutter/impeller/entity/tiled_texture_fill.frag.vkspv": { "Mali-G78": { "core": "Mali-G78", From 45a1195cce98a0d415d6b4d301fa3c4a74a51db8 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Fri, 19 Apr 2024 11:25:50 -0700 Subject: [PATCH 8/9] Update texture_fill_strict_src.frag --- impeller/entity/shaders/texture_fill_strict_src.frag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impeller/entity/shaders/texture_fill_strict_src.frag b/impeller/entity/shaders/texture_fill_strict_src.frag index 86fc018e6a8c6..0165250b8a968 100644 --- a/impeller/entity/shaders/texture_fill_strict_src.frag +++ b/impeller/entity/shaders/texture_fill_strict_src.frag @@ -25,6 +25,6 @@ void main() { clamp(v_texture_coords.y, frag_info.source_rect.y, frag_info.source_rect.w)); f16vec4 sampled = - texture(texture_sampler, texture_coords, float16_t(kDefaultMipBiasHalf)); + texture(texture_sampler, texture_coords, float16_t(kDefaultMipBias)); frag_color = sampled * float16_t(frag_info.alpha); } From 75a2be23aa2cf0f9d304e372a903419c10758bbc Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Fri, 19 Apr 2024 11:39:26 -0700 Subject: [PATCH 9/9] Update texture_fill.frag --- impeller/entity/shaders/texture_fill.frag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impeller/entity/shaders/texture_fill.frag b/impeller/entity/shaders/texture_fill.frag index 9450b15c5e5e1..bd9dbd30c374e 100644 --- a/impeller/entity/shaders/texture_fill.frag +++ b/impeller/entity/shaders/texture_fill.frag @@ -20,6 +20,6 @@ out f16vec4 frag_color; void main() { f16vec4 sampled = - texture(texture_sampler, v_texture_coords, float16_t(kDefaultMipBiasHalf)); + texture(texture_sampler, v_texture_coords, float16_t(kDefaultMipBias)); frag_color = sampled * float16_t(frag_info.alpha); }