In the embedder Impeller render target, use a multisample texture for the depth buffer only if MSAA is supported (flutter/engine#56444)

Fixes https://github.com/flutter/flutter/issues/158000
This commit is contained in:
Jason Simmons
2024-11-08 07:49:48 -08:00
committed by GitHub
parent fcfdd62005
commit ac0b5ca828

View File

@@ -1183,15 +1183,16 @@ MakeRenderTargetFromBackingStoreImpeller(
}
impeller::TextureDescriptor depth_stencil_texture_desc;
depth_stencil_texture_desc.type =
impeller::TextureType::kTexture2DMultisample;
depth_stencil_texture_desc.format = impeller::PixelFormat::kD24UnormS8Uint;
depth_stencil_texture_desc.size = size;
depth_stencil_texture_desc.usage = static_cast<impeller::TextureUsageMask>(
impeller::TextureUsage::kRenderTarget);
if (implicit_msaa) {
depth_stencil_texture_desc.type =
impeller::TextureType::kTexture2DMultisample;
depth_stencil_texture_desc.sample_count = impeller::SampleCount::kCount4;
} else {
depth_stencil_texture_desc.type = impeller::TextureType::kTexture2D;
depth_stencil_texture_desc.sample_count = impeller::SampleCount::kCount1;
}