From 378b29335122533b0ed4825191d4a09a719b5bbd Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Wed, 19 Jul 2023 16:58:01 -0700 Subject: [PATCH 1/6] [Impeller] try removing uniform computation from some shaders. --- impeller/compiler/shader_lib/impeller/types.glsl | 6 ++++++ impeller/entity/contents/atlas_contents.cc | 5 +---- impeller/entity/contents/clip_contents.cc | 12 ++---------- impeller/entity/contents/solid_color_contents.cc | 6 +----- impeller/entity/contents/text_contents.cc | 5 +---- impeller/entity/contents/texture_contents.cc | 5 +---- impeller/entity/contents/tiled_texture_contents.cc | 7 +------ impeller/entity/contents/vertices_contents.cc | 5 +---- impeller/entity/shaders/glyph_atlas.frag | 9 +++------ impeller/entity/shaders/glyph_atlas.vert | 5 +++++ impeller/entity/shaders/glyph_atlas_color.frag | 9 +++------ impeller/entity/shaders/solid_fill.frag | 7 ++----- impeller/entity/shaders/solid_fill.vert | 4 ++++ impeller/entity/shaders/texture_fill.frag | 9 +++------ impeller/entity/shaders/texture_fill.vert | 4 ++++ impeller/entity/shaders/tiled_texture_fill.frag | 5 +++-- 16 files changed, 41 insertions(+), 62 deletions(-) diff --git a/impeller/compiler/shader_lib/impeller/types.glsl b/impeller/compiler/shader_lib/impeller/types.glsl index ad1a0e86cf93f..4d0f304c217fb 100644 --- a/impeller/compiler/shader_lib/impeller/types.glsl +++ b/impeller/compiler/shader_lib/impeller/types.glsl @@ -9,6 +9,12 @@ #extension GL_AMD_gpu_shader_half_float_fetch : enable #extension GL_EXT_shader_explicit_arithmetic_types_float16 : enable +#ifdef IMPELLER_TARGET_OPENGLES +#define IMPELLER_FLAT +#else +#define IMPELLER_FLAT flat +#endif + #ifndef IMPELLER_TARGET_METAL_IOS precision mediump sampler2D; diff --git a/impeller/entity/contents/atlas_contents.cc b/impeller/entity/contents/atlas_contents.cc index b88fee0c20561..bfdfd16aa127a 100644 --- a/impeller/entity/contents/atlas_contents.cc +++ b/impeller/entity/contents/atlas_contents.cc @@ -338,16 +338,13 @@ bool AtlasTextureContents::Render(const ContentContext& renderer, frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * entity.GetTransformation(); frame_info.texture_sampler_y_coord_scale = texture->GetYCoordScale(); - - FS::FragInfo frag_info; - frag_info.alpha = alpha_; + frame_info.alpha = alpha_; auto options = OptionsFromPassAndEntity(pass, entity); cmd.pipeline = renderer.GetTexturePipeline(options); cmd.stencil_reference = entity.GetStencilDepth(); cmd.BindVertices(vertex_builder.CreateVertexBuffer(host_buffer)); VS::BindFrameInfo(cmd, host_buffer.EmplaceUniform(frame_info)); - FS::BindFragInfo(cmd, host_buffer.EmplaceUniform(frag_info)); FS::BindTextureSampler(cmd, texture, renderer.GetContext()->GetSamplerLibrary()->GetSampler( parent_.GetSamplerDescriptor())); diff --git a/impeller/entity/contents/clip_contents.cc b/impeller/entity/contents/clip_contents.cc index f7663312a9dac..65b05e869247e 100644 --- a/impeller/entity/contents/clip_contents.cc +++ b/impeller/entity/contents/clip_contents.cc @@ -80,16 +80,13 @@ bool ClipContents::Render(const ContentContext& renderer, const Entity& entity, RenderPass& pass) const { using VS = ClipPipeline::VertexShader; - using FS = ClipPipeline::FragmentShader; VS::FrameInfo info; Command cmd; - FS::FragInfo frag_info; // The color really doesn't matter. - frag_info.color = Color::SkyBlue(); - FS::BindFragInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frag_info)); + info.color = Color::SkyBlue(); auto options = OptionsFromPassAndEntity(pass, entity); cmd.stencil_reference = entity.GetStencilDepth(); @@ -182,7 +179,6 @@ bool ClipRestoreContents::Render(const ContentContext& renderer, const Entity& entity, RenderPass& pass) const { using VS = ClipPipeline::VertexShader; - using FS = ClipPipeline::FragmentShader; Command cmd; cmd.label = "Restore Clip"; @@ -208,13 +204,9 @@ bool ClipRestoreContents::Render(const ContentContext& renderer, VS::FrameInfo info; info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()); + info.color = Color::SkyBlue(); VS::BindFrameInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(info)); - FS::FragInfo frag_info; - // The color really doesn't matter. - frag_info.color = Color::SkyBlue(); - FS::BindFragInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frag_info)); - pass.AddCommand(std::move(cmd)); return true; } diff --git a/impeller/entity/contents/solid_color_contents.cc b/impeller/entity/contents/solid_color_contents.cc index 02ecbf67365ad..8a2ceadacfa25 100644 --- a/impeller/entity/contents/solid_color_contents.cc +++ b/impeller/entity/contents/solid_color_contents.cc @@ -54,7 +54,6 @@ bool SolidColorContents::Render(const ContentContext& renderer, const Entity& entity, RenderPass& pass) const { using VS = SolidFillPipeline::VertexShader; - using FS = SolidFillPipeline::FragmentShader; Command cmd; cmd.label = "Solid Fill"; @@ -75,12 +74,9 @@ bool SolidColorContents::Render(const ContentContext& renderer, VS::FrameInfo frame_info; frame_info.mvp = geometry_result.transform; + frame_info.color = GetColor().Premultiply(); VS::BindFrameInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frame_info)); - FS::FragInfo frag_info; - frag_info.color = GetColor().Premultiply(); - FS::BindFragInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frag_info)); - if (!pass.AddCommand(std::move(cmd))) { return false; } diff --git a/impeller/entity/contents/text_contents.cc b/impeller/entity/contents/text_contents.cc index 339bb27549166..bbb2524abb52d 100644 --- a/impeller/entity/contents/text_contents.cc +++ b/impeller/entity/contents/text_contents.cc @@ -125,6 +125,7 @@ bool TextContents::Render(const ContentContext& renderer, frame_info.is_translation_scale = entity.GetTransformation().IsTranslationScaleOnly(); frame_info.entity_transform = entity.GetTransformation(); + frame_info.text_color = ToVector(color.Premultiply()); VS::BindFrameInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frame_info)); @@ -143,10 +144,6 @@ bool TextContents::Render(const ContentContext& renderer, } sampler_desc.mip_filter = MipFilter::kNearest; - FS::FragInfo frag_info; - frag_info.text_color = ToVector(color.Premultiply()); - FS::BindFragInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frag_info)); - FS::BindGlyphAtlasSampler( cmd, // command atlas->GetTexture(), // texture diff --git a/impeller/entity/contents/texture_contents.cc b/impeller/entity/contents/texture_contents.cc index 553d53c0c96ff..1dbc8a5a2b50b 100644 --- a/impeller/entity/contents/texture_contents.cc +++ b/impeller/entity/contents/texture_contents.cc @@ -135,9 +135,7 @@ bool TextureContents::Render(const ContentContext& renderer, frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * entity.GetTransformation(); frame_info.texture_sampler_y_coord_scale = texture_->GetYCoordScale(); - - FS::FragInfo frag_info; - frag_info.alpha = GetOpacity(); + frame_info.alpha = GetOpacity(); Command cmd; cmd.label = "Texture Fill"; @@ -155,7 +153,6 @@ bool TextureContents::Render(const ContentContext& renderer, cmd.stencil_reference = entity.GetStencilDepth(); cmd.BindVertices(vertex_builder.CreateVertexBuffer(host_buffer)); VS::BindFrameInfo(cmd, host_buffer.EmplaceUniform(frame_info)); - FS::BindFragInfo(cmd, host_buffer.EmplaceUniform(frag_info)); FS::BindTextureSampler(cmd, texture_, renderer.GetContext()->GetSamplerLibrary()->GetSampler( sampler_descriptor_)); diff --git a/impeller/entity/contents/tiled_texture_contents.cc b/impeller/entity/contents/tiled_texture_contents.cc index c5172b71ca71b..8ef9b6d78cb99 100644 --- a/impeller/entity/contents/tiled_texture_contents.cc +++ b/impeller/entity/contents/tiled_texture_contents.cc @@ -136,6 +136,7 @@ bool TiledTextureContents::Render(const ContentContext& renderer, VS::FrameInfo frame_info; frame_info.mvp = geometry_result.transform; frame_info.texture_sampler_y_coord_scale = texture_->GetYCoordScale(); + frame_info.alpha = GetOpacityFactor(); Command cmd; cmd.label = uses_emulated_tile_mode ? "TiledTextureFill" : "TextureFill"; @@ -158,13 +159,7 @@ bool TiledTextureContents::Render(const ContentContext& renderer, 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(cmd, host_buffer.EmplaceUniform(frag_info)); - } else { - TextureFillFragmentShader::FragInfo frag_info; - frag_info.alpha = GetOpacityFactor(); - TextureFillFragmentShader::BindFragInfo( - cmd, host_buffer.EmplaceUniform(frag_info)); } if (color_filter_) { diff --git a/impeller/entity/contents/vertices_contents.cc b/impeller/entity/contents/vertices_contents.cc index 75c6b2ea3b6f1..353e28e112ee7 100644 --- a/impeller/entity/contents/vertices_contents.cc +++ b/impeller/entity/contents/vertices_contents.cc @@ -144,12 +144,9 @@ 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(cmd, host_buffer.EmplaceUniform(frame_info)); - FS::FragInfo frag_info; - frag_info.alpha = alpha_ * snapshot->opacity; - FS::BindFragInfo(cmd, host_buffer.EmplaceUniform(frag_info)); - FS::BindTextureSampler(cmd, snapshot->texture, renderer.GetContext()->GetSamplerLibrary()->GetSampler( snapshot->sampler_descriptor)); diff --git a/impeller/entity/shaders/glyph_atlas.frag b/impeller/entity/shaders/glyph_atlas.frag index fbd7d3afeb969..8436370917fc7 100644 --- a/impeller/entity/shaders/glyph_atlas.frag +++ b/impeller/entity/shaders/glyph_atlas.frag @@ -8,16 +8,13 @@ precision mediump float; uniform f16sampler2D glyph_atlas_sampler; -uniform FragInfo { - f16vec4 text_color; -} -frag_info; - in highp vec2 v_uv; +IMPELLER_FLAT in f16vec4 v_text_color; + out f16vec4 frag_color; void main() { f16vec4 value = texture(glyph_atlas_sampler, v_uv); - frag_color = value.aaaa * frag_info.text_color; + frag_color = value.aaaa * v_text_color; } diff --git a/impeller/entity/shaders/glyph_atlas.vert b/impeller/entity/shaders/glyph_atlas.vert index d21f75a10dd27..fc266a242e9d9 100644 --- a/impeller/entity/shaders/glyph_atlas.vert +++ b/impeller/entity/shaders/glyph_atlas.vert @@ -3,12 +3,14 @@ // found in the LICENSE file. #include +#include uniform FrameInfo { mat4 mvp; mat4 entity_transform; vec2 atlas_size; vec2 offset; + f16vec4 text_color; float is_translation_scale; } frame_info; @@ -23,6 +25,8 @@ in vec2 glyph_position; out vec2 v_uv; +IMPELLER_FLAT out f16vec4 v_text_color; + mat4 basis(mat4 m) { return mat4(m[0][0], m[0][1], m[0][2], 0.0, // m[1][0], m[1][1], m[1][2], 0.0, // @@ -77,4 +81,5 @@ void main() { gl_Position = frame_info.mvp * position; v_uv = uv_origin + unit_position * uv_size; + v_text_color = frame_info.text_color; } diff --git a/impeller/entity/shaders/glyph_atlas_color.frag b/impeller/entity/shaders/glyph_atlas_color.frag index e33c31f754254..061d80b8053d1 100644 --- a/impeller/entity/shaders/glyph_atlas_color.frag +++ b/impeller/entity/shaders/glyph_atlas_color.frag @@ -8,16 +8,13 @@ precision mediump float; uniform f16sampler2D glyph_atlas_sampler; -uniform FragInfo { - f16vec4 text_color; -} -frag_info; - in highp vec2 v_uv; +IMPELLER_FLAT in f16vec4 v_text_color; + out f16vec4 frag_color; void main() { f16vec4 value = texture(glyph_atlas_sampler, v_uv); - frag_color = value * frag_info.text_color.aaaa; + frag_color = value * v_text_color.aaaa; } diff --git a/impeller/entity/shaders/solid_fill.frag b/impeller/entity/shaders/solid_fill.frag index 0001edc7412f5..0c5a6594b3968 100644 --- a/impeller/entity/shaders/solid_fill.frag +++ b/impeller/entity/shaders/solid_fill.frag @@ -6,13 +6,10 @@ precision mediump float; #include -uniform FragInfo { - f16vec4 color; -} -frag_info; +IMPELLER_FLAT in f16vec4 v_color; out f16vec4 frag_color; void main() { - frag_color = frag_info.color; + frag_color = v_color; } diff --git a/impeller/entity/shaders/solid_fill.vert b/impeller/entity/shaders/solid_fill.vert index 4d8e67e74a2ef..e9b1573410215 100644 --- a/impeller/entity/shaders/solid_fill.vert +++ b/impeller/entity/shaders/solid_fill.vert @@ -6,11 +6,15 @@ uniform FrameInfo { mat4 mvp; + f16vec4 color; } frame_info; in vec2 position; +IMPELLER_FLAT out f16vec4 v_color; + void main() { + v_color = frame_info.color; gl_Position = frame_info.mvp * vec4(position, 0.0, 1.0); } diff --git a/impeller/entity/shaders/texture_fill.frag b/impeller/entity/shaders/texture_fill.frag index f61bf342a00b3..4e698002c80d3 100644 --- a/impeller/entity/shaders/texture_fill.frag +++ b/impeller/entity/shaders/texture_fill.frag @@ -9,17 +9,14 @@ precision mediump float; uniform f16sampler2D texture_sampler; -uniform FragInfo { - float16_t alpha; -} -frag_info; - in highp vec2 v_texture_coords; +IMPELLER_FLAT in float16_t v_alpha; + out f16vec4 frag_color; void main() { f16vec4 sampled = texture(texture_sampler, v_texture_coords, kDefaultMipBiasHalf); - frag_color = sampled * frag_info.alpha; + frag_color = sampled * v_alpha; } diff --git a/impeller/entity/shaders/texture_fill.vert b/impeller/entity/shaders/texture_fill.vert index 0dbc6fd4bfad4..7d339d9220f54 100644 --- a/impeller/entity/shaders/texture_fill.vert +++ b/impeller/entity/shaders/texture_fill.vert @@ -8,16 +8,20 @@ uniform FrameInfo { mat4 mvp; float texture_sampler_y_coord_scale; + float16_t alpha; } frame_info; in vec2 position; in vec2 texture_coords; +IMPELLER_FLAT out float16_t v_alpha; + out vec2 v_texture_coords; 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/tiled_texture_fill.frag b/impeller/entity/shaders/tiled_texture_fill.frag index 46d4d63183f74..fd59213f902b3 100644 --- a/impeller/entity/shaders/tiled_texture_fill.frag +++ b/impeller/entity/shaders/tiled_texture_fill.frag @@ -12,12 +12,13 @@ uniform f16sampler2D texture_sampler; uniform FragInfo { float16_t x_tile_mode; float16_t y_tile_mode; - float16_t alpha; } frag_info; in highp vec2 v_texture_coords; +IMPELLER_FLAT in float16_t v_alpha; + out f16vec4 frag_color; void main() { @@ -27,5 +28,5 @@ void main() { frag_info.x_tile_mode, // x tile mode frag_info.y_tile_mode // y tile mode ) * - frag_info.alpha; + v_alpha; } From bb9b41139829c7e5284f893ea08b5cb8568b1c50 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Wed, 19 Jul 2023 17:22:53 -0700 Subject: [PATCH 2/6] ++ --- impeller/entity/entity_unittests.cc | 7 +------ .../renderer/compute_subgroup_unittests.cc | 18 +++--------------- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/impeller/entity/entity_unittests.cc b/impeller/entity/entity_unittests.cc index 05818e84270f7..b8c4975c13ec2 100644 --- a/impeller/entity/entity_unittests.cc +++ b/impeller/entity/entity_unittests.cc @@ -857,7 +857,6 @@ TEST_P(EntityTest, BlendingModeOptions) { auto draw_rect = [&context, &pass, &world_matrix]( Rect rect, Color color, BlendMode blend_mode) -> bool { using VS = SolidFillPipeline::VertexShader; - using FS = SolidFillPipeline::FragmentShader; VertexBufferBuilder vtx_builder; { @@ -884,14 +883,10 @@ TEST_P(EntityTest, BlendingModeOptions) { VS::FrameInfo frame_info; frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * world_matrix; + frame_info.color = color.Premultiply(); VS::BindFrameInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frame_info)); - FS::FragInfo frag_info; - frag_info.color = color.Premultiply(); - FS::BindFragInfo(cmd, - pass.GetTransientsBuffer().EmplaceUniform(frag_info)); - return pass.AddCommand(std::move(cmd)); }; diff --git a/impeller/renderer/compute_subgroup_unittests.cc b/impeller/renderer/compute_subgroup_unittests.cc index 39e5fac2587a2..84bc953ddc3e1 100644 --- a/impeller/renderer/compute_subgroup_unittests.cc +++ b/impeller/renderer/compute_subgroup_unittests.cc @@ -131,7 +131,6 @@ TEST_P(ComputeSubgroupTest, PathPlayground) { } using VS = SolidFillPipeline::VertexShader; - using FS = SolidFillPipeline::FragmentShader; Command cmd; cmd.label = "Draw Stroke"; @@ -164,13 +163,10 @@ TEST_P(ComputeSubgroupTest, PathPlayground) { auto world_matrix = Matrix::MakeScale(GetContentScale()); frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * world_matrix; + frame_info.color = Color::Red().Premultiply(); VS::BindFrameInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frame_info)); - FS::FragInfo frag_info; - frag_info.color = Color::Red().Premultiply(); - FS::BindFragInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frag_info)); - if (!pass.AddCommand(std::move(cmd))) { return false; } @@ -339,7 +335,6 @@ TEST_P(ComputeSubgroupTest, LargePath) { } using VS = SolidFillPipeline::VertexShader; - using FS = SolidFillPipeline::FragmentShader; Command cmd; cmd.label = "Draw Stroke"; @@ -372,13 +367,10 @@ TEST_P(ComputeSubgroupTest, LargePath) { auto world_matrix = Matrix::MakeScale(GetContentScale()); frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * world_matrix; + frame_info.color = Color::Red().Premultiply(); VS::BindFrameInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frame_info)); - FS::FragInfo frag_info; - frag_info.color = Color::Red().Premultiply(); - FS::BindFragInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frag_info)); - if (!pass.AddCommand(std::move(cmd))) { return false; } @@ -427,7 +419,6 @@ TEST_P(ComputeSubgroupTest, QuadAndCubicInOnePath) { } using VS = SolidFillPipeline::VertexShader; - using FS = SolidFillPipeline::FragmentShader; Command cmd; cmd.label = "Draw Stroke"; @@ -460,13 +451,10 @@ TEST_P(ComputeSubgroupTest, QuadAndCubicInOnePath) { auto world_matrix = Matrix::MakeScale(GetContentScale()); frame_info.mvp = Matrix::MakeOrthographic(pass.GetRenderTargetSize()) * world_matrix; + frame_info.color = Color::Red().Premultiply(); VS::BindFrameInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frame_info)); - FS::FragInfo frag_info; - frag_info.color = Color::Red().Premultiply(); - FS::BindFragInfo(cmd, pass.GetTransientsBuffer().EmplaceUniform(frag_info)); - if (!pass.AddCommand(std::move(cmd))) { return false; } From 8c5db90ae7fe0e05a15520b20b151a6a1c45da79 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Wed, 19 Jul 2023 18:18:06 -0700 Subject: [PATCH 3/6] ++ --- impeller/entity/shaders/texture_fill.frag | 1 - impeller/entity/shaders/texture_fill.vert | 3 +-- impeller/entity/shaders/tiled_texture_fill.frag | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/impeller/entity/shaders/texture_fill.frag b/impeller/entity/shaders/texture_fill.frag index 4e698002c80d3..8aea7e3742983 100644 --- a/impeller/entity/shaders/texture_fill.frag +++ b/impeller/entity/shaders/texture_fill.frag @@ -10,7 +10,6 @@ precision mediump float; uniform f16sampler2D texture_sampler; in highp vec2 v_texture_coords; - IMPELLER_FLAT in float16_t v_alpha; out f16vec4 frag_color; diff --git a/impeller/entity/shaders/texture_fill.vert b/impeller/entity/shaders/texture_fill.vert index 7d339d9220f54..9d5e0e89c3b7f 100644 --- a/impeller/entity/shaders/texture_fill.vert +++ b/impeller/entity/shaders/texture_fill.vert @@ -15,9 +15,8 @@ frame_info; in vec2 position; in vec2 texture_coords; -IMPELLER_FLAT out float16_t v_alpha; - out vec2 v_texture_coords; +IMPELLER_FLAT out float16_t v_alpha; void main() { gl_Position = frame_info.mvp * vec4(position, 0.0, 1.0); diff --git a/impeller/entity/shaders/tiled_texture_fill.frag b/impeller/entity/shaders/tiled_texture_fill.frag index fd59213f902b3..966c627a42038 100644 --- a/impeller/entity/shaders/tiled_texture_fill.frag +++ b/impeller/entity/shaders/tiled_texture_fill.frag @@ -16,7 +16,6 @@ uniform FragInfo { frag_info; in highp vec2 v_texture_coords; - IMPELLER_FLAT in float16_t v_alpha; out f16vec4 frag_color; From ea2e4a8d67833c71f31e8c74a99f302536ac9e9a Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Wed, 19 Jul 2023 19:06:21 -0700 Subject: [PATCH 4/6] malioc --- impeller/tools/malioc.json | 435 +++++++++++++++++++++---------------- 1 file changed, 253 insertions(+), 182 deletions(-) diff --git a/impeller/tools/malioc.json b/impeller/tools/malioc.json index edbfb7f89f619..cb9684572c2a3 100644 --- a/impeller/tools/malioc.json +++ b/impeller/tools/malioc.json @@ -7394,8 +7394,7 @@ "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ - "varying", - "texture" + "varying" ], "longest_path_cycles": [ 0.03125, @@ -7403,7 +7402,7 @@ 0.03125, 0.0, 0.0, - 0.25, + 0.5, 0.25 ], "pipelines": [ @@ -7416,8 +7415,7 @@ "texture" ], "shortest_path_bound_pipelines": [ - "varying", - "texture" + "varying" ], "shortest_path_cycles": [ 0.03125, @@ -7425,12 +7423,11 @@ 0.0, 0.0, 0.0, - 0.25, + 0.5, 0.25 ], "total_bound_pipelines": [ - "varying", - "texture" + "varying" ], "total_cycles": [ 0.03125, @@ -7438,13 +7435,13 @@ 0.03125, 0.0, 0.0, - 0.25, + 0.5, 0.25 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 6, + "uniform_registers_used": 4, "work_registers_used": 19 } } @@ -7494,7 +7491,7 @@ ] }, "thread_occupancy": 100, - "uniform_registers_used": 1, + "uniform_registers_used": 0, "work_registers_used": 2 } } @@ -7555,7 +7552,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 44, + "uniform_registers_used": 48, "work_registers_used": 32 }, "Varying": { @@ -7568,9 +7565,9 @@ "longest_path_cycles": [ 0.15625, 0.15625, + 0.0625, 0.0, - 0.0, - 4.0, + 5.0, 0.0 ], "pipelines": [ @@ -7587,9 +7584,9 @@ "shortest_path_cycles": [ 0.15625, 0.15625, + 0.0625, 0.0, - 0.0, - 4.0, + 5.0, 0.0 ], "total_bound_pipelines": [ @@ -7598,16 +7595,16 @@ "total_cycles": [ 0.15625, 0.15625, + 0.0625, 0.0, - 0.0, - 4.0, + 5.0, 0.0 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 14, - "work_registers_used": 11 + "uniform_registers_used": 18, + "work_registers_used": 16 } } }, @@ -7624,8 +7621,8 @@ "load_store" ], "longest_path_cycles": [ - 6.929999828338623, - 7.0, + 7.260000228881836, + 8.0, 0.0 ], "pipelines": [ @@ -7637,21 +7634,21 @@ "load_store" ], "shortest_path_cycles": [ - 5.940000057220459, - 7.0, + 6.269999980926514, + 8.0, 0.0 ], "total_bound_pipelines": [ "arithmetic" ], "total_cycles": [ - 9.0, - 7.0, + 9.333333015441895, + 8.0, 0.0 ] }, "thread_occupancy": 100, - "uniform_registers_used": 11, + "uniform_registers_used": 13, "work_registers_used": 3 } } @@ -7674,8 +7671,7 @@ "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ - "varying", - "texture" + "varying" ], "longest_path_cycles": [ 0.03125, @@ -7683,7 +7679,7 @@ 0.03125, 0.0, 0.0, - 0.25, + 0.5, 0.25 ], "pipelines": [ @@ -7696,8 +7692,7 @@ "texture" ], "shortest_path_bound_pipelines": [ - "varying", - "texture" + "varying" ], "shortest_path_cycles": [ 0.03125, @@ -7705,12 +7700,11 @@ 0.0, 0.0, 0.0, - 0.25, + 0.5, 0.25 ], "total_bound_pipelines": [ - "varying", - "texture" + "varying" ], "total_cycles": [ 0.03125, @@ -7718,7 +7712,7 @@ 0.03125, 0.0, 0.0, - 0.25, + 0.5, 0.25 ] }, @@ -7774,7 +7768,7 @@ ] }, "thread_occupancy": 100, - "uniform_registers_used": 1, + "uniform_registers_used": 0, "work_registers_used": 2 } } @@ -9446,16 +9440,15 @@ "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ - "arith_total", - "arith_cvt" + "varying" ], "longest_path_cycles": [ - 0.0625, - 0.0, - 0.0625, + 0.03125, 0.0, + 0.03125, 0.0, 0.0, + 0.25, 0.0 ], "pipelines": [ @@ -9468,36 +9461,34 @@ "texture" ], "shortest_path_bound_pipelines": [ - "arith_total", - "arith_cvt" + "varying" ], "shortest_path_cycles": [ - 0.03125, 0.0, - 0.03125, 0.0, 0.0, 0.0, + 0.0, + 0.25, 0.0 ], "total_bound_pipelines": [ - "arith_total", - "arith_cvt" + "varying" ], "total_cycles": [ - 0.0625, - 0.0, - 0.0625, + 0.03125, 0.0, + 0.03125, 0.0, 0.0, + 0.25, 0.0 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 2, - "work_registers_used": 18 + "uniform_registers_used": 0, + "work_registers_used": 19 } } }, @@ -9511,11 +9502,12 @@ "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ - "arithmetic" + "arithmetic", + "load_store" ], "longest_path_cycles": [ 1.0, - 0.0, + 1.0, 0.0 ], "pipelines": [ @@ -9524,24 +9516,25 @@ "texture" ], "shortest_path_bound_pipelines": [ - "arithmetic" + "arithmetic", + "load_store" ], "shortest_path_cycles": [ 1.0, - 0.0, + 1.0, 0.0 ], "total_bound_pipelines": [ - "arithmetic" + "load_store" ], "total_cycles": [ 0.6666666865348816, - 0.0, + 1.0, 0.0 ] }, "thread_occupancy": 100, - "uniform_registers_used": 1, + "uniform_registers_used": 0, "work_registers_used": 2 } } @@ -9602,8 +9595,59 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 20, + "uniform_registers_used": 24, "work_registers_used": 32 + }, + "Varying": { + "fp16_arithmetic": null, + "has_stack_spilling": false, + "performance": { + "longest_path_bound_pipelines": [ + "load_store" + ], + "longest_path_cycles": [ + 0.0625, + 0.0, + 0.0625, + 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.0625, + 0.0, + 0.0625, + 0.0, + 2.0, + 0.0 + ], + "total_bound_pipelines": [ + "load_store" + ], + "total_cycles": [ + 0.0625, + 0.0, + 0.0625, + 0.0, + 2.0, + 0.0 + ] + }, + "stack_spill_bytes": 0, + "thread_occupancy": 100, + "uniform_registers_used": 12, + "work_registers_used": 7 } } }, @@ -9621,7 +9665,7 @@ ], "longest_path_cycles": [ 2.640000104904175, - 3.0, + 4.0, 0.0 ], "pipelines": [ @@ -9634,7 +9678,7 @@ ], "shortest_path_cycles": [ 2.640000104904175, - 3.0, + 4.0, 0.0 ], "total_bound_pipelines": [ @@ -9642,12 +9686,12 @@ ], "total_cycles": [ 2.6666667461395264, - 3.0, + 4.0, 0.0 ] }, "thread_occupancy": 100, - "uniform_registers_used": 5, + "uniform_registers_used": 6, "work_registers_used": 2 } } @@ -10064,8 +10108,7 @@ "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ - "varying", - "texture" + "varying" ], "longest_path_cycles": [ 0.046875, @@ -10073,7 +10116,7 @@ 0.046875, 0.0, 0.0, - 0.25, + 0.375, 0.25 ], "pipelines": [ @@ -10086,8 +10129,7 @@ "texture" ], "shortest_path_bound_pipelines": [ - "varying", - "texture" + "varying" ], "shortest_path_cycles": [ 0.03125, @@ -10095,12 +10137,11 @@ 0.015625, 0.0, 0.0, - 0.25, + 0.375, 0.25 ], "total_bound_pipelines": [ - "varying", - "texture" + "varying" ], "total_cycles": [ 0.046875, @@ -10108,13 +10149,13 @@ 0.046875, 0.0, 0.0, - 0.25, + 0.375, 0.25 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 4, + "uniform_registers_used": 2, "work_registers_used": 19 } } @@ -10164,7 +10205,7 @@ ] }, "thread_occupancy": 100, - "uniform_registers_used": 1, + "uniform_registers_used": 0, "work_registers_used": 2 } } @@ -10236,9 +10277,9 @@ "load_store" ], "longest_path_cycles": [ + 0.03125, 0.015625, - 0.015625, - 0.015625, + 0.03125, 0.0, 3.0, 0.0 @@ -10255,9 +10296,9 @@ "load_store" ], "shortest_path_cycles": [ + 0.03125, 0.015625, - 0.015625, - 0.015625, + 0.03125, 0.0, 3.0, 0.0 @@ -10266,9 +10307,9 @@ "load_store" ], "total_cycles": [ + 0.03125, 0.015625, - 0.015625, - 0.015625, + 0.03125, 0.0, 3.0, 0.0 @@ -10295,7 +10336,7 @@ ], "longest_path_cycles": [ 2.9700000286102295, - 5.0, + 6.0, 0.0 ], "pipelines": [ @@ -10308,7 +10349,7 @@ ], "shortest_path_cycles": [ 2.9700000286102295, - 5.0, + 6.0, 0.0 ], "total_bound_pipelines": [ @@ -10316,7 +10357,7 @@ ], "total_cycles": [ 3.0, - 5.0, + 6.0, 0.0 ] }, @@ -10344,16 +10385,15 @@ "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ - "arith_total", - "arith_cvt" + "varying" ], "longest_path_cycles": [ - 0.265625, + 0.25, 0.03125, - 0.265625, + 0.25, 0.0, 0.0, - 0.25, + 0.375, 0.25 ], "pipelines": [ @@ -10366,29 +10406,27 @@ "texture" ], "shortest_path_bound_pipelines": [ - "varying", - "texture" + "varying" ], "shortest_path_cycles": [ - 0.0625, + 0.046875, 0.03125, - 0.0625, + 0.046875, 0.0, 0.0, - 0.25, + 0.375, 0.25 ], "total_bound_pipelines": [ - "arith_total", - "arith_cvt" + "varying" ], "total_cycles": [ - 0.265625, + 0.25, 0.03125, - 0.265625, + 0.25, 0.0, 0.0, - 0.25, + 0.375, 0.25 ] }, @@ -10413,7 +10451,7 @@ ], "longest_path_cycles": [ 3.299999952316284, - 1.0, + 2.0, 1.0 ], "pipelines": [ @@ -10422,11 +10460,11 @@ "texture" ], "shortest_path_bound_pipelines": [ - "arithmetic" + "load_store" ], "shortest_path_cycles": [ 1.3200000524520874, - 1.0, + 2.0, 0.0 ], "total_bound_pipelines": [ @@ -10434,7 +10472,7 @@ ], "total_cycles": [ 3.6666667461395264, - 1.0, + 2.0, 1.0 ] }, @@ -10839,7 +10877,7 @@ "core": "Mali-G78", "filename": "flutter/impeller/entity/glyph_atlas.frag.vkspv", "has_side_effects": false, - "has_uniform_computation": true, + "has_uniform_computation": false, "modifies_coverage": false, "reads_color_buffer": false, "type": "Fragment", @@ -10851,8 +10889,7 @@ "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ - "varying", - "texture" + "varying" ], "longest_path_cycles": [ 0.03125, @@ -10860,7 +10897,7 @@ 0.0, 0.0, 0.0, - 0.25, + 0.5, 0.25 ], "pipelines": [ @@ -10873,8 +10910,7 @@ "texture" ], "shortest_path_bound_pipelines": [ - "varying", - "texture" + "varying" ], "shortest_path_cycles": [ 0.03125, @@ -10882,12 +10918,11 @@ 0.0, 0.0, 0.0, - 0.25, + 0.5, 0.25 ], "total_bound_pipelines": [ - "varying", - "texture" + "varying" ], "total_cycles": [ 0.03125, @@ -10895,13 +10930,13 @@ 0.0, 0.0, 0.0, - 0.25, + 0.5, 0.25 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 6, + "uniform_registers_used": 4, "work_registers_used": 6 } } @@ -10962,7 +10997,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 52, + "uniform_registers_used": 56, "work_registers_used": 32 }, "Varying": { @@ -10975,9 +11010,9 @@ "longest_path_cycles": [ 0.15625, 0.15625, + 0.0625, 0.0, - 0.0, - 4.0, + 5.0, 0.0 ], "pipelines": [ @@ -10994,9 +11029,9 @@ "shortest_path_cycles": [ 0.15625, 0.15625, + 0.0625, 0.0, - 0.0, - 4.0, + 5.0, 0.0 ], "total_bound_pipelines": [ @@ -11005,16 +11040,16 @@ "total_cycles": [ 0.15625, 0.15625, + 0.0625, 0.0, - 0.0, - 4.0, + 5.0, 0.0 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 44, - "work_registers_used": 11 + "uniform_registers_used": 48, + "work_registers_used": 13 } } } @@ -11024,7 +11059,7 @@ "core": "Mali-G78", "filename": "flutter/impeller/entity/glyph_atlas_color.frag.vkspv", "has_side_effects": false, - "has_uniform_computation": true, + "has_uniform_computation": false, "modifies_coverage": false, "reads_color_buffer": false, "type": "Fragment", @@ -11036,8 +11071,7 @@ "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ - "varying", - "texture" + "varying" ], "longest_path_cycles": [ 0.03125, @@ -11045,7 +11079,7 @@ 0.0, 0.0, 0.0, - 0.25, + 0.5, 0.25 ], "pipelines": [ @@ -11058,8 +11092,7 @@ "texture" ], "shortest_path_bound_pipelines": [ - "varying", - "texture" + "varying" ], "shortest_path_cycles": [ 0.03125, @@ -11067,12 +11100,11 @@ 0.0, 0.0, 0.0, - 0.25, + 0.5, 0.25 ], "total_bound_pipelines": [ - "varying", - "texture" + "varying" ], "total_cycles": [ 0.03125, @@ -11080,14 +11112,14 @@ 0.0, 0.0, 0.0, - 0.25, + 0.5, 0.25 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, "uniform_registers_used": 4, - "work_registers_used": 4 + "work_registers_used": 6 } } } @@ -12408,7 +12440,7 @@ "core": "Mali-G78", "filename": "flutter/impeller/entity/solid_fill.frag.vkspv", "has_side_effects": false, - "has_uniform_computation": true, + "has_uniform_computation": false, "modifies_coverage": false, "reads_color_buffer": false, "type": "Fragment", @@ -12420,16 +12452,15 @@ "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ - "arith_total", - "arith_cvt" + "varying" ], "longest_path_cycles": [ - 0.0625, 0.0, - 0.0625, 0.0, 0.0, 0.0, + 0.0, + 0.25, 0.0 ], "pipelines": [ @@ -12442,36 +12473,34 @@ "texture" ], "shortest_path_bound_pipelines": [ - "arith_total", - "arith_cvt" + "varying" ], "shortest_path_cycles": [ - 0.0625, 0.0, - 0.0625, 0.0, 0.0, 0.0, + 0.0, + 0.25, 0.0 ], "total_bound_pipelines": [ - "arith_total", - "arith_cvt" + "varying" ], "total_cycles": [ - 0.0625, 0.0, - 0.0625, 0.0, 0.0, 0.0, + 0.0, + 0.25, 0.0 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 4, - "work_registers_used": 5 + "uniform_registers_used": 0, + "work_registers_used": 3 } } } @@ -12531,8 +12560,59 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 28, + "uniform_registers_used": 32, "work_registers_used": 32 + }, + "Varying": { + "fp16_arithmetic": null, + "has_stack_spilling": false, + "performance": { + "longest_path_bound_pipelines": [ + "load_store" + ], + "longest_path_cycles": [ + 0.0625, + 0.0, + 0.0625, + 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.0625, + 0.0, + 0.0625, + 0.0, + 2.0, + 0.0 + ], + "total_bound_pipelines": [ + "load_store" + ], + "total_cycles": [ + 0.0625, + 0.0, + 0.0625, + 0.0, + 2.0, + 0.0 + ] + }, + "stack_spill_bytes": 0, + "thread_occupancy": 100, + "uniform_registers_used": 24, + "work_registers_used": 7 } } } @@ -12871,7 +12951,7 @@ "core": "Mali-G78", "filename": "flutter/impeller/entity/texture_fill.frag.vkspv", "has_side_effects": false, - "has_uniform_computation": true, + "has_uniform_computation": false, "modifies_coverage": false, "reads_color_buffer": false, "type": "Fragment", @@ -12883,8 +12963,7 @@ "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ - "varying", - "texture" + "varying" ], "longest_path_cycles": [ 0.03125, @@ -12892,7 +12971,7 @@ 0.015625, 0.0, 0.0, - 0.25, + 0.375, 0.25 ], "pipelines": [ @@ -12905,8 +12984,7 @@ "texture" ], "shortest_path_bound_pipelines": [ - "varying", - "texture" + "varying" ], "shortest_path_cycles": [ 0.03125, @@ -12914,12 +12992,11 @@ 0.015625, 0.0, 0.0, - 0.25, + 0.375, 0.25 ], "total_bound_pipelines": [ - "varying", - "texture" + "varying" ], "total_cycles": [ 0.03125, @@ -12927,14 +13004,14 @@ 0.015625, 0.0, 0.0, - 0.25, + 0.375, 0.25 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 4, - "work_registers_used": 5 + "uniform_registers_used": 2, + "work_registers_used": 6 } } } @@ -13005,9 +13082,9 @@ "load_store" ], "longest_path_cycles": [ + 0.046875, 0.015625, - 0.015625, - 0.015625, + 0.046875, 0.0, 3.0, 0.0 @@ -13024,9 +13101,9 @@ "load_store" ], "shortest_path_cycles": [ + 0.046875, 0.015625, - 0.015625, - 0.015625, + 0.046875, 0.0, 3.0, 0.0 @@ -13035,9 +13112,9 @@ "load_store" ], "total_cycles": [ + 0.046875, 0.015625, - 0.015625, - 0.015625, + 0.046875, 0.0, 3.0, 0.0 @@ -13046,7 +13123,7 @@ "stack_spill_bytes": 0, "thread_occupancy": 100, "uniform_registers_used": 22, - "work_registers_used": 8 + "work_registers_used": 10 } } } @@ -13068,10 +13145,7 @@ "has_stack_spilling": false, "performance": { "longest_path_bound_pipelines": [ - "arith_total", - "arith_cvt", - "varying", - "texture" + "varying" ], "longest_path_cycles": [ 0.25, @@ -13079,7 +13153,7 @@ 0.25, 0.0625, 0.0, - 0.25, + 0.375, 0.25 ], "pipelines": [ @@ -13100,14 +13174,11 @@ 0.140625, 0.0625, 0.0, - 0.25, + 0.375, 0.0 ], "total_bound_pipelines": [ - "arith_total", - "arith_cvt", - "varying", - "texture" + "varying" ], "total_cycles": [ 0.25, @@ -13115,14 +13186,14 @@ 0.25, 0.0625, 0.0, - 0.25, + 0.375, 0.25 ] }, "stack_spill_bytes": 0, "thread_occupancy": 100, "uniform_registers_used": 4, - "work_registers_used": 7 + "work_registers_used": 8 } } } From 3e5e8e58bd05dfdd737e04caf44e30aee00fc8b5 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Thu, 20 Jul 2023 13:02:40 -0700 Subject: [PATCH 5/6] rename to IMPELLER_MAYBE_FLAT --- impeller/compiler/shader_lib/impeller/types.glsl | 4 ++-- impeller/entity/contents/text_contents.cc | 2 +- impeller/entity/shaders/glyph_atlas.frag | 2 +- impeller/entity/shaders/glyph_atlas.vert | 2 +- impeller/entity/shaders/glyph_atlas_color.frag | 2 +- impeller/entity/shaders/solid_fill.frag | 2 +- impeller/entity/shaders/solid_fill.vert | 2 +- impeller/entity/shaders/texture_fill.frag | 2 +- impeller/entity/shaders/texture_fill.vert | 2 +- impeller/entity/shaders/tiled_texture_fill.frag | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/impeller/compiler/shader_lib/impeller/types.glsl b/impeller/compiler/shader_lib/impeller/types.glsl index 4d0f304c217fb..b0ce4188d08ee 100644 --- a/impeller/compiler/shader_lib/impeller/types.glsl +++ b/impeller/compiler/shader_lib/impeller/types.glsl @@ -10,9 +10,9 @@ #extension GL_EXT_shader_explicit_arithmetic_types_float16 : enable #ifdef IMPELLER_TARGET_OPENGLES -#define IMPELLER_FLAT +#define IMPELLER_MAYBE_FLAT #else -#define IMPELLER_FLAT flat +#define IMPELLER_MAYBE_FLAT flat #endif #ifndef IMPELLER_TARGET_METAL_IOS diff --git a/impeller/entity/contents/text_contents.cc b/impeller/entity/contents/text_contents.cc index bbb2524abb52d..bdc02aacf8926 100644 --- a/impeller/entity/contents/text_contents.cc +++ b/impeller/entity/contents/text_contents.cc @@ -181,7 +181,7 @@ bool TextContents::Render(const ContentContext& renderer, auto maybe_atlas_glyph_bounds = atlas->FindFontGlyphBounds(font_glyph_pair); if (!maybe_atlas_glyph_bounds.has_value()) { - VALIDATION_LOG << "Could not find glyph position in the atlas."; + VALIDATION_LOG << "Could not find glyph position in the atlas with scale: " << scale_; continue; } auto atlas_glyph_bounds = maybe_atlas_glyph_bounds.value(); diff --git a/impeller/entity/shaders/glyph_atlas.frag b/impeller/entity/shaders/glyph_atlas.frag index 8436370917fc7..9a9b71780dd33 100644 --- a/impeller/entity/shaders/glyph_atlas.frag +++ b/impeller/entity/shaders/glyph_atlas.frag @@ -10,7 +10,7 @@ uniform f16sampler2D glyph_atlas_sampler; in highp vec2 v_uv; -IMPELLER_FLAT in f16vec4 v_text_color; +IMPELLER_MAYBE_FLAT in f16vec4 v_text_color; out f16vec4 frag_color; diff --git a/impeller/entity/shaders/glyph_atlas.vert b/impeller/entity/shaders/glyph_atlas.vert index fc266a242e9d9..c677997e7268e 100644 --- a/impeller/entity/shaders/glyph_atlas.vert +++ b/impeller/entity/shaders/glyph_atlas.vert @@ -25,7 +25,7 @@ in vec2 glyph_position; out vec2 v_uv; -IMPELLER_FLAT out f16vec4 v_text_color; +IMPELLER_MAYBE_FLAT out f16vec4 v_text_color; mat4 basis(mat4 m) { return mat4(m[0][0], m[0][1], m[0][2], 0.0, // diff --git a/impeller/entity/shaders/glyph_atlas_color.frag b/impeller/entity/shaders/glyph_atlas_color.frag index 061d80b8053d1..293329b764fca 100644 --- a/impeller/entity/shaders/glyph_atlas_color.frag +++ b/impeller/entity/shaders/glyph_atlas_color.frag @@ -10,7 +10,7 @@ uniform f16sampler2D glyph_atlas_sampler; in highp vec2 v_uv; -IMPELLER_FLAT in f16vec4 v_text_color; +IMPELLER_MAYBE_FLAT in f16vec4 v_text_color; out f16vec4 frag_color; diff --git a/impeller/entity/shaders/solid_fill.frag b/impeller/entity/shaders/solid_fill.frag index 0c5a6594b3968..ed376a71d85bb 100644 --- a/impeller/entity/shaders/solid_fill.frag +++ b/impeller/entity/shaders/solid_fill.frag @@ -6,7 +6,7 @@ precision mediump float; #include -IMPELLER_FLAT in f16vec4 v_color; +IMPELLER_MAYBE_FLAT in f16vec4 v_color; out f16vec4 frag_color; diff --git a/impeller/entity/shaders/solid_fill.vert b/impeller/entity/shaders/solid_fill.vert index e9b1573410215..76733804d6e45 100644 --- a/impeller/entity/shaders/solid_fill.vert +++ b/impeller/entity/shaders/solid_fill.vert @@ -12,7 +12,7 @@ frame_info; in vec2 position; -IMPELLER_FLAT out f16vec4 v_color; +IMPELLER_MAYBE_FLAT out f16vec4 v_color; void main() { v_color = frame_info.color; diff --git a/impeller/entity/shaders/texture_fill.frag b/impeller/entity/shaders/texture_fill.frag index 8aea7e3742983..c520b4701ce8d 100644 --- a/impeller/entity/shaders/texture_fill.frag +++ b/impeller/entity/shaders/texture_fill.frag @@ -10,7 +10,7 @@ precision mediump float; uniform f16sampler2D texture_sampler; in highp vec2 v_texture_coords; -IMPELLER_FLAT in float16_t v_alpha; +IMPELLER_MAYBE_FLAT in float16_t v_alpha; out f16vec4 frag_color; diff --git a/impeller/entity/shaders/texture_fill.vert b/impeller/entity/shaders/texture_fill.vert index 9d5e0e89c3b7f..26e5f73f713b5 100644 --- a/impeller/entity/shaders/texture_fill.vert +++ b/impeller/entity/shaders/texture_fill.vert @@ -16,7 +16,7 @@ in vec2 position; in vec2 texture_coords; out vec2 v_texture_coords; -IMPELLER_FLAT out float16_t v_alpha; +IMPELLER_MAYBE_FLAT out float16_t v_alpha; void main() { gl_Position = frame_info.mvp * vec4(position, 0.0, 1.0); diff --git a/impeller/entity/shaders/tiled_texture_fill.frag b/impeller/entity/shaders/tiled_texture_fill.frag index 966c627a42038..5e8413ef98f9c 100644 --- a/impeller/entity/shaders/tiled_texture_fill.frag +++ b/impeller/entity/shaders/tiled_texture_fill.frag @@ -16,7 +16,7 @@ uniform FragInfo { frag_info; in highp vec2 v_texture_coords; -IMPELLER_FLAT in float16_t v_alpha; +IMPELLER_MAYBE_FLAT in float16_t v_alpha; out f16vec4 frag_color; From 2467ac881be198ff9fb6044b44fd82b9beb2966a Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Thu, 20 Jul 2023 13:11:50 -0700 Subject: [PATCH 6/6] ++ --- impeller/entity/contents/text_contents.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impeller/entity/contents/text_contents.cc b/impeller/entity/contents/text_contents.cc index bdc02aacf8926..bbb2524abb52d 100644 --- a/impeller/entity/contents/text_contents.cc +++ b/impeller/entity/contents/text_contents.cc @@ -181,7 +181,7 @@ bool TextContents::Render(const ContentContext& renderer, auto maybe_atlas_glyph_bounds = atlas->FindFontGlyphBounds(font_glyph_pair); if (!maybe_atlas_glyph_bounds.has_value()) { - VALIDATION_LOG << "Could not find glyph position in the atlas with scale: " << scale_; + VALIDATION_LOG << "Could not find glyph position in the atlas."; continue; } auto atlas_glyph_bounds = maybe_atlas_glyph_bounds.value();