From 673bdc5bbbdc67923da086cb807df48260bf6035 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Wed, 24 Apr 2024 12:45:23 -0700 Subject: [PATCH 1/4] remove shader bootstrap. --- impeller/entity/contents/content_context.cc | 37 --------------------- 1 file changed, 37 deletions(-) diff --git a/impeller/entity/contents/content_context.cc b/impeller/entity/contents/content_context.cc index b6e6dde5b5806..9c440bf43ac09 100644 --- a/impeller/entity/contents/content_context.cc +++ b/impeller/entity/contents/content_context.cc @@ -587,43 +587,6 @@ void ContentContext::InitializeCommonlyUsedShadersIfNeeded() const { return; } - // Initialize commonly used shaders that aren't defaults. These settings were - // chosen based on the knowledge that we mix and match triangle and - // triangle-strip geometry, and also have fairly agressive srcOver to src - // blend mode conversions. - auto options = ContentContextOptions{ - .sample_count = SampleCount::kCount4, - .color_attachment_pixel_format = - context_->GetCapabilities()->GetDefaultColorFormat()}; - - // Note: When editing this, check the order the default pipelines are created. - // These should be first. - for (const auto mode : {BlendMode::kSource, BlendMode::kSourceOver}) { - for (const auto geometry : - {PrimitiveType::kTriangle, PrimitiveType::kTriangleStrip}) { - options.blend_mode = mode; - options.primitive_type = geometry; - CreateIfNeeded(solid_fill_pipelines_, options); - CreateIfNeeded(texture_pipelines_, options); - if (GetContext()->GetCapabilities()->SupportsSSBO()) { - CreateIfNeeded(linear_gradient_ssbo_fill_pipelines_, options); - CreateIfNeeded(radial_gradient_ssbo_fill_pipelines_, options); - CreateIfNeeded(sweep_gradient_ssbo_fill_pipelines_, options); - CreateIfNeeded(conical_gradient_ssbo_fill_pipelines_, options); - } - } - } - - options.blend_mode = BlendMode::kDestination; - options.primitive_type = PrimitiveType::kTriangleStrip; - for (const auto stencil_mode : - {ContentContextOptions::StencilMode::kLegacyClipIncrement, - ContentContextOptions::StencilMode::kLegacyClipDecrement, - ContentContextOptions::StencilMode::kLegacyClipRestore}) { - options.stencil_mode = stencil_mode; - CreateIfNeeded(clip_pipelines_, options); - } - // On ARM devices, the initial usage of vkCmdCopyBufferToImage has been // observed to take 10s of ms as an internal shader is compiled to perform // the operation. Similarly, the initial render pass can also take 10s of ms From 10d58f97cc01fe2d20cf484086fe0752a3367455 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 24 Apr 2024 12:59:06 -0700 Subject: [PATCH 2/4] Update content_context.cc --- impeller/entity/contents/content_context.cc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/impeller/entity/contents/content_context.cc b/impeller/entity/contents/content_context.cc index 9c440bf43ac09..a96c72eee0fa7 100644 --- a/impeller/entity/contents/content_context.cc +++ b/impeller/entity/contents/content_context.cc @@ -581,11 +581,6 @@ void ContentContext::InitializeCommonlyUsedShadersIfNeeded() const { TRACE_EVENT0("flutter", "InitializeCommonlyUsedShadersIfNeeded"); GetContext()->InitializeCommonlyUsedShadersIfNeeded(); - if (GetContext()->GetBackendType() == Context::BackendType::kOpenGLES) { - // TODO(jonahwilliams): The OpenGL Embedder Unittests hang if this code - // runs. - return; - } // On ARM devices, the initial usage of vkCmdCopyBufferToImage has been // observed to take 10s of ms as an internal shader is compiled to perform From 891fc4be8700af3f9077b6303e2601d3eb3b0900 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 24 Apr 2024 13:16:54 -0700 Subject: [PATCH 3/4] Update content_context.cc --- impeller/entity/contents/content_context.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/impeller/entity/contents/content_context.cc b/impeller/entity/contents/content_context.cc index a96c72eee0fa7..452270a18d849 100644 --- a/impeller/entity/contents/content_context.cc +++ b/impeller/entity/contents/content_context.cc @@ -581,7 +581,6 @@ void ContentContext::InitializeCommonlyUsedShadersIfNeeded() const { TRACE_EVENT0("flutter", "InitializeCommonlyUsedShadersIfNeeded"); GetContext()->InitializeCommonlyUsedShadersIfNeeded(); - // On ARM devices, the initial usage of vkCmdCopyBufferToImage has been // observed to take 10s of ms as an internal shader is compiled to perform // the operation. Similarly, the initial render pass can also take 10s of ms From 7fc24ef08b381574b4bb2857bc3f7872feeb1213 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Wed, 24 Apr 2024 15:31:10 -0700 Subject: [PATCH 4/4] Update content_context.cc --- impeller/entity/contents/content_context.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/impeller/entity/contents/content_context.cc b/impeller/entity/contents/content_context.cc index 452270a18d849..5761fbbcf429b 100644 --- a/impeller/entity/contents/content_context.cc +++ b/impeller/entity/contents/content_context.cc @@ -281,9 +281,6 @@ ContentContext::ContentContext( checkerboard_pipelines_.CreateDefault(*context_, options); #endif // IMPELLER_DEBUG - // These pipelines are created first since they are immediately used by - // InitializeCommonlyUsedShadersIfNeeded. Their order matches the order in - // InitializeCommonlyUsedShadersIfNeeded. { solid_fill_pipelines_.CreateDefault(*context_, options); texture_pipelines_.CreateDefault(*context_, options);