Skip to content

Commit 5dd1021

Browse files
gamehelphereminggo
authored andcommitted
Changed shader data types mediump to highp to remove possible sprite joggling on some Android phones. (#19633)
1 parent 42ea50d commit 5dd1021

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cocos/renderer/CCGLProgram.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,9 @@ bool GLProgram::compileShader(GLuint * shader, GLenum type, const GLchar* source
487487
#if CC_TARGET_PLATFORM == CC_PLATFORM_WINRT
488488
headersDef = (type == GL_VERTEX_SHADER ? "precision mediump float;\n precision mediump int;\n" : "precision mediump float;\n precision mediump int;\n");
489489
// Bugfix to make shader variables types constant to be understood by the current Android Virtual Devices or Emulators. This will also eliminate the 0x501 and 0x502 OpenGL Errors during emulation.
490+
// Changed shader data types mediump to highp to remove possible sprite joggling on some Android phones.
490491
#elif CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
491-
headersDef = "#version 100\n precision mediump float;\n precision mediump int;\n";
492+
headersDef = "#version 100\n precision highp float;\n precision highp int;\n";
492493
#elif (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32 && CC_TARGET_PLATFORM != CC_PLATFORM_LINUX && CC_TARGET_PLATFORM != CC_PLATFORM_MAC)
493494
headersDef = (type == GL_VERTEX_SHADER ? "precision highp float;\n precision highp int;\n" : "precision mediump float;\n precision mediump int;\n");
494495
#endif

0 commit comments

Comments
 (0)