From 3a8097089fa07db9343b6593e87412c4ffc0d5e3 Mon Sep 17 00:00:00 2001 From: littleGnAl Date: Wed, 5 Jun 2024 18:44:36 +0800 Subject: [PATCH] Set GL_UNPACK_ALIGNMENT --- android/src/main/cpp/iris_rtc_rendering_android.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/android/src/main/cpp/iris_rtc_rendering_android.cc b/android/src/main/cpp/iris_rtc_rendering_android.cc index 3b3cea78b..ff4d6e171 100644 --- a/android/src/main/cpp/iris_rtc_rendering_android.cc +++ b/android/src/main/cpp/iris_rtc_rendering_android.cc @@ -117,9 +117,6 @@ class GLContext { == EGL_TRUE; if (!result) { CHECK_GL_ERROR() } - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - CHECK_GL_ERROR() - return result; } @@ -538,6 +535,10 @@ class YUVRendering final : public RenderingOp { glViewport(0, 0, width, height); CHECK_GL_ERROR() + // Ensure that the unpack alignment is set to 1 byte to avoid any alignment issues with YUV data. + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + CHECK_GL_ERROR() + glEnableVertexAttribArray(aPositionLoc_); CHECK_GL_ERROR()