[mutter/wip/nielsdg/add-yuv-support: 23/23] WIP



commit 1fd5e9bb0bb27da8ca8e497751fb260016d380e9
Author: Niels De Graef <niels degraef barco com>
Date:   Mon Jun 24 15:05:15 2019 +0200

    WIP

 cogl/cogl/driver/gl/gles/cogl-driver-gles.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c
index 26607e096..562bcbe24 100644
--- a/cogl/cogl/driver/gl/gles/cogl-driver-gles.c
+++ b/cogl/cogl/driver/gl/gles/cogl-driver-gles.c
@@ -87,10 +87,17 @@ _cogl_driver_pixel_format_to_gl (CoglContext     *context,
       gltype = GL_UNSIGNED_BYTE;
       break;
 
-    /* GLES doesn't have GL_RED, so use GL_ALPHA and use a swizzle later */
     case COGL_PIXEL_FORMAT_R_8:
-      glintformat = GL_ALPHA;
-      glformat = GL_ALPHA;
+      if (cogl_has_feature (context, COGL_FEATURE_ID_TEXTURE_RG))
+        {
+          glintformat = GL_RED;
+          glformat = GL_R8;
+        }
+      else
+        {
+          glintformat = GL_LUMINANCE;
+          glformat = GL_LUMINANCE;
+        }
       gltype = GL_UNSIGNED_BYTE;
       break;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]