diff --git a/impeller/aiks/aiks_unittests.cc b/impeller/aiks/aiks_unittests.cc index 1f9005c665a55..9727a74e8b2d5 100644 --- a/impeller/aiks/aiks_unittests.cc +++ b/impeller/aiks/aiks_unittests.cc @@ -4040,5 +4040,32 @@ TEST_P(AiksTest, ImageColorSourceEffectTransform) { ASSERT_TRUE(OpenPlaygroundHere(canvas.EndRecordingAsPicture())); } +TEST_P(AiksTest, CorrectClipDepthAssignedToEntities) { + Canvas canvas; // Depth 1 (base pass) + canvas.DrawRRect(Rect::MakeLTRB(0, 0, 100, 100), {10, 10}, {}); // Depth 2 + canvas.ClipRRect(Rect::MakeLTRB(0, 0, 50, 50), {10, 10}, {}); // Depth 4 + canvas.SaveLayer({}); // Depth 3 + canvas.DrawRRect(Rect::MakeLTRB(0, 0, 50, 50), {10, 10}, {}); // Depth 4 + + auto picture = canvas.EndRecordingAsPicture(); + std::array expected = {2, 4, 3, 4}; + std::vector actual; + + picture.pass->IterateAllElements([&](EntityPass::Element& element) -> bool { + if (auto* subpass = std::get_if>(&element)) { + actual.push_back(subpass->get()->GetNewClipDepth()); + } + if (Entity* entity = std::get_if(&element)) { + actual.push_back(entity->GetNewClipDepth()); + } + return true; + }); + + ASSERT_EQ(actual.size(), expected.size()); + for (size_t i = 0; i < expected.size(); i++) { + EXPECT_EQ(actual[i], expected[i]) << "Index: " << i; + } +} + } // namespace testing } // namespace impeller diff --git a/impeller/aiks/canvas.cc b/impeller/aiks/canvas.cc index 6c72e097db7a1..5e62dd1ed1fd7 100644 --- a/impeller/aiks/canvas.cc +++ b/impeller/aiks/canvas.cc @@ -117,6 +117,7 @@ Canvas::~Canvas() = default; void Canvas::Initialize(std::optional cull_rect) { initial_cull_rect_ = cull_rect; base_pass_ = std::make_unique(); + base_pass_->SetNewClipDepth(++current_depth_); current_pass_ = base_pass_.get(); transform_stack_.emplace_back(CanvasStackEntry{.cull_rect = cull_rect}); FML_DCHECK(GetSaveCount() == 1u); @@ -126,6 +127,7 @@ void Canvas::Initialize(std::optional cull_rect) { void Canvas::Reset() { base_pass_ = nullptr; current_pass_ = nullptr; + current_depth_ = 0u; transform_stack_ = {}; } @@ -174,6 +176,7 @@ void Canvas::Save(bool create_subpass, if (create_subpass) { entry.rendering_mode = Entity::RenderingMode::kSubpass; auto subpass = std::make_unique(); + subpass->SetNewClipDepth(++current_depth_); subpass->SetEnableOffscreenCheckerboard( debug_options.offscreen_texture_checkerboard); if (backdrop_filter) { @@ -206,16 +209,16 @@ bool Canvas::Restore() { if (transform_stack_.size() == 1) { return false; } + size_t num_clips = transform_stack_.back().num_clips; if (transform_stack_.back().rendering_mode == Entity::RenderingMode::kSubpass) { + current_pass_->PopClips(num_clips, current_depth_); current_pass_ = GetCurrentPass().GetSuperpass(); FML_DCHECK(current_pass_); } - bool contains_clips = transform_stack_.back().contains_clips; transform_stack_.pop_back(); - - if (contains_clips) { + if (num_clips > 0) { RestoreClip(); } @@ -290,7 +293,7 @@ void Canvas::DrawPath(const Path& path, const Paint& paint) { entity.SetBlendMode(paint.blend_mode); entity.SetContents(CreatePathContentsWithFilters(paint, path)); - GetCurrentPass().AddEntity(std::move(entity)); + AddEntityToCurrentPass(std::move(entity)); } void Canvas::DrawPaint(const Paint& paint) { @@ -300,7 +303,7 @@ void Canvas::DrawPaint(const Paint& paint) { entity.SetBlendMode(paint.blend_mode); entity.SetContents(CreateCoverContentsWithFilters(paint)); - GetCurrentPass().AddEntity(std::move(entity)); + AddEntityToCurrentPass(std::move(entity)); } bool Canvas::AttemptDrawBlurredRRect(const Rect& rect, @@ -338,7 +341,7 @@ bool Canvas::AttemptDrawBlurredRRect(const Rect& rect, entity.SetBlendMode(new_paint.blend_mode); entity.SetContents(new_paint.WithFilters(std::move(contents))); - GetCurrentPass().AddEntity(std::move(entity)); + AddEntityToCurrentPass(std::move(entity)); return true; } @@ -351,7 +354,7 @@ void Canvas::DrawLine(const Point& p0, const Point& p1, const Paint& paint) { entity.SetContents(CreateContentsForGeometryWithFilters( paint, Geometry::MakeLine(p0, p1, paint.stroke_width, paint.stroke_cap))); - GetCurrentPass().AddEntity(std::move(entity)); + AddEntityToCurrentPass(std::move(entity)); } void Canvas::DrawRect(const Rect& rect, const Paint& paint) { @@ -371,7 +374,7 @@ void Canvas::DrawRect(const Rect& rect, const Paint& paint) { entity.SetContents( CreateContentsForGeometryWithFilters(paint, Geometry::MakeRect(rect))); - GetCurrentPass().AddEntity(std::move(entity)); + AddEntityToCurrentPass(std::move(entity)); } void Canvas::DrawOval(const Rect& rect, const Paint& paint) { @@ -398,7 +401,7 @@ void Canvas::DrawOval(const Rect& rect, const Paint& paint) { entity.SetContents( CreateContentsForGeometryWithFilters(paint, Geometry::MakeOval(rect))); - GetCurrentPass().AddEntity(std::move(entity)); + AddEntityToCurrentPass(std::move(entity)); } void Canvas::DrawRRect(const Rect& rect, @@ -416,7 +419,7 @@ void Canvas::DrawRRect(const Rect& rect, entity.SetContents(CreateContentsForGeometryWithFilters( paint, Geometry::MakeRoundRect(rect, corner_radii))); - GetCurrentPass().AddEntity(std::move(entity)); + AddEntityToCurrentPass(std::move(entity)); return; } @@ -449,7 +452,7 @@ void Canvas::DrawCircle(const Point& center, entity.SetContents( CreateContentsForGeometryWithFilters(paint, std::move(geometry))); - GetCurrentPass().AddEntity(std::move(entity)); + AddEntityToCurrentPass(std::move(entity)); } void Canvas::ClipPath(const Path& path, Entity::ClipOperation clip_op) { @@ -554,10 +557,10 @@ void Canvas::ClipGeometry(const std::shared_ptr& geometry, entity.SetContents(std::move(contents)); entity.SetClipDepth(GetClipDepth()); - GetCurrentPass().AddEntity(std::move(entity)); + GetCurrentPass().PushClip(std::move(entity)); ++transform_stack_.back().clip_depth; - transform_stack_.back().contains_clips = true; + ++transform_stack_.back().num_clips; } void Canvas::IntersectCulling(Rect clip_rect) { @@ -593,7 +596,8 @@ void Canvas::RestoreClip() { entity.SetContents(std::make_shared()); entity.SetClipDepth(GetClipDepth()); - GetCurrentPass().AddEntity(std::move(entity)); + // TODO(bdero): To be removed when swapping the clip strategy. + AddEntityToCurrentPass(std::move(entity)); } void Canvas::DrawPoints(std::vector points, @@ -613,7 +617,7 @@ void Canvas::DrawPoints(std::vector points, Geometry::MakePointField(std::move(points), radius, /*round=*/point_style == PointStyle::kRound))); - GetCurrentPass().AddEntity(std::move(entity)); + AddEntityToCurrentPass(std::move(entity)); } void Canvas::DrawPicture(const Picture& picture) { @@ -690,10 +694,16 @@ void Canvas::DrawImageRect(const std::shared_ptr& image, entity.SetContents(paint.WithFilters(contents)); entity.SetTransform(GetCurrentTransform()); - GetCurrentPass().AddEntity(std::move(entity)); + AddEntityToCurrentPass(std::move(entity)); } Picture Canvas::EndRecordingAsPicture() { + // Assign clip depths to any outstanding clip entities. + while (current_pass_ != nullptr) { + current_pass_->PopAllClips(current_depth_); + current_pass_ = current_pass_->GetSuperpass(); + } + Picture picture; picture.pass = std::move(base_pass_); @@ -712,6 +722,11 @@ size_t Canvas::GetClipDepth() const { return transform_stack_.back().clip_depth; } +void Canvas::AddEntityToCurrentPass(Entity entity) { + entity.SetNewClipDepth(++current_depth_); + GetCurrentPass().AddEntity(std::move(entity)); +} + void Canvas::SaveLayer(const Paint& paint, std::optional bounds, const std::shared_ptr& backdrop_filter) { @@ -768,7 +783,7 @@ void Canvas::DrawTextFrame(const std::shared_ptr& text_frame, entity.SetContents( paint.WithFilters(paint.WithMaskBlur(std::move(text_contents), true))); - GetCurrentPass().AddEntity(std::move(entity)); + AddEntityToCurrentPass(std::move(entity)); } static bool UseColorSourceContents( @@ -807,7 +822,7 @@ void Canvas::DrawVertices(const std::shared_ptr& vertices, // are vertex coordinates then only if the contents are an image. if (UseColorSourceContents(vertices, paint)) { entity.SetContents(CreateContentsForGeometryWithFilters(paint, vertices)); - GetCurrentPass().AddEntity(std::move(entity)); + AddEntityToCurrentPass(std::move(entity)); return; } @@ -845,7 +860,7 @@ void Canvas::DrawVertices(const std::shared_ptr& vertices, contents->SetSourceContents(std::move(src_contents)); entity.SetContents(paint.WithFilters(std::move(contents))); - GetCurrentPass().AddEntity(std::move(entity)); + AddEntityToCurrentPass(std::move(entity)); } void Canvas::DrawAtlas(const std::shared_ptr& atlas, @@ -876,7 +891,7 @@ void Canvas::DrawAtlas(const std::shared_ptr& atlas, entity.SetBlendMode(paint.blend_mode); entity.SetContents(paint.WithFilters(contents)); - GetCurrentPass().AddEntity(std::move(entity)); + AddEntityToCurrentPass(std::move(entity)); } } // namespace impeller diff --git a/impeller/aiks/canvas.h b/impeller/aiks/canvas.h index 6285a2cf13039..215fe1cb631eb 100644 --- a/impeller/aiks/canvas.h +++ b/impeller/aiks/canvas.h @@ -33,8 +33,9 @@ struct CanvasStackEntry { // |cull_rect| is conservative screen-space bounds of the clipped output area std::optional cull_rect; size_t clip_depth = 0u; + // The number of clips tracked for this canvas stack entry. + size_t num_clips = 0u; Entity::RenderingMode rendering_mode = Entity::RenderingMode::kDirect; - bool contains_clips = false; }; enum class PointStyle { @@ -181,6 +182,7 @@ class Canvas { private: std::unique_ptr base_pass_; EntityPass* current_pass_ = nullptr; + uint64_t current_depth_ = 0u; std::deque transform_stack_; std::optional initial_cull_rect_; @@ -192,6 +194,8 @@ class Canvas { size_t GetClipDepth() const; + void AddEntityToCurrentPass(Entity entity); + void ClipGeometry(const std::shared_ptr& geometry, Entity::ClipOperation clip_op); diff --git a/impeller/entity/contents/atlas_contents.cc b/impeller/entity/contents/atlas_contents.cc index c8df84b02ac15..2561f18553996 100644 --- a/impeller/entity/contents/atlas_contents.cc +++ b/impeller/entity/contents/atlas_contents.cc @@ -246,6 +246,7 @@ bool AtlasContents::Render(const ContentContext& renderer, FS::FragInfo frag_info; VS::FrameInfo frame_info; + frame_info.depth = entity.GetShaderClipDepth(); auto dst_sampler_descriptor = sampler_descriptor_; if (renderer.GetDeviceCapabilities().SupportsDecalSamplerAddressMode()) { @@ -404,6 +405,7 @@ bool AtlasTextureContents::Render(const ContentContext& renderer, auto& host_buffer = renderer.GetTransientsBuffer(); VS::FrameInfo frame_info; + frame_info.depth = entity.GetShaderClipDepth(); frame_info.mvp = pass.GetOrthographicTransform() * entity.GetTransform(); frame_info.texture_sampler_y_coord_scale = texture->GetYCoordScale(); frame_info.alpha = alpha_; @@ -490,6 +492,7 @@ bool AtlasColorContents::Render(const ContentContext& renderer, auto& host_buffer = renderer.GetTransientsBuffer(); VS::FrameInfo frame_info; + frame_info.depth = entity.GetShaderClipDepth(); frame_info.mvp = pass.GetOrthographicTransform() * entity.GetTransform(); FS::FragInfo frag_info; diff --git a/impeller/entity/contents/clip_contents.cc b/impeller/entity/contents/clip_contents.cc index 51c90832a07ec..ea5a61b6eb73d 100644 --- a/impeller/entity/contents/clip_contents.cc +++ b/impeller/entity/contents/clip_contents.cc @@ -79,17 +79,19 @@ bool ClipContents::Render(const ContentContext& renderer, using VS = ClipPipeline::VertexShader; VS::FrameInfo info; + info.depth = entity.GetShaderClipDepth(); auto options = OptionsFromPass(pass); options.blend_mode = BlendMode::kDestination; pass.SetStencilReference(entity.GetClipDepth()); - options.stencil_compare = CompareFunction::kEqual; - options.stencil_operation = StencilOperation::kIncrementClamp; if (clip_op_ == Entity::ClipOperation::kDifference) { { pass.SetCommandLabel("Difference Clip (Increment)"); + options.stencil_compare = CompareFunction::kEqual; + options.stencil_operation = StencilOperation::kIncrementClamp; + auto points = Rect::MakeSize(pass.GetRenderTargetSize()).GetPoints(); auto vertices = VertexBufferBuilder{} diff --git a/impeller/entity/contents/conical_gradient_contents.cc b/impeller/entity/contents/conical_gradient_contents.cc index 3bd8ab55e7fec..55fc5134de743 100644 --- a/impeller/entity/contents/conical_gradient_contents.cc +++ b/impeller/entity/contents/conical_gradient_contents.cc @@ -87,6 +87,7 @@ bool ConicalGradientContents::RenderSSBO(const ContentContext& renderer, DefaultUniformAlignment()); VS::FrameInfo frame_info; + frame_info.depth = entity.GetShaderClipDepth(); frame_info.mvp = pass.GetOrthographicTransform() * entity.GetTransform(); frame_info.matrix = GetInverseEffectTransform(); @@ -155,6 +156,7 @@ bool ConicalGradientContents::RenderTexture(const ContentContext& renderer, GetGeometry()->GetPositionBuffer(renderer, entity, pass); VS::FrameInfo frame_info; + frame_info.depth = entity.GetShaderClipDepth(); frame_info.mvp = geometry_result.transform; frame_info.matrix = GetInverseEffectTransform(); diff --git a/impeller/entity/contents/content_context.cc b/impeller/entity/contents/content_context.cc index 4aaa978353759..035d1e3f84f3b 100644 --- a/impeller/entity/contents/content_context.cc +++ b/impeller/entity/contents/content_context.cc @@ -160,8 +160,9 @@ void ContentContextOptions::ApplyToPipelineDescriptor( } if (maybe_depth.has_value()) { DepthAttachmentDescriptor depth = maybe_depth.value(); - depth.depth_compare = CompareFunction::kAlways; - depth.depth_write_enabled = false; + depth.depth_write_enabled = depth_write_enabled; + depth.depth_compare = depth_compare; + desc.SetDepthStencilAttachmentDescriptor(depth); } desc.SetPrimitiveType(primitive_type); diff --git a/impeller/entity/contents/content_context.h b/impeller/entity/contents/content_context.h index 370d7b3d1cddf..acf77ac26e045 100644 --- a/impeller/entity/contents/content_context.h +++ b/impeller/entity/contents/content_context.h @@ -288,11 +288,13 @@ struct PendingCommandBuffers { struct ContentContextOptions { SampleCount sample_count = SampleCount::kCount1; BlendMode blend_mode = BlendMode::kSourceOver; + CompareFunction depth_compare = CompareFunction::kAlways; CompareFunction stencil_compare = CompareFunction::kEqual; StencilOperation stencil_operation = StencilOperation::kKeep; PrimitiveType primitive_type = PrimitiveType::kTriangle; PixelFormat color_attachment_pixel_format = PixelFormat::kUnknown; bool has_depth_stencil_attachments = true; + bool depth_write_enabled = false; bool wireframe = false; bool is_for_rrect_blur_clear = false; @@ -301,6 +303,7 @@ struct ContentContextOptions { static_assert(sizeof(o.sample_count) == 1); static_assert(sizeof(o.blend_mode) == 1); static_assert(sizeof(o.sample_count) == 1); + static_assert(sizeof(o.depth_compare) == 1); static_assert(sizeof(o.stencil_compare) == 1); static_assert(sizeof(o.stencil_operation) == 1); static_assert(sizeof(o.primitive_type) == 1); @@ -309,11 +312,13 @@ struct ContentContextOptions { return (o.is_for_rrect_blur_clear ? 1llu : 0llu) << 0 | (o.wireframe ? 1llu : 0llu) << 1 | (o.has_depth_stencil_attachments ? 1llu : 0llu) << 2 | + (o.depth_write_enabled ? 1llu : 0llu) << 3 | // enums - static_cast(o.color_attachment_pixel_format) << 16 | - static_cast(o.primitive_type) << 24 | - static_cast(o.stencil_operation) << 32 | - static_cast(o.stencil_compare) << 40 | + static_cast(o.color_attachment_pixel_format) << 8 | + static_cast(o.primitive_type) << 16 | + static_cast(o.stencil_operation) << 24 | + static_cast(o.stencil_compare) << 32 | + static_cast(o.depth_compare) << 40 | static_cast(o.blend_mode) << 48 | static_cast(o.sample_count) << 56; } @@ -324,6 +329,8 @@ struct ContentContextOptions { const ContentContextOptions& rhs) const { return lhs.sample_count == rhs.sample_count && lhs.blend_mode == rhs.blend_mode && + lhs.depth_write_enabled == rhs.depth_write_enabled && + lhs.depth_compare == rhs.depth_compare && lhs.stencil_compare == rhs.stencil_compare && lhs.stencil_operation == rhs.stencil_operation && lhs.primitive_type == rhs.primitive_type && diff --git a/impeller/entity/contents/filters/filter_contents.cc b/impeller/entity/contents/filters/filter_contents.cc index a4532db4a78ad..ba0b17d9d856a 100644 --- a/impeller/entity/contents/filters/filter_contents.cc +++ b/impeller/entity/contents/filters/filter_contents.cc @@ -163,6 +163,7 @@ bool FilterContents::Render(const ContentContext& renderer, if (!maybe_entity.has_value()) { return true; } + maybe_entity->SetNewClipDepth(entity.GetNewClipDepth()); return maybe_entity->Render(renderer, pass); } diff --git a/impeller/entity/contents/framebuffer_blend_contents.cc b/impeller/entity/contents/framebuffer_blend_contents.cc index 265f97e3e9b7b..4e0898d66af56 100644 --- a/impeller/entity/contents/framebuffer_blend_contents.cc +++ b/impeller/entity/contents/framebuffer_blend_contents.cc @@ -138,6 +138,7 @@ bool FramebufferBlendContents::Render(const ContentContext& renderer, src_sampler_descriptor); FS::BindTextureSamplerSrc(pass, src_snapshot->texture, src_sampler); + frame_info.depth = entity.GetShaderClipDepth(); frame_info.mvp = pass.GetOrthographicTransform() * src_snapshot->transform; frame_info.src_y_coord_scale = src_snapshot->texture->GetYCoordScale(); VS::BindFrameInfo(pass, host_buffer.EmplaceUniform(frame_info)); diff --git a/impeller/entity/contents/linear_gradient_contents.cc b/impeller/entity/contents/linear_gradient_contents.cc index 5c9fbadfdb79f..3570c658f7e8b 100644 --- a/impeller/entity/contents/linear_gradient_contents.cc +++ b/impeller/entity/contents/linear_gradient_contents.cc @@ -90,6 +90,7 @@ bool LinearGradientContents::RenderTexture(const ContentContext& renderer, GetGeometry()->GetPositionBuffer(renderer, entity, pass); VS::FrameInfo frame_info; + frame_info.depth = entity.GetShaderClipDepth(); frame_info.mvp = geometry_result.transform; frame_info.matrix = GetInverseEffectTransform(); @@ -150,6 +151,7 @@ bool LinearGradientContents::RenderSSBO(const ContentContext& renderer, DefaultUniformAlignment()); VS::FrameInfo frame_info; + frame_info.depth = entity.GetShaderClipDepth(); frame_info.mvp = pass.GetOrthographicTransform() * entity.GetTransform(); frame_info.matrix = GetInverseEffectTransform(); diff --git a/impeller/entity/contents/radial_gradient_contents.cc b/impeller/entity/contents/radial_gradient_contents.cc index ebce82dcdc662..f174a6679fe09 100644 --- a/impeller/entity/contents/radial_gradient_contents.cc +++ b/impeller/entity/contents/radial_gradient_contents.cc @@ -86,6 +86,7 @@ bool RadialGradientContents::RenderSSBO(const ContentContext& renderer, DefaultUniformAlignment()); VS::FrameInfo frame_info; + frame_info.depth = entity.GetShaderClipDepth(); frame_info.mvp = pass.GetOrthographicTransform() * entity.GetTransform(); frame_info.matrix = GetInverseEffectTransform(); @@ -147,6 +148,7 @@ bool RadialGradientContents::RenderTexture(const ContentContext& renderer, GetGeometry()->GetPositionBuffer(renderer, entity, pass); VS::FrameInfo frame_info; + frame_info.depth = entity.GetShaderClipDepth(); frame_info.mvp = geometry_result.transform; frame_info.matrix = GetInverseEffectTransform(); diff --git a/impeller/entity/contents/runtime_effect_contents.cc b/impeller/entity/contents/runtime_effect_contents.cc index ddfdf3d673906..2b358932a1d44 100644 --- a/impeller/entity/contents/runtime_effect_contents.cc +++ b/impeller/entity/contents/runtime_effect_contents.cc @@ -154,6 +154,7 @@ bool RuntimeEffectContents::Render(const ContentContext& renderer, /// VS::FrameInfo frame_info; + frame_info.depth = entity.GetShaderClipDepth(); frame_info.mvp = geometry_result.transform; VS::BindFrameInfo(pass, renderer.GetTransientsBuffer().EmplaceUniform(frame_info)); diff --git a/impeller/entity/contents/solid_color_contents.cc b/impeller/entity/contents/solid_color_contents.cc index c2545fc0a0164..d506c0f3197f7 100644 --- a/impeller/entity/contents/solid_color_contents.cc +++ b/impeller/entity/contents/solid_color_contents.cc @@ -69,6 +69,7 @@ bool SolidColorContents::Render(const ContentContext& renderer, pass.SetStencilReference(entity.GetClipDepth()); VS::FrameInfo frame_info; + frame_info.depth = entity.GetShaderClipDepth(); frame_info.mvp = capture.AddMatrix("Transform", geometry_result.transform); frame_info.color = capture.AddColor("Color", GetColor()).Premultiply(); VS::BindFrameInfo(pass, diff --git a/impeller/entity/contents/solid_rrect_blur_contents.cc b/impeller/entity/contents/solid_rrect_blur_contents.cc index 6cd24f968a0d4..2a007b52f5c74 100644 --- a/impeller/entity/contents/solid_rrect_blur_contents.cc +++ b/impeller/entity/contents/solid_rrect_blur_contents.cc @@ -98,6 +98,7 @@ bool SolidRRectBlurContents::Render(const ContentContext& renderer, } VS::FrameInfo frame_info; + frame_info.depth = entity.GetShaderClipDepth(); frame_info.mvp = pass.GetOrthographicTransform() * entity.GetTransform() * Matrix::MakeTranslation(positive_rect.GetOrigin()); diff --git a/impeller/entity/contents/sweep_gradient_contents.cc b/impeller/entity/contents/sweep_gradient_contents.cc index a4a3bb9879cbd..111324488061a 100644 --- a/impeller/entity/contents/sweep_gradient_contents.cc +++ b/impeller/entity/contents/sweep_gradient_contents.cc @@ -93,6 +93,7 @@ bool SweepGradientContents::RenderSSBO(const ContentContext& renderer, DefaultUniformAlignment()); VS::FrameInfo frame_info; + frame_info.depth = entity.GetShaderClipDepth(); frame_info.mvp = pass.GetOrthographicTransform() * entity.GetTransform(); frame_info.matrix = GetInverseEffectTransform(); @@ -156,6 +157,7 @@ bool SweepGradientContents::RenderTexture(const ContentContext& renderer, GetGeometry()->GetPositionBuffer(renderer, entity, pass); VS::FrameInfo frame_info; + frame_info.depth = entity.GetShaderClipDepth(); frame_info.mvp = geometry_result.transform; frame_info.matrix = GetInverseEffectTransform(); diff --git a/impeller/entity/contents/text_contents.cc b/impeller/entity/contents/text_contents.cc index cd548573f051a..b83d29a8a62cf 100644 --- a/impeller/entity/contents/text_contents.cc +++ b/impeller/entity/contents/text_contents.cc @@ -95,6 +95,7 @@ bool TextContents::Render(const ContentContext& renderer, // Common vertex uniforms for all glyphs. VS::FrameInfo frame_info; + frame_info.depth = entity.GetShaderClipDepth(); frame_info.mvp = pass.GetOrthographicTransform(); frame_info.atlas_size = Vector2{static_cast(atlas->GetTexture()->GetSize().width), diff --git a/impeller/entity/contents/texture_contents.cc b/impeller/entity/contents/texture_contents.cc index 116e5e7617908..e600eb230c673 100644 --- a/impeller/entity/contents/texture_contents.cc +++ b/impeller/entity/contents/texture_contents.cc @@ -142,6 +142,7 @@ bool TextureContents::Render(const ContentContext& renderer, auto& host_buffer = renderer.GetTransientsBuffer(); VS::FrameInfo frame_info; + frame_info.depth = entity.GetShaderClipDepth(); frame_info.mvp = pass.GetOrthographicTransform() * capture.AddMatrix("Transform", entity.GetTransform()); frame_info.texture_sampler_y_coord_scale = texture_->GetYCoordScale(); diff --git a/impeller/entity/contents/tiled_texture_contents.cc b/impeller/entity/contents/tiled_texture_contents.cc index 3a9f558ddaa2c..823c3d0b6132d 100644 --- a/impeller/entity/contents/tiled_texture_contents.cc +++ b/impeller/entity/contents/tiled_texture_contents.cc @@ -138,6 +138,7 @@ bool TiledTextureContents::Render(const ContentContext& renderer, UsesEmulatedTileMode(renderer.GetDeviceCapabilities()); VS::FrameInfo frame_info; + frame_info.depth = entity.GetShaderClipDepth(); frame_info.mvp = geometry_result.transform; frame_info.texture_sampler_y_coord_scale = texture_->GetYCoordScale(); frame_info.alpha = GetOpacityFactor(); diff --git a/impeller/entity/contents/vertices_contents.cc b/impeller/entity/contents/vertices_contents.cc index f5d433d70f009..bdcf9cd83ff7a 100644 --- a/impeller/entity/contents/vertices_contents.cc +++ b/impeller/entity/contents/vertices_contents.cc @@ -139,6 +139,7 @@ bool VerticesUVContents::Render(const ContentContext& renderer, pass.SetVertexBuffer(std::move(geometry_result.vertex_buffer)); VS::FrameInfo frame_info; + frame_info.depth = entity.GetShaderClipDepth(); frame_info.mvp = geometry_result.transform; frame_info.texture_sampler_y_coord_scale = snapshot->texture->GetYCoordScale(); @@ -188,6 +189,7 @@ bool VerticesColorContents::Render(const ContentContext& renderer, pass.SetVertexBuffer(std::move(geometry_result.vertex_buffer)); VS::FrameInfo frame_info; + frame_info.depth = entity.GetShaderClipDepth(); frame_info.mvp = geometry_result.transform; VS::BindFrameInfo(pass, host_buffer.EmplaceUniform(frame_info)); diff --git a/impeller/entity/entity.cc b/impeller/entity/entity.cc index 99f74727f04c8..e1f26f6fc8325 100644 --- a/impeller/entity/entity.cc +++ b/impeller/entity/entity.cc @@ -5,6 +5,7 @@ #include "impeller/entity/entity.h" #include +#include #include #include "impeller/base/validation.h" @@ -46,6 +47,10 @@ Entity::Entity() = default; Entity::~Entity() = default; +Entity::Entity(Entity&&) = default; + +Entity::Entity(const Entity&) = default; + const Matrix& Entity::GetTransform() const { return transform_; } @@ -86,14 +91,28 @@ const std::shared_ptr& Entity::GetContents() const { return contents_; } -void Entity::SetClipDepth(uint32_t depth) { - clip_depth_ = depth; +void Entity::SetClipDepth(uint32_t clip_depth) { + clip_depth_ = clip_depth; } uint32_t Entity::GetClipDepth() const { return clip_depth_; } +void Entity::SetNewClipDepth(uint32_t clip_depth) { + new_clip_depth_ = clip_depth; +} + +uint32_t Entity::GetNewClipDepth() const { + return new_clip_depth_; +} + +static const Scalar kDepthEpsilon = 1.0f / std::pow(2, 18); + +float Entity::GetShaderClipDepth() const { + return new_clip_depth_ * kDepthEpsilon; +} + void Entity::IncrementStencilDepth(uint32_t increment) { clip_depth_ += increment; } diff --git a/impeller/entity/entity.h b/impeller/entity/entity.h index 72671320dc785..e0a14fd218ffd 100644 --- a/impeller/entity/entity.h +++ b/impeller/entity/entity.h @@ -71,7 +71,7 @@ class Entity { ~Entity(); - Entity(Entity&&) = default; + Entity(Entity&&); /// @brief Get the global transform matrix for this Entity. const Matrix& GetTransform() const; @@ -96,6 +96,12 @@ class Entity { uint32_t GetClipDepth() const; + void SetNewClipDepth(uint32_t clip_depth); + + uint32_t GetNewClipDepth() const; + + float GetShaderClipDepth() const; + void SetBlendMode(BlendMode blend_mode); BlendMode GetBlendMode() const; @@ -119,12 +125,13 @@ class Entity { Entity Clone() const; private: - Entity(const Entity&) = default; + Entity(const Entity&); Matrix transform_; std::shared_ptr contents_; BlendMode blend_mode_ = BlendMode::kSourceOver; uint32_t clip_depth_ = 0u; + uint32_t new_clip_depth_ = 0u; mutable Capture capture_; }; diff --git a/impeller/entity/entity_pass.cc b/impeller/entity/entity_pass.cc index 94c4cf5061a27..9fa6be3f14b10 100644 --- a/impeller/entity/entity_pass.cc +++ b/impeller/entity/entity_pass.cc @@ -79,6 +79,33 @@ void EntityPass::AddEntity(Entity entity) { elements_.emplace_back(std::move(entity)); } +void EntityPass::PushClip(Entity entity) { + elements_.emplace_back(std::move(entity)); + active_clips_.emplace_back(elements_.size() - 1); +} + +void EntityPass::PopClips(size_t num_clips, uint64_t depth) { + if (num_clips > active_clips_.size()) { + VALIDATION_LOG + << "Attempted to pop more clips than are currently active. Active: " + << active_clips_.size() << ", Popped: " << num_clips + << ", Depth: " << depth; + } + + size_t max = std::min(num_clips, active_clips_.size()); + for (size_t i = 0; i < max; i++) { + FML_DCHECK(active_clips_.back() < elements_.size()); + Entity* element = std::get_if(&elements_[active_clips_.back()]); + FML_DCHECK(element); + element->SetNewClipDepth(depth); + active_clips_.pop_back(); + } +} + +void EntityPass::PopAllClips(uint64_t depth) { + PopClips(active_clips_.size(), depth); +} + void EntityPass::SetElements(std::vector elements) { elements_ = std::move(elements); } @@ -683,6 +710,7 @@ EntityPass::EntityResult EntityPass::GetEntityForElement( Entity element_entity; Capture subpass_texture_capture = capture.CreateChild("Entity (Subpass texture)"); + element_entity.SetNewClipDepth(subpass->new_clip_depth_); element_entity.SetCapture(subpass_texture_capture); element_entity.SetContents(std::move(offscreen_texture_contents)); element_entity.SetClipDepth(subpass->clip_depth_); @@ -857,6 +885,13 @@ bool EntityPass::OnRender( collapsed_parent_pass) const { TRACE_EVENT0("impeller", "EntityPass::OnRender"); + if (!active_clips_.empty()) { + VALIDATION_LOG << SPrintF( + "EntityPass (Depth=%d) contains one or more clips with an unresolved " + "depth value.", + pass_depth); + } + InlinePassContext pass_context(renderer, pass_target, GetTotalPassReads(renderer), GetElementCount(), collapsed_parent_pass); @@ -1136,6 +1171,8 @@ std::unique_ptr EntityPass::Clone() const { auto pass = std::make_unique(); pass->SetElements(std::move(new_elements)); + pass->active_clips_.insert(pass->active_clips_.begin(), active_clips_.begin(), + active_clips_.end()); pass->backdrop_filter_reads_from_pass_texture_ = backdrop_filter_reads_from_pass_texture_; pass->advanced_blend_reads_from_pass_texture_ = @@ -1143,6 +1180,7 @@ std::unique_ptr EntityPass::Clone() const { pass->backdrop_filter_proc_ = backdrop_filter_proc_; pass->blend_mode_ = blend_mode_; pass->delegate_ = delegate_; + pass->new_clip_depth_ = new_clip_depth_; // Note: I tried also adding flood clip and bounds limit but one of the // two caused rendering in wonderous to break. It's 10:51 PM, and I'm // ready to move on. @@ -1157,10 +1195,18 @@ void EntityPass::SetClipDepth(size_t clip_depth) { clip_depth_ = clip_depth; } -size_t EntityPass::GetClipDepth() { +size_t EntityPass::GetClipDepth() const { return clip_depth_; } +void EntityPass::SetNewClipDepth(size_t clip_depth) { + new_clip_depth_ = clip_depth; +} + +uint32_t EntityPass::GetNewClipDepth() const { + return new_clip_depth_; +} + void EntityPass::SetBlendMode(BlendMode blend_mode) { blend_mode_ = blend_mode; flood_clip_ = Entity::IsBlendModeDestructive(blend_mode); diff --git a/impeller/entity/entity_pass.h b/impeller/entity/entity_pass.h index 7de68d0d9ad11..af0f130042275 100644 --- a/impeller/entity/entity_pass.h +++ b/impeller/entity/entity_pass.h @@ -76,6 +76,12 @@ class EntityPass { /// @brief Add an entity to the current entity pass. void AddEntity(Entity entity); + void PushClip(Entity entity); + + void PopClips(size_t num_clips, uint64_t depth); + + void PopAllClips(uint64_t depth); + void SetElements(std::vector elements); //---------------------------------------------------------------------------- @@ -135,7 +141,11 @@ class EntityPass { void SetClipDepth(size_t clip_depth); - size_t GetClipDepth(); + size_t GetClipDepth() const; + + void SetNewClipDepth(size_t clip_depth); + + uint32_t GetNewClipDepth() const; void SetBlendMode(BlendMode blend_mode); @@ -297,9 +307,16 @@ class EntityPass { /// evaluated and recorded to an `EntityPassTarget` by the `OnRender` method. std::vector elements_; + /// The stack of currently active clips (during Aiks recording time). Each + /// entry is an index into the `elements_` list. The depth value of a clip is + /// the max of all the entities it affects, so assignment of the depth value + /// is deferred until clip restore or end of the EntityPass. + std::vector active_clips_; + EntityPass* superpass_ = nullptr; Matrix transform_; size_t clip_depth_ = 0u; + uint32_t new_clip_depth_ = 1u; BlendMode blend_mode_ = BlendMode::kSourceOver; bool flood_clip_ = false; bool enable_offscreen_debug_checkerboard_ = false; diff --git a/impeller/entity/entity_playground.cc b/impeller/entity/entity_playground.cc index d74e177e2e382..294141b995821 100644 --- a/impeller/entity/entity_playground.cc +++ b/impeller/entity/entity_playground.cc @@ -30,6 +30,12 @@ bool EntityPlayground::OpenPlaygroundHere(EntityPass& entity_pass) { return false; } + // Resolve any lingering tracked clips by assigning an arbitrarily high + // number. The number to assign just needs to be at least as high as larger + // any previously assigned clip depth in the scene. Normally, Aiks handles + // this correctly when wrapping up the base pass as an `impeller::Picture`. + entity_pass.PopAllClips(99999); + auto callback = [&](RenderTarget& render_target) -> bool { return entity_pass.Render(content_context, render_target); }; diff --git a/impeller/entity/shaders/blending/framebuffer_blend.vert b/impeller/entity/shaders/blending/framebuffer_blend.vert index 362362e4e3f8f..a8429a517cd9f 100644 --- a/impeller/entity/shaders/blending/framebuffer_blend.vert +++ b/impeller/entity/shaders/blending/framebuffer_blend.vert @@ -10,6 +10,7 @@ // impeller/renderer/backend/vulkan/binding_helpers_vk.cc uniform FrameInfo { mat4 mvp; + float depth; float src_y_coord_scale; } frame_info; @@ -20,7 +21,7 @@ in vec2 src_texture_coords; out vec2 v_src_texture_coords; void main() { - gl_Position = frame_info.mvp * vec4(vertices, 0.0, 1.0); + gl_Position = frame_info.mvp * vec4(vertices, frame_info.depth, 1.0); v_src_texture_coords = IPRemapCoords(src_texture_coords, frame_info.src_y_coord_scale); } diff --git a/impeller/entity/shaders/blending/porter_duff_blend.vert b/impeller/entity/shaders/blending/porter_duff_blend.vert index ca266ff6686f6..13f992883b0aa 100644 --- a/impeller/entity/shaders/blending/porter_duff_blend.vert +++ b/impeller/entity/shaders/blending/porter_duff_blend.vert @@ -7,6 +7,7 @@ uniform FrameInfo { mat4 mvp; + float depth; float texture_sampler_y_coord_scale; } frame_info; @@ -19,7 +20,7 @@ out vec2 v_texture_coords; out f16vec4 v_color; void main() { - gl_Position = frame_info.mvp * vec4(vertices, 0.0, 1.0); + gl_Position = frame_info.mvp * vec4(vertices, frame_info.depth, 1.0); v_color = f16vec4(color); v_texture_coords = IPRemapCoords(texture_coords, frame_info.texture_sampler_y_coord_scale); diff --git a/impeller/entity/shaders/clip.vert b/impeller/entity/shaders/clip.vert index 4d8e67e74a2ef..0a7e15f25183d 100644 --- a/impeller/entity/shaders/clip.vert +++ b/impeller/entity/shaders/clip.vert @@ -6,11 +6,12 @@ uniform FrameInfo { mat4 mvp; + float depth; } frame_info; in vec2 position; void main() { - gl_Position = frame_info.mvp * vec4(position, 0.0, 1.0); + gl_Position = frame_info.mvp * vec4(position, frame_info.depth, 1.0); } diff --git a/impeller/entity/shaders/glyph_atlas.vert b/impeller/entity/shaders/glyph_atlas.vert index c677997e7268e..bf0a48a5cd413 100644 --- a/impeller/entity/shaders/glyph_atlas.vert +++ b/impeller/entity/shaders/glyph_atlas.vert @@ -7,6 +7,7 @@ uniform FrameInfo { mat4 mvp; + float depth; mat4 entity_transform; vec2 atlas_size; vec2 offset; @@ -79,7 +80,7 @@ void main() { 0.0, 1.0); } - gl_Position = frame_info.mvp * position; + gl_Position = frame_info.mvp * vec4(position.xy, frame_info.depth, 1.0); v_uv = uv_origin + unit_position * uv_size; v_text_color = frame_info.text_color; } diff --git a/impeller/entity/shaders/gradient_fill.vert b/impeller/entity/shaders/gradient_fill.vert index 824f496ea8c22..bc5b2f75a515e 100644 --- a/impeller/entity/shaders/gradient_fill.vert +++ b/impeller/entity/shaders/gradient_fill.vert @@ -7,6 +7,7 @@ uniform FrameInfo { mat4 mvp; + float depth; mat4 matrix; } frame_info; @@ -16,6 +17,6 @@ in vec2 position; out vec2 v_position; void main() { - gl_Position = frame_info.mvp * vec4(position, 0.0, 1.0); + gl_Position = frame_info.mvp * vec4(position, frame_info.depth, 1.0); v_position = IPVec2TransformPosition(frame_info.matrix, position); } diff --git a/impeller/entity/shaders/position_color.vert b/impeller/entity/shaders/position_color.vert index d6b35c464f7d9..1ca6b98d61a0e 100644 --- a/impeller/entity/shaders/position_color.vert +++ b/impeller/entity/shaders/position_color.vert @@ -7,6 +7,7 @@ uniform FrameInfo { mat4 mvp; + float depth; } frame_info; @@ -16,6 +17,6 @@ in vec4 color; out f16vec4 v_color; void main() { - gl_Position = frame_info.mvp * vec4(position, 0.0, 1.0); + gl_Position = frame_info.mvp * vec4(position, frame_info.depth, 1.0); v_color = f16vec4(color); } diff --git a/impeller/entity/shaders/rrect_blur.vert b/impeller/entity/shaders/rrect_blur.vert index 87382f6b4dcbe..b8242d363ed10 100644 --- a/impeller/entity/shaders/rrect_blur.vert +++ b/impeller/entity/shaders/rrect_blur.vert @@ -6,6 +6,7 @@ uniform FrameInfo { mat4 mvp; + float depth; } frame_info; @@ -14,7 +15,7 @@ in vec2 position; out vec2 v_position; void main() { - gl_Position = frame_info.mvp * vec4(position, 0.0, 1.0); + gl_Position = frame_info.mvp * vec4(position, frame_info.depth, 1.0); // The fragment stage uses local coordinates to compute the blur. v_position = position; } diff --git a/impeller/entity/shaders/runtime_effect.vert b/impeller/entity/shaders/runtime_effect.vert index 77b92d221142c..0c635f2b1aa29 100644 --- a/impeller/entity/shaders/runtime_effect.vert +++ b/impeller/entity/shaders/runtime_effect.vert @@ -6,6 +6,7 @@ uniform FrameInfo { mat4 mvp; + float depth; } frame_info; @@ -16,6 +17,6 @@ in vec2 position; out vec2 _fragCoord; void main() { - gl_Position = frame_info.mvp * vec4(position, 0.0, 1.0); + gl_Position = frame_info.mvp * vec4(position, frame_info.depth, 1.0); _fragCoord = position; } diff --git a/impeller/entity/shaders/solid_fill.vert b/impeller/entity/shaders/solid_fill.vert index 76733804d6e45..2702222191b70 100644 --- a/impeller/entity/shaders/solid_fill.vert +++ b/impeller/entity/shaders/solid_fill.vert @@ -6,6 +6,7 @@ uniform FrameInfo { mat4 mvp; + float depth; f16vec4 color; } frame_info; @@ -16,5 +17,5 @@ IMPELLER_MAYBE_FLAT out f16vec4 v_color; void main() { v_color = frame_info.color; - gl_Position = frame_info.mvp * vec4(position, 0.0, 1.0); + gl_Position = frame_info.mvp * vec4(position, frame_info.depth, 1.0); } diff --git a/impeller/entity/shaders/texture_fill.vert b/impeller/entity/shaders/texture_fill.vert index 26e5f73f713b5..52be88c8e7c66 100644 --- a/impeller/entity/shaders/texture_fill.vert +++ b/impeller/entity/shaders/texture_fill.vert @@ -7,6 +7,7 @@ uniform FrameInfo { mat4 mvp; + float depth; float texture_sampler_y_coord_scale; float16_t alpha; } @@ -19,7 +20,7 @@ out vec2 v_texture_coords; IMPELLER_MAYBE_FLAT out float16_t v_alpha; void main() { - gl_Position = frame_info.mvp * vec4(position, 0.0, 1.0); + gl_Position = frame_info.mvp * vec4(position, frame_info.depth, 1.0); v_alpha = frame_info.alpha; v_texture_coords = IPRemapCoords(texture_coords, frame_info.texture_sampler_y_coord_scale); diff --git a/impeller/renderer/backend/gles/texture_gles.cc b/impeller/renderer/backend/gles/texture_gles.cc index 9a4dfc7ba169b..74b2f6f503fcf 100644 --- a/impeller/renderer/backend/gles/texture_gles.cc +++ b/impeller/renderer/backend/gles/texture_gles.cc @@ -154,12 +154,12 @@ struct TexImage2DData { // only use the stencil component. // // https://registry.khronos.org/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml + case PixelFormat::kD24UnormS8Uint: internal_format = GL_DEPTH_STENCIL; external_format = GL_DEPTH_STENCIL; type = GL_UNSIGNED_INT_24_8; break; case PixelFormat::kUnknown: - case PixelFormat::kD24UnormS8Uint: case PixelFormat::kD32FloatS8UInt: case PixelFormat::kR8UNormInt: case PixelFormat::kR8G8UNormInt: diff --git a/impeller/tools/malioc.json b/impeller/tools/malioc.json index 8cf4183c4f6ac..f63e7632d37ff 100644 --- a/impeller/tools/malioc.json +++ b/impeller/tools/malioc.json @@ -2583,7 +2583,7 @@ "Mali-G78": { "core": "Mali-G78", "filename": "flutter/impeller/entity/gles/clip.vert.gles", - "has_uniform_computation": false, + "has_uniform_computation": true, "type": "Vertex", "variants": { "Position": { @@ -2634,7 +2634,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 20, + "uniform_registers_used": 28, "work_registers_used": 32 } } @@ -2652,7 +2652,7 @@ "load_store" ], "longest_path_cycles": [ - 2.640000104904175, + 2.9700000286102295, 3.0, 0.0 ], @@ -2665,21 +2665,22 @@ "load_store" ], "shortest_path_cycles": [ - 2.640000104904175, + 2.9700000286102295, 3.0, 0.0 ], "total_bound_pipelines": [ + "arithmetic", "load_store" ], "total_cycles": [ - 2.6666667461395264, + 3.0, 3.0, 0.0 ] }, "thread_occupancy": 100, - "uniform_registers_used": 5, + "uniform_registers_used": 7, "work_registers_used": 2 } } @@ -3611,9 +3612,9 @@ "load_store" ], "longest_path_cycles": [ - 0.515625, - 0.515625, - 0.140625, + 0.390625, + 0.390625, + 0.09375, 0.0, 4.0, 0.0 @@ -3630,8 +3631,8 @@ "load_store" ], "shortest_path_cycles": [ - 0.484375, - 0.484375, + 0.328125, + 0.328125, 0.03125, 0.0, 4.0, @@ -3641,9 +3642,9 @@ "load_store" ], "total_cycles": [ - 0.737500011920929, - 0.737500011920929, - 0.15625, + 0.546875, + 0.546875, + 0.109375, 0.0, 4.0, 0.0 @@ -3651,7 +3652,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 48, + "uniform_registers_used": 46, "work_registers_used": 32 }, "Varying": { @@ -3702,7 +3703,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 18, + "uniform_registers_used": 22, "work_registers_used": 16 } } @@ -3720,7 +3721,7 @@ "load_store" ], "longest_path_cycles": [ - 7.260000228881836, + 6.929999828338623, 8.0, 0.0 ], @@ -3733,7 +3734,7 @@ "load_store" ], "shortest_path_cycles": [ - 6.269999980926514, + 5.940000057220459, 8.0, 0.0 ], @@ -3741,13 +3742,13 @@ "arithmetic" ], "total_cycles": [ - 9.333333015441895, + 9.0, 8.0, 0.0 ] }, "thread_occupancy": 100, - "uniform_registers_used": 13, + "uniform_registers_used": 12, "work_registers_used": 3 } } @@ -3876,7 +3877,7 @@ "Mali-G78": { "core": "Mali-G78", "filename": "flutter/impeller/entity/gles/gradient_fill.vert.gles", - "has_uniform_computation": false, + "has_uniform_computation": true, "type": "Vertex", "variants": { "Position": { @@ -3927,7 +3928,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 30, + "uniform_registers_used": 38, "work_registers_used": 32 }, "Varying": { @@ -3978,7 +3979,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 18, + "uniform_registers_used": 22, "work_registers_used": 11 } } @@ -3996,7 +3997,7 @@ "load_store" ], "longest_path_cycles": [ - 3.299999952316284, + 3.630000114440918, 4.0, 0.0 ], @@ -4009,7 +4010,7 @@ "load_store" ], "shortest_path_cycles": [ - 3.299999952316284, + 3.630000114440918, 4.0, 0.0 ], @@ -4017,14 +4018,14 @@ "load_store" ], "total_cycles": [ - 3.3333332538604736, + 3.6666667461395264, 4.0, 0.0 ] }, "thread_occupancy": 100, - "uniform_registers_used": 8, - "work_registers_used": 2 + "uniform_registers_used": 10, + "work_registers_used": 3 } } } @@ -5102,7 +5103,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 22, + "uniform_registers_used": 30, "work_registers_used": 32 }, "Varying": { @@ -5153,7 +5154,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 10, + "uniform_registers_used": 14, "work_registers_used": 12 } } @@ -5171,7 +5172,7 @@ "load_store" ], "longest_path_cycles": [ - 2.9700000286102295, + 3.299999952316284, 7.0, 0.0 ], @@ -5184,7 +5185,7 @@ "load_store" ], "shortest_path_cycles": [ - 2.9700000286102295, + 3.299999952316284, 7.0, 0.0 ], @@ -5192,13 +5193,13 @@ "load_store" ], "total_cycles": [ - 3.0, + 3.3333332538604736, 7.0, 0.0 ] }, "thread_occupancy": 100, - "uniform_registers_used": 6, + "uniform_registers_used": 7, "work_registers_used": 2 } } @@ -5208,7 +5209,7 @@ "Mali-G78": { "core": "Mali-G78", "filename": "flutter/impeller/entity/gles/position_color.vert.gles", - "has_uniform_computation": false, + "has_uniform_computation": true, "type": "Vertex", "variants": { "Position": { @@ -5259,7 +5260,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 20, + "uniform_registers_used": 28, "work_registers_used": 32 }, "Varying": { @@ -5310,7 +5311,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 8, + "uniform_registers_used": 12, "work_registers_used": 9 } } @@ -5328,7 +5329,7 @@ "load_store" ], "longest_path_cycles": [ - 2.640000104904175, + 2.9700000286102295, 5.0, 0.0 ], @@ -5341,7 +5342,7 @@ "load_store" ], "shortest_path_cycles": [ - 2.640000104904175, + 2.9700000286102295, 5.0, 0.0 ], @@ -5349,13 +5350,13 @@ "load_store" ], "total_cycles": [ - 2.6666667461395264, + 3.0, 5.0, 0.0 ] }, "thread_occupancy": 100, - "uniform_registers_used": 5, + "uniform_registers_used": 7, "work_registers_used": 2 } } @@ -5600,7 +5601,7 @@ "Mali-G78": { "core": "Mali-G78", "filename": "flutter/impeller/entity/gles/rrect_blur.vert.gles", - "has_uniform_computation": false, + "has_uniform_computation": true, "type": "Vertex", "variants": { "Position": { @@ -5651,7 +5652,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 20, + "uniform_registers_used": 28, "work_registers_used": 32 }, "Varying": { @@ -5702,7 +5703,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 8, + "uniform_registers_used": 12, "work_registers_used": 7 } } @@ -5720,7 +5721,7 @@ "load_store" ], "longest_path_cycles": [ - 2.640000104904175, + 2.9700000286102295, 4.0, 0.0 ], @@ -5733,7 +5734,7 @@ "load_store" ], "shortest_path_cycles": [ - 2.640000104904175, + 2.9700000286102295, 4.0, 0.0 ], @@ -5741,13 +5742,13 @@ "load_store" ], "total_cycles": [ - 2.6666667461395264, + 3.0, 4.0, 0.0 ] }, "thread_occupancy": 100, - "uniform_registers_used": 5, + "uniform_registers_used": 7, "work_registers_used": 2 } } @@ -5757,7 +5758,7 @@ "Mali-G78": { "core": "Mali-G78", "filename": "flutter/impeller/entity/gles/runtime_effect.vert.gles", - "has_uniform_computation": false, + "has_uniform_computation": true, "type": "Vertex", "variants": { "Position": { @@ -5808,7 +5809,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 20, + "uniform_registers_used": 28, "work_registers_used": 32 }, "Varying": { @@ -5859,7 +5860,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 8, + "uniform_registers_used": 12, "work_registers_used": 7 } } @@ -5877,7 +5878,7 @@ "load_store" ], "longest_path_cycles": [ - 2.640000104904175, + 2.9700000286102295, 4.0, 0.0 ], @@ -5890,7 +5891,7 @@ "load_store" ], "shortest_path_cycles": [ - 2.640000104904175, + 2.9700000286102295, 4.0, 0.0 ], @@ -5898,13 +5899,13 @@ "load_store" ], "total_cycles": [ - 2.6666667461395264, + 3.0, 4.0, 0.0 ] }, "thread_occupancy": 100, - "uniform_registers_used": 5, + "uniform_registers_used": 7, "work_registers_used": 2 } } @@ -6031,7 +6032,7 @@ "Mali-G78": { "core": "Mali-G78", "filename": "flutter/impeller/entity/gles/solid_fill.vert.gles", - "has_uniform_computation": false, + "has_uniform_computation": true, "type": "Vertex", "variants": { "Position": { @@ -6082,7 +6083,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 24, + "uniform_registers_used": 32, "work_registers_used": 32 }, "Varying": { @@ -6133,7 +6134,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 12, + "uniform_registers_used": 16, "work_registers_used": 7 } } @@ -6151,7 +6152,7 @@ "load_store" ], "longest_path_cycles": [ - 2.640000104904175, + 2.9700000286102295, 4.0, 0.0 ], @@ -6164,7 +6165,7 @@ "load_store" ], "shortest_path_cycles": [ - 2.640000104904175, + 2.9700000286102295, 4.0, 0.0 ], @@ -6172,13 +6173,13 @@ "load_store" ], "total_cycles": [ - 2.6666667461395264, + 3.0, 4.0, 0.0 ] }, "thread_occupancy": 100, - "uniform_registers_used": 6, + "uniform_registers_used": 8, "work_registers_used": 2 } } @@ -6753,7 +6754,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 22, + "uniform_registers_used": 30, "work_registers_used": 32 }, "Varying": { @@ -6804,7 +6805,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 10, + "uniform_registers_used": 14, "work_registers_used": 8 } } @@ -6822,7 +6823,7 @@ "load_store" ], "longest_path_cycles": [ - 2.9700000286102295, + 3.299999952316284, 6.0, 0.0 ], @@ -6835,7 +6836,7 @@ "load_store" ], "shortest_path_cycles": [ - 2.9700000286102295, + 3.299999952316284, 6.0, 0.0 ], @@ -6843,13 +6844,13 @@ "load_store" ], "total_cycles": [ - 3.0, + 3.3333332538604736, 6.0, 0.0 ] }, "thread_occupancy": 100, - "uniform_registers_used": 6, + "uniform_registers_used": 7, "work_registers_used": 2 } } @@ -7797,9 +7798,9 @@ "load_store" ], "longest_path_cycles": [ - 0.5, - 0.5, - 0.140625, + 0.375, + 0.375, + 0.109375, 0.0, 4.0, 0.0 @@ -7816,8 +7817,8 @@ "load_store" ], "shortest_path_cycles": [ - 0.46875, - 0.46875, + 0.28125, + 0.28125, 0.03125, 0.0, 4.0, @@ -7827,9 +7828,9 @@ "load_store" ], "total_cycles": [ - 0.71875, - 0.71875, - 0.15625, + 0.53125, + 0.53125, + 0.125, 0.0, 4.0, 0.0 @@ -7837,7 +7838,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 56, + "uniform_registers_used": 50, "work_registers_used": 32 }, "Varying": { @@ -7888,7 +7889,7 @@ }, "stack_spill_bytes": 0, "thread_occupancy": 100, - "uniform_registers_used": 48, + "uniform_registers_used": 38, "work_registers_used": 13 } }