[mutter] cogl: Move some GL function pointers from in-gles-core to core



commit d810c0576d407108361f784a9a1d3d8f09c5f398
Author: Adam Jackson <ajax redhat com>
Date:   Thu Oct 17 16:47:15 2019 -0400

    cogl: Move some GL function pointers from in-gles-core to core
    
    Now that we require GLES2 or GL 2.1 these are always available.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/866

 cogl/cogl/driver/gl/gl/cogl-driver-gl.c            | 13 ++----
 cogl/cogl/gl-prototypes/cogl-core-functions.h      | 25 ++++++++++++
 .../gl-prototypes/cogl-in-gles-core-functions.h    | 47 ----------------------
 3 files changed, 29 insertions(+), 56 deletions(-)
---
diff --git a/cogl/cogl/driver/gl/gl/cogl-driver-gl.c b/cogl/cogl/driver/gl/gl/cogl-driver-gl.c
index 4d806e372..4cb133b2a 100644
--- a/cogl/cogl/driver/gl/gl/cogl-driver-gl.c
+++ b/cogl/cogl/driver/gl/gl/cogl-driver-gl.c
@@ -444,15 +444,10 @@ _cogl_driver_update_features (CoglContext *ctx,
   flags |= COGL_FEATURE_POINT_SPRITE;
   COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_POINT_SPRITE, TRUE);
 
