Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 9495a52

Browse files
authored
On iOS, try to use ES3, then fall back to ES2. (#5006)
1 parent d6d4eec commit 9495a52

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎shell/platform/darwin/ios/ios_gl_context.mm‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,21 @@
1414

1515
IOSGLContext::IOSGLContext(fml::scoped_nsobject<CAEAGLLayer> layer)
1616
: layer_(std::move(layer)),
17-
context_([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]),
18-
resource_context_([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2
19-
sharegroup:context_.get().sharegroup]),
2017
framebuffer_(GL_NONE),
2118
colorbuffer_(GL_NONE),
2219
storage_size_width_(0),
2320
storage_size_height_(0),
2421
valid_(false) {
22+
context_.reset([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3]);
23+
if (context_ != nullptr) {
24+
resource_context_.reset([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3
25+
sharegroup:context_.get().sharegroup]);
26+
} else {
27+
context_.reset([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]);
28+
resource_context_.reset([[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2
29+
sharegroup:context_.get().sharegroup]);
30+
}
31+
2532
FXL_DCHECK(layer_ != nullptr);
2633
FXL_DCHECK(context_ != nullptr);
2734
FXL_DCHECK(resource_context_ != nullptr);

0 commit comments

Comments
 (0)