From 60987522d23e0757205f58a8a5590e4a37e7ef88 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Thu, 23 Mar 2023 13:29:40 -0700 Subject: [PATCH] [impeller] use lossy texture compression on iOS (flutter/engine#40520) [Impeller] use lossy texture compression on iOS for decode images and MSAA resolve textures. --- engine/src/flutter/impeller/renderer/render_target.cc | 1 + engine/src/flutter/lib/ui/painting/image_decoder_impeller.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/engine/src/flutter/impeller/renderer/render_target.cc b/engine/src/flutter/impeller/renderer/render_target.cc index aba17fd653..64304f376e 100644 --- a/engine/src/flutter/impeller/renderer/render_target.cc +++ b/engine/src/flutter/impeller/renderer/render_target.cc @@ -297,6 +297,7 @@ RenderTarget RenderTarget::CreateOffscreenMSAA( color_attachment_config.resolve_storage_mode; color0_resolve_tex_desc.format = pixel_format; color0_resolve_tex_desc.size = size; + color0_resolve_tex_desc.compression_type = CompressionType::kLossy; color0_resolve_tex_desc.usage = static_cast(TextureUsage::kRenderTarget) | static_cast(TextureUsage::kShaderRead); diff --git a/engine/src/flutter/lib/ui/painting/image_decoder_impeller.cc b/engine/src/flutter/lib/ui/painting/image_decoder_impeller.cc index 51a651f7fb..223cff5b5a 100644 --- a/engine/src/flutter/lib/ui/painting/image_decoder_impeller.cc +++ b/engine/src/flutter/lib/ui/painting/image_decoder_impeller.cc @@ -269,6 +269,7 @@ sk_sp ImageDecoderImpeller::UploadTextureToPrivate( texture_descriptor.format = pixel_format.value(); texture_descriptor.size = {image_info.width(), image_info.height()}; texture_descriptor.mip_count = texture_descriptor.size.MipCount(); + texture_descriptor.compression_type = impeller::CompressionType::kLossy; auto dest_texture = context->GetResourceAllocator()->CreateTexture(texture_descriptor);