From 023ab80a6708602bf1a0395f75fd59f54826048b Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Fri, 14 Jul 2023 14:17:42 -0700 Subject: [PATCH 1/2] [Impeller] various desktop OpenGL issues. --- impeller/entity/entity_pass.cc | 5 +++-- shell/gpu/gpu_surface_gl_impeller.cc | 3 +-- shell/platform/embedder/embedder.cc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/impeller/entity/entity_pass.cc b/impeller/entity/entity_pass.cc index 19b1a2efd1a33..5a66dbf6ad8b7 100644 --- a/impeller/entity/entity_pass.cc +++ b/impeller/entity/entity_pass.cc @@ -247,7 +247,8 @@ bool EntityPass::Render(ContentContext& renderer, const RenderTarget& render_target) const { auto root_render_target = render_target; - if (root_render_target.GetColorAttachments().empty()) { + if (root_render_target.GetColorAttachments().find(0u) == + root_render_target.GetColorAttachments().end()) { VALIDATION_LOG << "The root RenderTarget must have a color attachment."; return false; } @@ -341,7 +342,7 @@ bool EntityPass::Render(ContentContext& renderer, // The safety check for fetching this color attachment is at the beginning of // this method. - auto color0 = root_render_target.GetColorAttachments().find(0)->second; + auto color0 = root_render_target.GetColorAttachments().find(0u)->second; // If a root stencil was provided by the caller, then verify that it has a // configuration which can be used to render this pass. diff --git a/shell/gpu/gpu_surface_gl_impeller.cc b/shell/gpu/gpu_surface_gl_impeller.cc index 3b6777042eaa7..6c6701036dea0 100644 --- a/shell/gpu/gpu_surface_gl_impeller.cc +++ b/shell/gpu/gpu_surface_gl_impeller.cc @@ -83,11 +83,10 @@ std::unique_ptr GPUSurfaceGLImpeller::AcquireFrame( GLFrameInfo frame_info = {static_cast(size.width()), static_cast(size.height())}; const GLFBOInfo fbo_info = delegate_->GLContextFBO(frame_info); - auto surface = impeller::SurfaceGLES::WrapFBO( impeller_context_, // context swap_callback, // swap_callback - fbo_info.fbo_id, // fbo + 0u, // fbo impeller::PixelFormat::kR8G8B8A8UNormInt, // color_format impeller::ISize{size.width(), size.height()} // fbo_size ); diff --git a/shell/platform/embedder/embedder.cc b/shell/platform/embedder/embedder.cc index 34b874b609a85..5f99ffbc2fddd 100644 --- a/shell/platform/embedder/embedder.cc +++ b/shell/platform/embedder/embedder.cc @@ -999,7 +999,7 @@ MakeRenderTargetFromBackingStoreImpeller( impeller::RenderTarget render_target_desc; - render_target_desc.SetColorAttachment(color0, framebuffer->target); + render_target_desc.SetColorAttachment(color0, 0u); render_target_desc.SetStencilAttachment(stencil0); return std::make_unique( From cc8f91ce31b85dc34f7ffe068d05e2151163d970 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Fri, 14 Jul 2023 14:41:48 -0700 Subject: [PATCH 2/2] Update gpu_surface_gl_impeller.cc --- shell/gpu/gpu_surface_gl_impeller.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/gpu/gpu_surface_gl_impeller.cc b/shell/gpu/gpu_surface_gl_impeller.cc index 6c6701036dea0..8b8c6e81c6650 100644 --- a/shell/gpu/gpu_surface_gl_impeller.cc +++ b/shell/gpu/gpu_surface_gl_impeller.cc @@ -86,7 +86,7 @@ std::unique_ptr GPUSurfaceGLImpeller::AcquireFrame( auto surface = impeller::SurfaceGLES::WrapFBO( impeller_context_, // context swap_callback, // swap_callback - 0u, // fbo + fbo_info.fbo_id, // fbo impeller::PixelFormat::kR8G8B8A8UNormInt, // color_format impeller::ISize{size.width(), size.height()} // fbo_size );