[Impeller] Set color attachment pixel format to RGBA on OpenGLES backend (flutter/engine#37843)
This commit is contained in:
@@ -142,4 +142,9 @@ const BackendFeatures& ContextGLES::GetBackendFeatures() const {
|
||||
return kLegacyBackendFeatures;
|
||||
}
|
||||
|
||||
// |Context|
|
||||
PixelFormat ContextGLES::GetColorAttachmentPixelFormat() const {
|
||||
return PixelFormat::kR8G8B8A8UNormInt;
|
||||
}
|
||||
|
||||
} // namespace impeller
|
||||
|
||||
@@ -76,6 +76,9 @@ class ContextGLES final : public Context,
|
||||
// |Context|
|
||||
const BackendFeatures& GetBackendFeatures() const override;
|
||||
|
||||
// |Context|
|
||||
PixelFormat GetColorAttachmentPixelFormat() const override;
|
||||
|
||||
FML_DISALLOW_COPY_AND_ASSIGN(ContextGLES);
|
||||
};
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ RenderTarget RenderTarget::CreateOffscreen(const Context& context,
|
||||
|
||||
TextureDescriptor color_tex0;
|
||||
color_tex0.storage_mode = color_storage_mode;
|
||||
color_tex0.format = PixelFormat::kDefaultColor;
|
||||
color_tex0.format = context.GetColorAttachmentPixelFormat();
|
||||
color_tex0.size = size;
|
||||
color_tex0.usage = static_cast<uint64_t>(TextureUsage::kRenderTarget) |
|
||||
static_cast<uint64_t>(TextureUsage::kShaderRead);
|
||||
@@ -257,7 +257,7 @@ RenderTarget RenderTarget::CreateOffscreenMSAA(
|
||||
color0_tex_desc.storage_mode = color_storage_mode;
|
||||
color0_tex_desc.type = TextureType::kTexture2DMultisample;
|
||||
color0_tex_desc.sample_count = SampleCount::kCount4;
|
||||
color0_tex_desc.format = PixelFormat::kDefaultColor;
|
||||
color0_tex_desc.format = context.GetColorAttachmentPixelFormat();
|
||||
color0_tex_desc.size = size;
|
||||
color0_tex_desc.usage = static_cast<uint64_t>(TextureUsage::kRenderTarget);
|
||||
|
||||
@@ -274,7 +274,7 @@ RenderTarget RenderTarget::CreateOffscreenMSAA(
|
||||
|
||||
TextureDescriptor color0_resolve_tex_desc;
|
||||
color0_resolve_tex_desc.storage_mode = color_resolve_storage_mode;
|
||||
color0_resolve_tex_desc.format = PixelFormat::kDefaultColor;
|
||||
color0_resolve_tex_desc.format = context.GetColorAttachmentPixelFormat();
|
||||
color0_resolve_tex_desc.size = size;
|
||||
color0_resolve_tex_desc.usage =
|
||||
static_cast<uint64_t>(TextureUsage::kRenderTarget) |
|
||||
|
||||
Reference in New Issue
Block a user