From 8d7e8608b36956046d4bc1d41049d589ea648156 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Sun, 30 Mar 2025 17:18:20 -0700 Subject: [PATCH] [Impeller] fix min filter for GL external textures. (#166224) Fixes https://github.com/flutter/flutter/issues/165976 Pass through sampler options for oes external textures. --- .../src/flutter/impeller/entity/contents/texture_contents.cc | 4 ++++ .../impeller/entity/contents/tiled_texture_contents.cc | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/engine/src/flutter/impeller/entity/contents/texture_contents.cc b/engine/src/flutter/impeller/entity/contents/texture_contents.cc index 3e370cdc9d..62c0aef805 100644 --- a/engine/src/flutter/impeller/entity/contents/texture_contents.cc +++ b/engine/src/flutter/impeller/entity/contents/texture_contents.cc @@ -208,6 +208,10 @@ bool TextureContents::Render(const ContentContext& renderer, // coordinates. sampler_desc.width_address_mode = SamplerAddressMode::kClampToEdge; sampler_desc.height_address_mode = SamplerAddressMode::kClampToEdge; + sampler_desc.min_filter = sampler_descriptor_.min_filter; + sampler_desc.mag_filter = sampler_descriptor_.mag_filter; + sampler_desc.mip_filter = MipFilter::kBase; + FSExternal::BindSAMPLEREXTERNALOESTextureSampler( pass, texture_, renderer.GetContext()->GetSamplerLibrary()->GetSampler(sampler_desc)); diff --git a/engine/src/flutter/impeller/entity/contents/tiled_texture_contents.cc b/engine/src/flutter/impeller/entity/contents/tiled_texture_contents.cc index a75fd57cf2..75263102ad 100644 --- a/engine/src/flutter/impeller/entity/contents/tiled_texture_contents.cc +++ b/engine/src/flutter/impeller/entity/contents/tiled_texture_contents.cc @@ -5,6 +5,7 @@ #include "impeller/entity/contents/tiled_texture_contents.h" #include "fml/logging.h" +#include "impeller/core/formats.h" #include "impeller/entity/contents/content_context.h" #include "impeller/entity/tiled_texture_fill.frag.h" #include "impeller/entity/tiled_texture_fill_external.frag.h" @@ -159,6 +160,10 @@ bool TiledTextureContents::Render(const ContentContext& renderer, // coordinates. sampler_desc.width_address_mode = SamplerAddressMode::kClampToEdge; sampler_desc.height_address_mode = SamplerAddressMode::kClampToEdge; + sampler_desc.min_filter = sampler_descriptor_.min_filter; + sampler_desc.mag_filter = sampler_descriptor_.mag_filter; + sampler_desc.mip_filter = MipFilter::kBase; + FSExternal::BindSAMPLEREXTERNALOESTextureSampler( pass, texture_, renderer.GetContext()->GetSamplerLibrary()->GetSampler(