From e03c75bac760ebd24036f8c7d009b3080c64743d Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 9 Apr 2020 13:06:28 -0400 Subject: [PATCH] cogl: Add a slot for driver-private state to CoglContext https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1194 --- cogl/cogl/cogl-context-private.h | 2 ++ cogl/cogl/driver/gl/cogl-util-gl-private.h | 5 +++++ cogl/cogl/driver/gl/cogl-util-gl.c | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/cogl/cogl/cogl-context-private.h b/cogl/cogl/cogl-context-private.h index a2ed950d0..594b80c30 100644 --- a/cogl/cogl/cogl-context-private.h +++ b/cogl/cogl/cogl-context-private.h @@ -73,6 +73,8 @@ struct _CoglContext const CoglDriverVtable *driver_vtable; const CoglTextureDriver *texture_driver; + void *driver_context; + int glsl_major; int glsl_minor; diff --git a/cogl/cogl/driver/gl/cogl-util-gl-private.h b/cogl/cogl/driver/gl/cogl-util-gl-private.h index 369baab87..fb3f8534c 100644 --- a/cogl/cogl/driver/gl/cogl-util-gl-private.h +++ b/cogl/cogl/driver/gl/cogl-util-gl-private.h @@ -76,6 +76,11 @@ _cogl_gl_error_to_string (GLenum error_code); #endif /* COGL_GL_DEBUG */ +typedef struct _CoglGLContext CoglGLContext; /* opaque for the moment */ + +CoglGLContext * +_cogl_driver_gl_context (CoglContext *context); + gboolean _cogl_driver_gl_context_init (CoglContext *context); diff --git a/cogl/cogl/driver/gl/cogl-util-gl.c b/cogl/cogl/driver/gl/cogl-util-gl.c index 52ad54076..afd6d3a8a 100644 --- a/cogl/cogl/driver/gl/cogl-util-gl.c +++ b/cogl/cogl/driver/gl/cogl-util-gl.c @@ -75,6 +75,12 @@ _cogl_gl_error_to_string (GLenum error_code) } #endif /* COGL_GL_DEBUG */ +CoglGLContext * +_cogl_driver_gl_context (CoglContext *context) +{ + return context->driver_context; +} + gboolean _cogl_driver_gl_context_init (CoglContext *context) {