[impeller] use lossy texture compression on iOS (flutter/engine#40520)

[Impeller] use lossy texture compression on iOS for decode images and MSAA resolve textures.
This commit is contained in:
Jonah Williams
2023-03-23 13:29:40 -07:00
committed by GitHub
parent fd235ecd0f
commit 60987522d2
2 changed files with 2 additions and 0 deletions

View File

@@ -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<uint64_t>(TextureUsage::kRenderTarget) |
static_cast<uint64_t>(TextureUsage::kShaderRead);

View File

@@ -269,6 +269,7 @@ sk_sp<DlImage> 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);