Skip to content

Commit 529d0d6

Browse files
author
Jonah Williams
authored
[Impeller] use ES3 extension for external images. (flutter/engine#57018)
The shader language level is 300 or more we need to use GL_OES_EGL_image_external_essl3 instead of GL_OES_EGL_image_external
1 parent 15af0c4 commit 529d0d6

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

engine/src/flutter/impeller/compiler/compiler.cc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
namespace impeller {
2727
namespace compiler {
2828

29+
namespace {
30+
constexpr const char* kEGLImageExternalExtension = "GL_OES_EGL_image_external";
31+
constexpr const char* kEGLImageExternalExtension300 =
32+
"GL_OES_EGL_image_external_essl3";
33+
} // namespace
34+
2935
static uint32_t ParseMSLVersion(const std::string& msl_version) {
3036
std::stringstream sstream(msl_version);
3137
std::string version_part;
@@ -147,7 +153,11 @@ static CompilerBackend CreateGLSLCompiler(const spirv_cross::ParsedIR& ir,
147153
// incompatible with ES 310+.
148154
for (auto& id : ir.ids_for_constant_or_variable) {
149155
if (StringStartsWith(ir.get_name(id), kExternalTexturePrefix)) {
150-
gl_compiler->require_extension("GL_OES_EGL_image_external");
156+
if (source_options.gles_language_version >= 300) {
157+
gl_compiler->require_extension(kEGLImageExternalExtension300);
158+
} else {
159+
gl_compiler->require_extension(kEGLImageExternalExtension);
160+
}
151161
break;
152162
}
153163
}

0 commit comments

Comments
 (0)