fix:xr video player bug (#14121)

* fix:xr video player compatibility on some devices
shader compile error

* fix:release video player framebuffer
This commit is contained in:
oahc09
2023-02-02 13:36:32 +08:00
committed by GitHub
parent b26d1bda2a
commit d4eb7ea881
2 changed files with 3 additions and 2 deletions
@@ -145,10 +145,10 @@ public class CocosXRGLHelper {
+ "precision mediump float; \n"
+ "in vec2 texCoord; \n"
+ "uniform samplerExternalOES texSampler2D; \n"
+ "out vec4 gl_FragColor;\n"
+ "out vec4 frag_color;\n"
+ "void main() \n"
+ "{ \n"
+ " gl_FragColor = texture(texSampler2D, texCoord); \n"
+ " frag_color = texture(texSampler2D, texCoord); \n"
+ "}";
float[] orthoQuadVertices = {
-1.0f, -1.0f, 0.0f, 1.0f,
@@ -421,6 +421,7 @@ public class CocosXRVideoManager {
for (Map.Entry<String, CocosXRVideoPlayer> entrySet : entrySets) {
entrySet.getValue().onGLDestroy();
}
GLES30.glDeleteFramebuffers(1, new int[] {renderTargetFboId}, 0);
EGL14.eglMakeCurrent(eglDisplay, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_CONTEXT);
EGL14.eglDestroySurface(eglDisplay, pBufferSurface);
EGL14.eglDestroyContext(eglDisplay, eglContext);