Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit c617409

Browse files
[Impeller] Remove additional shader bootstrap. (#52368)
Because these shaders must first acquire the prototype shader, it causes ContentContext creation to block. We can re-explore dealing with PSO generation in a different manner that isn't on the startup fast path. flutter/flutter#143540
1 parent ddfb67b commit c617409

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

impeller/entity/contents/content_context.cc

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,6 @@ ContentContext::ContentContext(
271271
checkerboard_pipelines_.CreateDefault(*context_, options);
272272
#endif // IMPELLER_DEBUG
273273

274-
// These pipelines are created first since they are immediately used by
275-
// InitializeCommonlyUsedShadersIfNeeded. Their order matches the order in
276-
// InitializeCommonlyUsedShadersIfNeeded.
277274
{
278275
solid_fill_pipelines_.CreateDefault(*context_, options);
279276
texture_pipelines_.CreateDefault(*context_, options);
@@ -571,48 +568,6 @@ void ContentContext::InitializeCommonlyUsedShadersIfNeeded() const {
571568
TRACE_EVENT0("flutter", "InitializeCommonlyUsedShadersIfNeeded");
572569
GetContext()->InitializeCommonlyUsedShadersIfNeeded();
573570

574-
if (GetContext()->GetBackendType() == Context::BackendType::kOpenGLES) {
575-
// TODO(jonahwilliams): The OpenGL Embedder Unittests hang if this code
576-
// runs.
577-
return;
578-
}
579-
580-
// Initialize commonly used shaders that aren't defaults. These settings were
581-
// chosen based on the knowledge that we mix and match triangle and
582-
// triangle-strip geometry, and also have fairly agressive srcOver to src
583-
// blend mode conversions.
584-
auto options = ContentContextOptions{
585-
.sample_count = SampleCount::kCount4,
586-
.color_attachment_pixel_format =
587-
context_->GetCapabilities()->GetDefaultColorFormat()};
588-
589-
// Note: When editing this, check the order the default pipelines are created.
590-
// These should be first.
591-
for (const auto mode : {BlendMode::kSource, BlendMode::kSourceOver}) {
592-
for (const auto geometry :
593-
{PrimitiveType::kTriangle, PrimitiveType::kTriangleStrip}) {
594-
options.blend_mode = mode;
595-
options.primitive_type = geometry;
596-
CreateIfNeeded(solid_fill_pipelines_, options);
597-
CreateIfNeeded(texture_pipelines_, options);
598-
if (GetContext()->GetCapabilities()->SupportsSSBO()) {
599-
CreateIfNeeded(linear_gradient_ssbo_fill_pipelines_, options);
600-
CreateIfNeeded(radial_gradient_ssbo_fill_pipelines_, options);
601-
CreateIfNeeded(sweep_gradient_ssbo_fill_pipelines_, options);
602-
CreateIfNeeded(conical_gradient_ssbo_fill_pipelines_, options);
603-
}
604-
}
605-
}
606-
607-
options.blend_mode = BlendMode::kDestination;
608-
options.primitive_type = PrimitiveType::kTriangleStrip;
609-
for (const auto stencil_mode :
610-
{ContentContextOptions::StencilMode::kOverdrawPreventionIncrement,
611-
ContentContextOptions::StencilMode::kOverdrawPreventionRestore}) {
612-
options.stencil_mode = stencil_mode;
613-
CreateIfNeeded(clip_pipelines_, options);
614-
}
615-
616571
// On ARM devices, the initial usage of vkCmdCopyBufferToImage has been
617572
// observed to take 10s of ms as an internal shader is compiled to perform
618573
// the operation. Similarly, the initial render pass can also take 10s of ms

0 commit comments

Comments
 (0)