-
Notifications
You must be signed in to change notification settings - Fork 6k
[impeller] enable framebuffer blit when available #56596
Changes from all commits
7b2ac98
49fd421
4b3781a
0f91725
2bf0e96
671c3b5
bd255e4
e84ce6d
b6adb29
d2fb626
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,7 @@ AndroidContextGLImpeller::AndroidContextGLImpeller( | |
} | ||
|
||
impeller::egl::ConfigDescriptor desc; | ||
desc.api = impeller::egl::API::kOpenGLES2; | ||
desc.api = impeller::egl::API::kOpenGLES3; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this valid to do? Defiintely outside of my wheelhouse. - we do a lot of GLES 2 stuff, do we need to worry about GLES 3 having different semantics? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope. That's how you'd do it. ES3 is backwards compatible with the same sematics. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Coolio |
||
desc.color_format = impeller::egl::ColorFormat::kRGBA8888; | ||
desc.depth_bits = impeller::egl::DepthBits::kTwentyFour; | ||
desc.stencil_bits = impeller::egl::StencilBits::kEight; | ||
|
@@ -101,6 +101,12 @@ AndroidContextGLImpeller::AndroidContextGLImpeller( | |
desc.surface_type = impeller::egl::SurfaceType::kWindow; | ||
std::unique_ptr<impeller::egl::Config> onscreen_config = | ||
display_->ChooseConfig(desc); | ||
|
||
if (!onscreen_config) { | ||
desc.api = impeller::egl::API::kOpenGLES2; | ||
onscreen_config = display_->ChooseConfig(desc); | ||
} | ||
|
||
if (!onscreen_config) { | ||
// Fallback for Android emulator. | ||
desc.samples = impeller::egl::Samples::kOne; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,28 +97,38 @@ TEST_F(AndroidContextGLImpellerTest, FallbackForEmulator) { | |
auto display = std::make_unique<MockDisplay>(); | ||
EXPECT_CALL(*display, IsValid).WillRepeatedly(Return(true)); | ||
std::unique_ptr<Config> first_result; | ||
auto second_result = | ||
std::make_unique<Config>(ConfigDescriptor(), window_egl_config); | ||
std::unique_ptr<Config> second_result; | ||
auto third_result = | ||
std::make_unique<Config>(ConfigDescriptor(), window_egl_config); | ||
auto fourth_result = | ||
std::make_unique<Config>(ConfigDescriptor(), pbuffer_egl_config); | ||
EXPECT_CALL( | ||
*display, | ||
ChooseConfig(Matcher<ConfigDescriptor>(AllOf( | ||
Field(&ConfigDescriptor::api, impeller::egl::API::kOpenGLES3), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jonahwilliams looks like we could have used these tests for asserting we are asking for a depth buffer. It had been a while since I looked at these. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought I did that by adding EGL_DEPTH_SIZE 24 above? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤷♂️ |
||
Field(&ConfigDescriptor::samples, impeller::egl::Samples::kFour), | ||
Field(&ConfigDescriptor::surface_type, | ||
impeller::egl::SurfaceType::kWindow))))) | ||
.WillOnce(Return(ByMove(std::move(first_result)))); | ||
EXPECT_CALL( | ||
*display, | ||
ChooseConfig(Matcher<ConfigDescriptor>(AllOf( | ||
Field(&ConfigDescriptor::api, impeller::egl::API::kOpenGLES2), | ||
Field(&ConfigDescriptor::samples, impeller::egl::Samples::kFour), | ||
Field(&ConfigDescriptor::surface_type, | ||
impeller::egl::SurfaceType::kWindow))))) | ||
.WillOnce(Return(ByMove(std::move(second_result)))); | ||
EXPECT_CALL( | ||
*display, | ||
ChooseConfig(Matcher<ConfigDescriptor>( | ||
AllOf(Field(&ConfigDescriptor::samples, impeller::egl::Samples::kOne), | ||
Field(&ConfigDescriptor::surface_type, | ||
impeller::egl::SurfaceType::kWindow))))) | ||
.WillOnce(Return(ByMove(std::move(second_result)))); | ||
.WillOnce(Return(ByMove(std::move(third_result)))); | ||
EXPECT_CALL(*display, ChooseConfig(Matcher<ConfigDescriptor>( | ||
Field(&ConfigDescriptor::surface_type, | ||
impeller::egl::SurfaceType::kPBuffer)))) | ||
.WillOnce(Return(ByMove(std::move(third_result)))); | ||
.WillOnce(Return(ByMove(std::move(fourth_result)))); | ||
ON_CALL(*display, ChooseConfig(_)) | ||
.WillByDefault(Return(ByMove(std::unique_ptr<Config>()))); | ||
auto context = | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Completely off topic, but we should do a GL version check in ProcTableGLES and reset or not bother to resolve FOR_EACH_IMPELLER_GLES3_PROC methods when we less than ES 3. On older versions of Android, I remember seeing instances where we'd get a function pointer for ES3 functions even on ES2 contexts but those wouldn't work if called.
When I first wrote that bit, I didn't think we'd ever resolve ES3 procs. So its a blind spot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, absolutely agree. I can file an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flutter/flutter#158995