-  if (ctx->glGenBuffers)
-    {
-      flags |= (COGL_FEATURE_MAP_BUFFER_FOR_READ |
-                COGL_FEATURE_MAP_BUFFER_FOR_WRITE);
-      COGL_FLAGS_SET (ctx->features,
-                         COGL_FEATURE_ID_MAP_BUFFER_FOR_READ, TRUE);
-      COGL_FLAGS_SET (ctx->features,
-                      COGL_FEATURE_ID_MAP_BUFFER_FOR_WRITE, TRUE);
-    }
+  flags |= (COGL_FEATURE_MAP_BUFFER_FOR_READ |
+            COGL_FEATURE_MAP_BUFFER_FOR_WRITE);
+  COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_MAP_BUFFER_FOR_READ, TRUE);
+  COGL_FLAGS_SET (ctx->features, COGL_FEATURE_ID_MAP_BUFFER_FOR_WRITE, TRUE);
 
   if (ctx->glEGLImageTargetTexture2D)
     COGL_FLAGS_SET (private_features,
diff --git a/cogl/cogl/gl-prototypes/cogl-core-functions.h b/cogl/cogl/gl-prototypes/cogl-core-functions.h
index dee9605f7..2fce643a5 100644
--- a/cogl/cogl/gl-prototypes/cogl-core-functions.h
+++ b/cogl/cogl/gl-prototypes/cogl-core-functions.h
@@ -63,10 +63,25 @@ COGL_EXT_BEGIN (core,
                 COGL_EXT_IN_GLES2,
                 "\0",
                 "\0")
+COGL_EXT_FUNCTION (void, glActiveTexture,
+                   (GLenum                texture))
+COGL_EXT_FUNCTION (void, glBindBuffer,
+                   (GLenum              target,
+                    GLuint              buffer))
 COGL_EXT_FUNCTION (void, glBindTexture,
                    (GLenum target, GLuint texture))
 COGL_EXT_FUNCTION (void, glBlendFunc,
                    (GLenum sfactor, GLenum dfactor))
+COGL_EXT_FUNCTION (void, glBufferData,
+                   (GLenum              target,
+                    GLsizeiptr          size,
+                    const GLvoid               *data,
+                    GLenum              usage))
+COGL_EXT_FUNCTION (void, glBufferSubData,
+                   (GLenum              target,
+                    GLintptr            offset,
+                    GLsizeiptr          size,
+                    const GLvoid               *data))
 COGL_EXT_FUNCTION (void, glClear,
                    (GLbitfield mask))
 COGL_EXT_FUNCTION (void, glClearColor,
@@ -90,6 +105,9 @@ COGL_EXT_FUNCTION (void, glCopyTexSubImage2D,
                     GLint y,
                     GLsizei width,
                     GLsizei height))
+COGL_EXT_FUNCTION (void, glDeleteBuffers,
+                   (GLsizei             n,
+                    const GLuint               *buffers))
 COGL_EXT_FUNCTION (void, glDeleteTextures,
                    (GLsizei n, const GLuint* textures))
 COGL_EXT_FUNCTION (void, glDepthFunc,
@@ -115,8 +133,13 @@ COGL_EXT_FUNCTION (void, glFrontFace,
                    (GLenum mode))
 COGL_EXT_FUNCTION (void, glCullFace,
                    (GLenum mode))
+COGL_EXT_FUNCTION (void, glGenBuffers,
+                   (GLsizei             n,
+                    GLuint             *buffers))
 COGL_EXT_FUNCTION (void, glGenTextures,
                    (GLsizei n, GLuint* textures))
+COGL_EXT_FUNCTION (void, glGetBufferParameteriv,
+                   (GLenum target, GLenum pname, GLint* params))
 COGL_EXT_FUNCTION (GLenum, glGetError,
                    (void))
 COGL_EXT_FUNCTION (void, glGetIntegerv,
@@ -129,6 +152,8 @@ COGL_EXT_FUNCTION (const GLubyte*, glGetString,
                    (GLenum name))
 COGL_EXT_FUNCTION (void, glHint,
                    (GLenum target, GLenum mode))
+COGL_EXT_FUNCTION (GLboolean, glIsBuffer,
+                   (GLuint               buffer))
 COGL_EXT_FUNCTION (GLboolean, glIsTexture,
                    (GLuint texture))
 COGL_EXT_FUNCTION (void, glPixelStorei,
diff --git a/cogl/cogl/gl-prototypes/cogl-in-gles-core-functions.h 
b/cogl/cogl/gl-prototypes/cogl-in-gles-core-functions.h
index 0f41f3b8a..5c07e43f0 100644
--- a/cogl/cogl/gl-prototypes/cogl-in-gles-core-functions.h
+++ b/cogl/cogl/gl-prototypes/cogl-in-gles-core-functions.h
@@ -66,50 +66,3 @@ COGL_EXT_FUNCTION (void, glDepthRangef,
 COGL_EXT_FUNCTION (void, glClearDepthf,
                    (GLclampf depth))
 COGL_EXT_END ()
-
-COGL_EXT_BEGIN (only_in_both_gles_and_gl_1_5,
-                1, 5,
-                COGL_EXT_IN_GLES2,
-                "\0",
-                "\0")
-COGL_EXT_FUNCTION (void, glGetBufferParameteriv,
-                   (GLenum target, GLenum pname, GLint* params))
-COGL_EXT_END ()
-
-COGL_EXT_BEGIN (vbos, 1, 5,
-                COGL_EXT_IN_GLES2,
-                "ARB\0",
-                "vertex_buffer_object\0")
-COGL_EXT_FUNCTION (void, glGenBuffers,
-                   (GLsizei             n,
-                    GLuint             *buffers))
-COGL_EXT_FUNCTION (void, glBindBuffer,
-                   (GLenum              target,
-                    GLuint              buffer))
-COGL_EXT_FUNCTION (void, glBufferData,
-                   (GLenum              target,
-                    GLsizeiptr          size,
-                    const GLvoid               *data,
-                    GLenum              usage))
-COGL_EXT_FUNCTION (void, glBufferSubData,
-                   (GLenum              target,
-                    GLintptr            offset,
-                    GLsizeiptr          size,
-                    const GLvoid               *data))
-COGL_EXT_FUNCTION (void, glDeleteBuffers,
-                   (GLsizei             n,
-                    const GLuint               *buffers))
-COGL_EXT_FUNCTION (GLboolean, glIsBuffer,
-                   (GLuint               buffer))
-COGL_EXT_END ()
-
-/* Available in GL 1.3, the multitexture extension or GLES. These are
-   required */
-COGL_EXT_BEGIN (multitexture_part0, 1, 3,
-                COGL_EXT_IN_GLES2,
-                "ARB\0",
-                "multitexture\0")
-COGL_EXT_FUNCTION (void, glActiveTexture,
-                   (GLenum                texture))
-COGL_EXT_END ()
-


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