diff --git a/impeller/entity/contents/content_context.cc b/impeller/entity/contents/content_context.cc index 2501ef822f053..010caac049458 100644 --- a/impeller/entity/contents/content_context.cc +++ b/impeller/entity/contents/content_context.cc @@ -278,8 +278,6 @@ ContentContext::ContentContext( CreateDefaultPipeline(*context_); texture_pipelines_[default_options_] = CreateDefaultPipeline(*context_); - texture_external_pipelines_[default_options_] = - CreateDefaultPipeline(*context_); position_uv_pipelines_[default_options_] = CreateDefaultPipeline(*context_); tiled_texture_pipelines_[default_options_] = @@ -312,7 +310,13 @@ ContentContext::ContentContext( CreateDefaultPipeline(*context_); porter_duff_blend_pipelines_[default_options_] = CreateDefaultPipeline(*context_); - + // GLES only shader. +#ifdef IMPELLER_ENABLE_OPENGLES + if (GetContext()->GetBackendType() == Context::BackendType::kOpenGLES) { + texture_external_pipelines_[default_options_] = + CreateDefaultPipeline(*context_); + } +#endif // IMPELLER_ENABLE_OPENGLES if (context_->GetCapabilities()->SupportsCompute()) { auto pipeline_desc = PointsComputeShaderPipeline::MakeDefaultPipelineDescriptor(*context_); diff --git a/impeller/entity/contents/content_context.h b/impeller/entity/contents/content_context.h index 549d2b29811de..c7ba78dfd7981 100644 --- a/impeller/entity/contents/content_context.h +++ b/impeller/entity/contents/content_context.h @@ -56,7 +56,6 @@ #include "impeller/entity/sweep_gradient_fill.frag.h" #include "impeller/entity/texture_fill.frag.h" #include "impeller/entity/texture_fill.vert.h" -#include "impeller/entity/texture_fill_external.frag.h" #include "impeller/entity/tiled_texture_fill.frag.h" #include "impeller/entity/uv.comp.h" #include "impeller/entity/vertices.frag.h" @@ -112,6 +111,10 @@ #include "impeller/entity/framebuffer_blend_screen.frag.h" #include "impeller/entity/framebuffer_blend_softlight.frag.h" +#ifdef IMPELLER_ENABLE_OPENGLES +#include "impeller/entity/texture_fill_external.frag.h" +#endif // IMPELLER_ENABLE_OPENGLES + #if IMPELLER_ENABLE_3D #include "impeller/scene/scene_context.h" // nogncheck #endif @@ -151,8 +154,6 @@ using RRectBlurPipeline = using BlendPipeline = RenderPipelineT; using TexturePipeline = RenderPipelineT; -using TextureExternalPipeline = - RenderPipelineT; using PositionUVPipeline = RenderPipelineT; using TiledTexturePipeline = @@ -291,6 +292,11 @@ using FramebufferBlendSoftLightPipeline = using PointsComputeShaderPipeline = ComputePipelineBuilder; using UvComputeShaderPipeline = ComputePipelineBuilder; +#ifdef IMPELLER_ENABLE_OPENGLES +using TextureExternalPipeline = + RenderPipelineT; +#endif // IMPELLER_ENABLE_OPENGLES + /// Pipeline state configuration. /// /// Each unique combination of these options requires a different pipeline state @@ -428,10 +434,14 @@ class ContentContext { return GetPipeline(texture_pipelines_, opts); } +#ifdef IMPELLER_ENABLE_OPENGLES std::shared_ptr> GetTextureExternalPipeline( ContentContextOptions opts) const { + FML_DCHECK(GetContext()->GetBackendType() == + Context::BackendType::kOpenGLES); return GetPipeline(texture_external_pipelines_, opts); } +#endif // IMPELLER_ENABLE_OPENGLES std::shared_ptr> GetPositionUVPipeline( ContentContextOptions opts) const { @@ -757,7 +767,9 @@ class ContentContext { mutable Variants rrect_blur_pipelines_; mutable Variants texture_blend_pipelines_; mutable Variants texture_pipelines_; +#ifdef IMPELLER_ENABLE_OPENGLES mutable Variants texture_external_pipelines_; +#endif // IMPELLER_ENABLE_OPENGLES mutable Variants position_uv_pipelines_; mutable Variants tiled_texture_pipelines_; mutable Variants diff --git a/impeller/entity/contents/texture_contents.cc b/impeller/entity/contents/texture_contents.cc index e224e74eeab60..759f7f24e5a1c 100644 --- a/impeller/entity/contents/texture_contents.cc +++ b/impeller/entity/contents/texture_contents.cc @@ -155,11 +155,16 @@ bool TextureContents::Render(const ContentContext& renderer, } pipeline_options.primitive_type = PrimitiveType::kTriangleStrip; +#ifdef IMPELLER_ENABLE_OPENGLES if (is_external_texture) { cmd.pipeline = renderer.GetTextureExternalPipeline(pipeline_options); } else { cmd.pipeline = renderer.GetTexturePipeline(pipeline_options); } +#else + cmd.pipeline = renderer.GetTexturePipeline(pipeline_options); +#endif // IMPELLER_ENABLE_OPENGLES + cmd.stencil_reference = entity.GetStencilDepth(); cmd.BindVertices(vertex_builder.CreateVertexBuffer(host_buffer)); VS::BindFrameInfo(cmd, host_buffer.EmplaceUniform(frame_info)); diff --git a/impeller/renderer/backend/metal/pipeline_library_mtl.mm b/impeller/renderer/backend/metal/pipeline_library_mtl.mm index a4b56568cf0df..98895ce336ddd 100644 --- a/impeller/renderer/backend/metal/pipeline_library_mtl.mm +++ b/impeller/renderer/backend/metal/pipeline_library_mtl.mm @@ -112,7 +112,8 @@ ^(id _Nullable render_pipeline_state, NSError* _Nullable error) { if (error != nil) { - VALIDATION_LOG << "Could not create render pipeline: " + VALIDATION_LOG << "Could not create render pipeline for " + << descriptor.GetLabel() << " :" << error.localizedDescription.UTF8String; promise->set_value(nullptr); return;