[Android] choose 24 bit depth buffer. (flutter/engine#56553)

Fixes https://github.com/flutter/flutter/issues/158531

Make sure the onscreen framebuffer has a depth attachment that matches the depth24_s8 format expected.
This commit is contained in:
Jonah Williams
2024-11-13 18:28:05 -08:00
committed by GitHub
parent 01054ec5ff
commit bf4d90a46b
3 changed files with 4 additions and 1 deletions

View File

@@ -35,6 +35,7 @@ enum class StencilBits {
enum class DepthBits {
kZero = 0,
kEight = 8,
kTwentyFour = 24,
};
enum class SurfaceType {

View File

@@ -94,7 +94,7 @@ AndroidContextGLImpeller::AndroidContextGLImpeller(
impeller::egl::ConfigDescriptor desc;
desc.api = impeller::egl::API::kOpenGLES2;
desc.color_format = impeller::egl::ColorFormat::kRGBA8888;
desc.depth_bits = impeller::egl::DepthBits::kZero;
desc.depth_bits = impeller::egl::DepthBits::kTwentyFour;
desc.stencil_bits = impeller::egl::StencilBits::kEight;
desc.samples = impeller::egl::Samples::kFour;

View File

@@ -38,6 +38,8 @@ bool GetEGLConfigForSurface(EGLint surface_bit, EGLConfig* result) {
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 8,
EGL_DEPTH_SIZE, 24,
EGL_STENCIL_SIZE, 8,
EGL_NONE,
// clang-format on
};