mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-26 21:12:25 +00:00
glamor: Drop a bunch of GLES2 ifdefs.
Now that we're using epoxy, we can write code using both desktop and
ES symbols and decide what to use at runtime.
v2: Fix a spelling mistake (latter), since the lines were moved
anyway (noticed by Rémi Cardona). Fix condition invert in
glamor_set_composite_texture (caught by Michel Dänzer).
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Keith Packard <keithp@keithp.com> (v1)
Reviewed-by: Adam Jackson <ajax@redhat.com> (v1)
This commit is contained in:
parent
c3c8a5f360
commit
9553020b71
5 changed files with 62 additions and 63 deletions
|
|
@ -301,26 +301,29 @@ glamor_init(ScreenPtr screen, unsigned int flags)
|
|||
goto fail;;
|
||||
}
|
||||
|
||||
if (epoxy_is_desktop_gl())
|
||||
glamor_priv->gl_flavor = GLAMOR_GL_DESKTOP;
|
||||
else
|
||||
glamor_priv->gl_flavor = GLAMOR_GL_ES2;
|
||||
|
||||
gl_version = glamor_gl_get_version();
|
||||
|
||||
#ifndef GLAMOR_GLES2
|
||||
if (gl_version < GLAMOR_GL_VERSION_ENCODE(1, 3)) {
|
||||
ErrorF("Require OpenGL version 1.3 or latter.\n");
|
||||
goto fail;
|
||||
}
|
||||
#else
|
||||
if (gl_version < GLAMOR_GL_VERSION_ENCODE(2, 0)) {
|
||||
ErrorF("Require Open GLES2.0 or latter.\n");
|
||||
goto fail;
|
||||
}
|
||||
#endif
|
||||
if (glamor_priv->gl_flavor == GLAMOR_GL_DESKTOP) {
|
||||
if (gl_version < GLAMOR_GL_VERSION_ENCODE(1, 3)) {
|
||||
ErrorF("Require OpenGL version 1.3 or later.\n");
|
||||
goto fail;
|
||||
}
|
||||
} else {
|
||||
if (gl_version < GLAMOR_GL_VERSION_ENCODE(2, 0)) {
|
||||
ErrorF("Require Open GLES2.0 or later.\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
#ifdef GLAMOR_GLES2
|
||||
if (!glamor_gl_has_extension("GL_EXT_texture_format_BGRA8888")) {
|
||||
ErrorF("GL_EXT_texture_format_BGRA8888 required\n");
|
||||
goto fail;
|
||||
if (!glamor_gl_has_extension("GL_EXT_texture_format_BGRA8888")) {
|
||||
ErrorF("GL_EXT_texture_format_BGRA8888 required\n");
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
glamor_priv->has_pack_invert =
|
||||
glamor_gl_has_extension("GL_MESA_pack_invert");
|
||||
|
|
@ -333,11 +336,6 @@ glamor_init(ScreenPtr screen, unsigned int flags)
|
|||
|
||||
glamor_set_debug_level(&glamor_debug_level);
|
||||
|
||||
#ifdef GLAMOR_GLES2
|
||||
glamor_priv->gl_flavor = GLAMOR_GL_ES2;
|
||||
#else
|
||||
glamor_priv->gl_flavor = GLAMOR_GL_DESKTOP;
|
||||
#endif
|
||||
/* If we are using egl screen, call egl screen init to
|
||||
* register correct close screen function. */
|
||||
if (flags & GLAMOR_USE_EGL_SCREEN) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue