cogl: Remove legacy OpenGL driver support
This means the two Cogl drivers left are OpenGL >= 3.1 and GLES >= 2.0. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2672>
This commit is contained in:
parent
e5195c08a4
commit
b2579750a7
@ -283,7 +283,6 @@ static const struct {
|
|||||||
CoglDriver driver_id;
|
CoglDriver driver_id;
|
||||||
} all_known_drivers[] = {
|
} all_known_drivers[] = {
|
||||||
{ "gl3", "OpenGL 3.2 core profile", COGL_DRIVER_GL3 },
|
{ "gl3", "OpenGL 3.2 core profile", COGL_DRIVER_GL3 },
|
||||||
{ "gl", "OpenGL legacy profile", COGL_DRIVER_GL },
|
|
||||||
{ "gles2", "OpenGL ES 2.0", COGL_DRIVER_GLES2 },
|
{ "gles2", "OpenGL ES 2.0", COGL_DRIVER_GLES2 },
|
||||||
{ "any", "Default Cogl driver", COGL_DRIVER_ANY },
|
{ "any", "Default Cogl driver", COGL_DRIVER_ANY },
|
||||||
};
|
};
|
||||||
|
@ -65,15 +65,13 @@ _cogl_feature_check (CoglRenderer *renderer,
|
|||||||
case COGL_DRIVER_ANY:
|
case COGL_DRIVER_ANY:
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
case COGL_DRIVER_NOP:
|
case COGL_DRIVER_NOP:
|
||||||
case COGL_DRIVER_GL:
|
|
||||||
case COGL_DRIVER_GL3:
|
case COGL_DRIVER_GL3:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* First check whether the functions should be directly provided by
|
/* First check whether the functions should be directly provided by
|
||||||
GL */
|
GL */
|
||||||
if (((driver == COGL_DRIVER_GL ||
|
if ((driver == COGL_DRIVER_GL3 &&
|
||||||
driver == COGL_DRIVER_GL3) &&
|
|
||||||
COGL_CHECK_GL_VERSION (gl_major, gl_minor,
|
COGL_CHECK_GL_VERSION (gl_major, gl_minor,
|
||||||
data->min_gl_major, data->min_gl_minor)) ||
|
data->min_gl_major, data->min_gl_minor)) ||
|
||||||
(data->gles_availability & gles_availability))
|
(data->gles_availability & gles_availability))
|
||||||
|
@ -88,15 +88,6 @@ typedef struct _CoglDriverDescription
|
|||||||
static CoglDriverDescription _cogl_drivers[] =
|
static CoglDriverDescription _cogl_drivers[] =
|
||||||
{
|
{
|
||||||
#ifdef HAVE_COGL_GL
|
#ifdef HAVE_COGL_GL
|
||||||
{
|
|
||||||
COGL_DRIVER_GL,
|
|
||||||
"gl",
|
|
||||||
{ COGL_PRIVATE_FEATURE_ANY_GL,
|
|
||||||
-1 },
|
|
||||||
&_cogl_driver_gl,
|
|
||||||
&_cogl_texture_driver_gl,
|
|
||||||
COGL_GL_LIBNAME,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
COGL_DRIVER_GL3,
|
COGL_DRIVER_GL3,
|
||||||
"gl3",
|
"gl3",
|
||||||
@ -344,8 +335,6 @@ driver_id_to_name (CoglDriver id)
|
|||||||
{
|
{
|
||||||
switch (id)
|
switch (id)
|
||||||
{
|
{
|
||||||
case COGL_DRIVER_GL:
|
|
||||||
return "gl";
|
|
||||||
case COGL_DRIVER_GL3:
|
case COGL_DRIVER_GL3:
|
||||||
return "gl3";
|
return "gl3";
|
||||||
case COGL_DRIVER_GLES2:
|
case COGL_DRIVER_GLES2:
|
||||||
|
@ -292,7 +292,6 @@ cogl_renderer_remove_constraint (CoglRenderer *renderer,
|
|||||||
* CoglDriver:
|
* CoglDriver:
|
||||||
* @COGL_DRIVER_ANY: Implies no preference for which driver is used
|
* @COGL_DRIVER_ANY: Implies no preference for which driver is used
|
||||||
* @COGL_DRIVER_NOP: A No-Op driver.
|
* @COGL_DRIVER_NOP: A No-Op driver.
|
||||||
* @COGL_DRIVER_GL: An OpenGL driver.
|
|
||||||
* @COGL_DRIVER_GL3: An OpenGL driver using the core GL 3.1 profile
|
* @COGL_DRIVER_GL3: An OpenGL driver using the core GL 3.1 profile
|
||||||
* @COGL_DRIVER_GLES2: An OpenGL ES 2.0 driver.
|
* @COGL_DRIVER_GLES2: An OpenGL ES 2.0 driver.
|
||||||
*
|
*
|
||||||
@ -303,7 +302,6 @@ typedef enum
|
|||||||
{
|
{
|
||||||
COGL_DRIVER_ANY,
|
COGL_DRIVER_ANY,
|
||||||
COGL_DRIVER_NOP,
|
COGL_DRIVER_NOP,
|
||||||
COGL_DRIVER_GL,
|
|
||||||
COGL_DRIVER_GL3,
|
COGL_DRIVER_GL3,
|
||||||
COGL_DRIVER_GLES2,
|
COGL_DRIVER_GLES2,
|
||||||
} CoglDriver;
|
} CoglDriver;
|
||||||
|
@ -456,20 +456,6 @@ get_max_activateable_texture_units (void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_COGL_GL
|
|
||||||
if (ctx->driver == COGL_DRIVER_GL)
|
|
||||||
{
|
|
||||||
/* GL_MAX_TEXTURE_UNITS defines the number of units that are
|
|
||||||
usable from the fixed function pipeline, therefore it isn't
|
|
||||||
available in GLES2. These are also tied to the number of
|
|
||||||
texture coordinates that can be uploaded so it should be less
|
|
||||||
than that available from the shader extensions */
|
|
||||||
GE (ctx, glGetIntegerv (GL_MAX_TEXTURE_UNITS,
|
|
||||||
values + n_values++));
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
g_assert (n_values <= G_N_ELEMENTS (values) &&
|
g_assert (n_values <= G_N_ELEMENTS (values) &&
|
||||||
n_values > 0);
|
n_values > 0);
|
||||||
|
|
||||||
|
@ -64,19 +64,8 @@ _cogl_driver_gl_real_context_init (CoglContext *context)
|
|||||||
context->glBindVertexArray (vertex_array);
|
context->glBindVertexArray (vertex_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* As far as I can tell, GL_POINT_SPRITE doesn't have any effect
|
|
||||||
unless GL_COORD_REPLACE is enabled for an individual layer.
|
|
||||||
Therefore it seems like it should be ok to just leave it enabled
|
|
||||||
all the time instead of having to have a set property on each
|
|
||||||
pipeline to track whether any layers have point sprite coords
|
|
||||||
enabled. We don't need to do this for GL3 or GLES2 because point
|
|
||||||
sprites are handled using a builtin varying in the shader. */
|
|
||||||
if (context->driver == COGL_DRIVER_GL)
|
|
||||||
GE (context, glEnable (GL_POINT_SPRITE));
|
|
||||||
|
|
||||||
/* There's no enable for this in GLES2, it's always on */
|
/* There's no enable for this in GLES2, it's always on */
|
||||||
if (context->driver == COGL_DRIVER_GL ||
|
if (context->driver == COGL_DRIVER_GL3)
|
||||||
context->driver == COGL_DRIVER_GL3)
|
|
||||||
GE (context, glEnable (GL_PROGRAM_POINT_SIZE) );
|
GE (context, glEnable (GL_PROGRAM_POINT_SIZE) );
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -518,13 +507,6 @@ _cogl_driver_update_features (CoglContext *ctx,
|
|||||||
COGL_FLAGS_SET (private_features,
|
COGL_FLAGS_SET (private_features,
|
||||||
COGL_PRIVATE_FEATURE_TEXTURE_SWIZZLE, TRUE);
|
COGL_PRIVATE_FEATURE_TEXTURE_SWIZZLE, TRUE);
|
||||||
|
|
||||||
if (ctx->driver == COGL_DRIVER_GL)
|
|
||||||
{
|
|
||||||
/* Features which are not available in GL 3 */
|
|
||||||
COGL_FLAGS_SET (private_features,
|
|
||||||
COGL_PRIVATE_FEATURE_ALPHA_TEXTURES, TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
COGL_FLAGS_SET (private_features,
|
COGL_FLAGS_SET (private_features,
|
||||||
COGL_PRIVATE_FEATURE_READ_PIXELS_ANY_STRIDE, TRUE);
|
COGL_PRIVATE_FEATURE_READ_PIXELS_ANY_STRIDE, TRUE);
|
||||||
COGL_FLAGS_SET (private_features, COGL_PRIVATE_FEATURE_ANY_GL, TRUE);
|
COGL_FLAGS_SET (private_features, COGL_PRIVATE_FEATURE_ANY_GL, TRUE);
|
||||||
@ -568,8 +550,7 @@ _cogl_driver_update_features (CoglContext *ctx,
|
|||||||
|
|
||||||
g_strfreev (gl_extensions);
|
g_strfreev (gl_extensions);
|
||||||
|
|
||||||
if (!COGL_FLAGS_GET (private_features, COGL_PRIVATE_FEATURE_ALPHA_TEXTURES) &&
|
if (!COGL_FLAGS_GET (private_features, COGL_PRIVATE_FEATURE_TEXTURE_SWIZZLE))
|
||||||
!COGL_FLAGS_GET (private_features, COGL_PRIVATE_FEATURE_TEXTURE_SWIZZLE))
|
|
||||||
{
|
{
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
COGL_DRIVER_ERROR,
|
COGL_DRIVER_ERROR,
|
||||||
|
@ -137,8 +137,7 @@ _cogl_winsys_renderer_disconnect (CoglRenderer *renderer)
|
|||||||
static void
|
static void
|
||||||
_cogl_winsys_renderer_bind_api (CoglRenderer *renderer)
|
_cogl_winsys_renderer_bind_api (CoglRenderer *renderer)
|
||||||
{
|
{
|
||||||
if (renderer->driver == COGL_DRIVER_GL ||
|
if (renderer->driver == COGL_DRIVER_GL3)
|
||||||
renderer->driver == COGL_DRIVER_GL3)
|
|
||||||
eglBindAPI (EGL_OPENGL_API);
|
eglBindAPI (EGL_OPENGL_API);
|
||||||
else if (renderer->driver == COGL_DRIVER_GLES2)
|
else if (renderer->driver == COGL_DRIVER_GLES2)
|
||||||
eglBindAPI (EGL_OPENGL_ES_API);
|
eglBindAPI (EGL_OPENGL_ES_API);
|
||||||
@ -162,7 +161,7 @@ check_egl_extensions (CoglRenderer *renderer)
|
|||||||
for (i = 0; i < G_N_ELEMENTS (winsys_feature_data); i++)
|
for (i = 0; i < G_N_ELEMENTS (winsys_feature_data); i++)
|
||||||
if (_cogl_feature_check (renderer,
|
if (_cogl_feature_check (renderer,
|
||||||
"EGL", winsys_feature_data + i, 0, 0,
|
"EGL", winsys_feature_data + i, 0, 0,
|
||||||
COGL_DRIVER_GL, /* the driver isn't used */
|
COGL_DRIVER_GL3, /* the driver isn't used */
|
||||||
split_extensions,
|
split_extensions,
|
||||||
egl_renderer))
|
egl_renderer))
|
||||||
{
|
{
|
||||||
@ -241,8 +240,7 @@ cogl_display_egl_determine_attributes (CoglDisplay *display,
|
|||||||
attributes[i++] = EGL_DONT_CARE;
|
attributes[i++] = EGL_DONT_CARE;
|
||||||
|
|
||||||
attributes[i++] = EGL_RENDERABLE_TYPE;
|
attributes[i++] = EGL_RENDERABLE_TYPE;
|
||||||
attributes[i++] = ((renderer->driver == COGL_DRIVER_GL ||
|
attributes[i++] = (renderer->driver == COGL_DRIVER_GL3 ?
|
||||||
renderer->driver == COGL_DRIVER_GL3) ?
|
|
||||||
EGL_OPENGL_BIT :
|
EGL_OPENGL_BIT :
|
||||||
EGL_OPENGL_ES2_BIT);
|
EGL_OPENGL_ES2_BIT);
|
||||||
|
|
||||||
|
@ -356,7 +356,7 @@ update_base_winsys_features (CoglRenderer *renderer)
|
|||||||
"GLX", winsys_feature_data + i,
|
"GLX", winsys_feature_data + i,
|
||||||
glx_renderer->glx_major,
|
glx_renderer->glx_major,
|
||||||
glx_renderer->glx_minor,
|
glx_renderer->glx_minor,
|
||||||
COGL_DRIVER_GL, /* the driver isn't used */
|
COGL_DRIVER_GL3, /* the driver isn't used */
|
||||||
split_extensions,
|
split_extensions,
|
||||||
glx_renderer))
|
glx_renderer))
|
||||||
{
|
{
|
||||||
@ -402,8 +402,7 @@ _cogl_winsys_renderer_connect (CoglRenderer *renderer,
|
|||||||
if (!_cogl_xlib_renderer_connect (renderer, error))
|
if (!_cogl_xlib_renderer_connect (renderer, error))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (renderer->driver != COGL_DRIVER_GL &&
|
if (renderer->driver != COGL_DRIVER_GL3)
|
||||||
renderer->driver != COGL_DRIVER_GL3)
|
|
||||||
{
|
{
|
||||||
g_set_error_literal (error, COGL_WINSYS_ERROR,
|
g_set_error_literal (error, COGL_WINSYS_ERROR,
|
||||||
COGL_WINSYS_ERROR_INIT,
|
COGL_WINSYS_ERROR_INIT,
|
||||||
|
@ -64,7 +64,6 @@ get_x11_cogl_winsys_vtable (CoglRenderer *renderer)
|
|||||||
#else
|
#else
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case COGL_DRIVER_GL:
|
|
||||||
case COGL_DRIVER_GL3:
|
case COGL_DRIVER_GL3:
|
||||||
#ifdef COGL_HAS_GLX_SUPPORT
|
#ifdef COGL_HAS_GLX_SUPPORT
|
||||||
return _cogl_winsys_glx_get_vtable ();
|
return _cogl_winsys_glx_get_vtable ();
|
||||||
|
@ -179,13 +179,6 @@ check_gl_extensions (void)
|
|||||||
|
|
||||||
return arb_sync && x11_sync_object;
|
return arb_sync && x11_sync_object;
|
||||||
}
|
}
|
||||||
case COGL_DRIVER_GL:
|
|
||||||
{
|
|
||||||
const char *extensions = meta_gl_get_string (GL_EXTENSIONS);
|
|
||||||
return (extensions != NULL &&
|
|
||||||
strstr (extensions, "GL_ARB_sync") != NULL &&
|
|
||||||
strstr (extensions, "GL_EXT_x11_sync_object") != NULL);
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -19,12 +19,12 @@ cogl_tests = [
|
|||||||
[ 'test-journal', [] ],
|
[ 'test-journal', [] ],
|
||||||
[ 'test-primitive', [] ],
|
[ 'test-primitive', [] ],
|
||||||
[ 'test-sparse-pipeline', [] ],
|
[ 'test-sparse-pipeline', [] ],
|
||||||
[ 'test-read-texture-formats', ['gl', 'gl3'] ],
|
[ 'test-read-texture-formats', ['gl3'] ],
|
||||||
[ 'test-write-texture-formats', [] ],
|
[ 'test-write-texture-formats', [] ],
|
||||||
[ 'test-point-size', [] ],
|
[ 'test-point-size', [] ],
|
||||||
[ 'test-point-size-attribute', [] ],
|
[ 'test-point-size-attribute', [] ],
|
||||||
[ 'test-point-sprite', [] ],
|
[ 'test-point-sprite', [] ],
|
||||||
[ 'test-point-sprite-known-failure', ['gl', 'gl3', 'gles2'] ],
|
[ 'test-point-sprite-known-failure', ['gl3', 'gles2'] ],
|
||||||
[ 'test-no-gl-header', [] ],
|
[ 'test-no-gl-header', [] ],
|
||||||
[ 'test-layer-remove', [] ],
|
[ 'test-layer-remove', [] ],
|
||||||
[ 'test-alpha-test', [] ],
|
[ 'test-alpha-test', [] ],
|
||||||
@ -72,7 +72,7 @@ test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
|
|||||||
test_env.set('G_ENABLE_DIAGNOSTIC', '0')
|
test_env.set('G_ENABLE_DIAGNOSTIC', '0')
|
||||||
test_env.set('MUTTER_TEST_PLUGIN_PATH', '@0@'.format(default_plugin.full_path()))
|
test_env.set('MUTTER_TEST_PLUGIN_PATH', '@0@'.format(default_plugin.full_path()))
|
||||||
|
|
||||||
cogl_test_variants = [ 'gl', 'gl3', 'gles2' ]
|
cogl_test_variants = [ 'gl3', 'gles2' ]
|
||||||
|
|
||||||
foreach cogl_test: cogl_tests
|
foreach cogl_test: cogl_tests
|
||||||
test_case = cogl_test[0]
|
test_case = cogl_test[0]
|
||||||
|
@ -15,8 +15,7 @@ test_framebuffer_get_bits (void)
|
|||||||
|
|
||||||
renderer = cogl_context_get_renderer (test_ctx);
|
renderer = cogl_context_get_renderer (test_ctx);
|
||||||
|
|
||||||
if (cogl_renderer_get_driver (renderer) != COGL_DRIVER_GL &&
|
if (cogl_renderer_get_driver (renderer) != COGL_DRIVER_GL3)
|
||||||
cogl_renderer_get_driver (renderer) != COGL_DRIVER_GL3)
|
|
||||||
{
|
{
|
||||||
g_test_skip ("Test requires OpenGL");
|
g_test_skip ("Test requires OpenGL");
|
||||||
return;
|
return;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
all_variants = ['gl', 'gl3', 'gles2']
|
all_variants = ['gl3', 'gles2']
|
||||||
any_variant = ['any']
|
any_variant = ['any']
|
||||||
|
|
||||||
cogl_unit_tests = [
|
cogl_unit_tests = [
|
||||||
|
Loading…
Reference in New Issue
Block a user