glamor: Replace "finish access" shader with texture swizzling.

For pictures without alpha, and for most other formats for GLES2, we
would make a temporary FBO, make another temporary texture, upload our
GLAMOR_MEMORY pixmap to the texture, then run the "finish access" shader
across it to swizzle its values around into the temporary FBO (which we
would use for a single Render operation and then throw away).

We can simplify everything by using GL_ARB_texture_swizzle (or its
GLES3 counterpart).  It's just not worth the complexity to try to
improve the performance of this already low-performance path (SHM
pixmaps + Render) on GLES2.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Eric Anholt 2016-02-01 13:58:14 -08:00 • committed by Adam Jackson
commit 0b4c0c75d0
5 changed files with 160 additions and 407 deletions

View file

@ -605,9 +605,15 @@ glamor_init(ScreenPtr screen, unsigned int flags)
glamor_priv->max_fbo_size = MAX_FBO_SIZE;
#endif
glamor_priv->has_texture_swizzle =
(epoxy_has_gl_extension("GL_ARB_texture_swizzle") ||
(glamor_priv->gl_flavor != GLAMOR_GL_DESKTOP && gl_version >= 30));
glamor_priv->one_channel_format = GL_ALPHA;
if (epoxy_has_gl_extension("GL_ARB_texture_rg") && epoxy_has_gl_extension("GL_ARB_texture_swizzle"))
if (epoxy_has_gl_extension("GL_ARB_texture_rg") &&
glamor_priv->has_texture_swizzle) {
glamor_priv->one_channel_format = GL_RED;
}
glamor_set_debug_level(&glamor_debug_level);
@ -668,7 +674,6 @@ glamor_init(ScreenPtr screen, unsigned int flags)
glamor_init_vbo(screen);
glamor_init_pixmap_fbo(screen);
glamor_init_finish_access_shaders(screen);
#ifdef GLAMOR_GRADIENT_SHADER
glamor_init_gradient_shader(screen);