Skip to content

Commit c62bbc1

Browse files
authored
Fix linux on vivante drivers. (flutter/engine#56862)
The same problem with NVIDIA drivers which causes issue [152099](flutter#152099) occurs with Vivante Corporation drivers. Quick fix for issue on Vivante drivers: flutter#152099 - [ x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ x] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. - [ x] I listed at least one issue that this PR fixes in the description above. - [ x] I added new tests to check the change I am making or feature I am adding, or the PR is [test-exempt]. See [testing the engine] for instructions on writing and running engine tests. - [ x] I updated/added relevant documentation (doc comments with `///`). - [ x] I signed the [CLA]. - [ x] All existing and new tests are passing. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent a7db4d6 commit c62bbc1

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

engine/src/flutter/shell/platform/linux/fl_renderer.cc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ static gboolean is_nvidia() {
8989
return strstr(vendor, "NVIDIA") != nullptr;
9090
}
9191

92+
// Check if running on an Vivante Corporation driver.
93+
static gboolean is_vivante() {
94+
const gchar* vendor = reinterpret_cast<const gchar*>(glGetString(GL_VENDOR));
95+
return strstr(vendor, "Vivante Corporation") != nullptr;
96+
}
97+
9298
// Returns the log for the given OpenGL shader. Must be freed by the caller.
9399
static gchar* get_shader_log(GLuint shader) {
94100
GLint log_length;
@@ -568,11 +574,12 @@ void fl_renderer_setup(FlRenderer* self) {
568574

569575
g_return_if_fail(FL_IS_RENDERER(self));
570576

571-
// Note: NVIDIA is temporarily disabled due to
577+
// Note: NVIDIA and Vivante are temporarily disabled due to
572578
// https://github.com/flutter/flutter/issues/152099
573579
priv->has_gl_framebuffer_blit =
574-
!is_nvidia() && (epoxy_gl_version() >= 30 ||
575-
epoxy_has_gl_extension("GL_EXT_framebuffer_blit"));
580+
!is_nvidia() && !is_vivante() &&
581+
(epoxy_gl_version() >= 30 ||
582+
epoxy_has_gl_extension("GL_EXT_framebuffer_blit"));
576583

577584
if (!priv->has_gl_framebuffer_blit) {
578585
setup_shader(self);

0 commit comments

Comments
 (0)