Skip to content

Commit bf4d90a

Browse files
author
Jonah Williams
authored
[Android] choose 24 bit depth buffer. (flutter/engine#56553)
Fixes flutter#158531 Make sure the onscreen framebuffer has a depth attachment that matches the depth24_s8 format expected.
1 parent 01054ec commit bf4d90a

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

engine/src/flutter/impeller/toolkit/egl/config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ enum class StencilBits {
3535
enum class DepthBits {
3636
kZero = 0,
3737
kEight = 8,
38+
kTwentyFour = 24,
3839
};
3940

4041
enum class SurfaceType {

engine/src/flutter/shell/platform/android/android_context_gl_impeller.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ AndroidContextGLImpeller::AndroidContextGLImpeller(
9494
impeller::egl::ConfigDescriptor desc;
9595
desc.api = impeller::egl::API::kOpenGLES2;
9696
desc.color_format = impeller::egl::ColorFormat::kRGBA8888;
97-
desc.depth_bits = impeller::egl::DepthBits::kZero;
97+
desc.depth_bits = impeller::egl::DepthBits::kTwentyFour;
9898
desc.stencil_bits = impeller::egl::StencilBits::kEight;
9999
desc.samples = impeller::egl::Samples::kFour;
100100

engine/src/flutter/shell/platform/android/android_context_gl_impeller_unittests.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ bool GetEGLConfigForSurface(EGLint surface_bit, EGLConfig* result) {
3838
EGL_GREEN_SIZE, 8,
3939
EGL_BLUE_SIZE, 8,
4040
EGL_ALPHA_SIZE, 8,
41+
EGL_DEPTH_SIZE, 24,
42+
EGL_STENCIL_SIZE, 8,
4143
EGL_NONE,
4244
// clang-format on
4345
};

0 commit comments

Comments
 (0)