Skip to content

Commit 6dcaa9f

Browse files
author
minggo
authored
do not use ES3 context if using multi sample (#17778)
multi sample in ES3 needs to use GLES3 function
1 parent a3cb7de commit 6dcaa9f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cocos/platform/ios/CCES2Renderer-ios.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,17 @@ - (id) initWithDepthFormat:(unsigned int)depthFormat withPixelFormat:(unsigned i
5555
{
5656
if (! sharegroup)
5757
{
58-
context_ = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
58+
// multisampling conflict with GLES3, refer to https://github.com/cocos2d/cocos2d-x/issues/17767
59+
if (!multiSampling)
60+
context_ = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3];
5961
if (! context_)
6062
context_ = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
6163
}
6264
else
6365
{
64-
context_ = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3 sharegroup:sharegroup];
66+
// multisampling conflict with GLES3, refer to https://github.com/cocos2d/cocos2d-x/issues/17767
67+
if (!multiSampling)
68+
context_ = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3 sharegroup:sharegroup];
6569
if (!context_)
6670
context_ = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2 sharegroup:sharegroup];
6771
}

0 commit comments

Comments
 (0)