@@ -40,24 +40,34 @@ std::unique_ptr<Surface> SurfaceGLES::WrapFBO(
4040 color0.load_action = LoadAction::kClear ;
4141 color0.store_action = StoreAction::kStore ;
4242
43- TextureDescriptor stencil0_tex ;
44- stencil0_tex .type = TextureType::kTexture2D ;
45- stencil0_tex .format = color_format;
46- stencil0_tex .size = fbo_size;
47- stencil0_tex .usage =
43+ TextureDescriptor depth_stencil_texture_desc ;
44+ depth_stencil_texture_desc .type = TextureType::kTexture2D ;
45+ depth_stencil_texture_desc .format = color_format;
46+ depth_stencil_texture_desc .size = fbo_size;
47+ depth_stencil_texture_desc .usage =
4848 static_cast <TextureUsageMask>(TextureUsage::kRenderTarget );
49- stencil0_tex.sample_count = SampleCount::kCount1 ;
49+ depth_stencil_texture_desc.sample_count = SampleCount::kCount1 ;
50+
51+ auto depth_stencil_tex = std::make_shared<TextureGLES>(
52+ gl_context.GetReactor (), depth_stencil_texture_desc,
53+ TextureGLES::IsWrapped::kWrapped );
54+
55+ DepthAttachment depth0;
56+ depth0.clear_depth = 0 ;
57+ depth0.texture = depth_stencil_tex;
58+ depth0.load_action = LoadAction::kClear ;
59+ depth0.store_action = StoreAction::kDontCare ;
5060
5161 StencilAttachment stencil0;
5262 stencil0.clear_stencil = 0 ;
53- stencil0.texture = std::make_shared<TextureGLES>(
54- gl_context.GetReactor (), stencil0_tex, TextureGLES::IsWrapped::kWrapped );
63+ stencil0.texture = depth_stencil_tex;
5564 stencil0.load_action = LoadAction::kClear ;
5665 stencil0.store_action = StoreAction::kDontCare ;
5766
5867 RenderTarget render_target_desc;
5968
6069 render_target_desc.SetColorAttachment (color0, 0u );
70+ render_target_desc.SetDepthAttachment (depth0);
6171 render_target_desc.SetStencilAttachment (stencil0);
6272
6373#ifdef IMPELLER_DEBUG
0 commit comments