glamor: Require GL_OES_texture_border_clamp for GLES2.
The extension came out in 2000, and all Mesa-supported hardware that can do glamor supports it. We were already relying on the ARB version being present on desktop. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
7a5ddf8da5
commit
117d614d1b
|
@ -515,6 +515,10 @@ glamor_init(ScreenPtr screen, unsigned int flags)
|
||||||
|
|
||||||
gl_version = epoxy_gl_version();
|
gl_version = epoxy_gl_version();
|
||||||
|
|
||||||
|
/* assume a core profile if we are GL 3.1 and don't have ARB_compatibility */
|
||||||
|
glamor_priv->is_core_profile =
|
||||||
|
gl_version >= 31 && !epoxy_has_gl_extension("GL_ARB_compatibility");
|
||||||
|
|
||||||
shading_version_string = (char *) glGetString(GL_SHADING_LANGUAGE_VERSION);
|
shading_version_string = (char *) glGetString(GL_SHADING_LANGUAGE_VERSION);
|
||||||
|
|
||||||
if (!shading_version_string) {
|
if (!shading_version_string) {
|
||||||
|
@ -569,6 +573,12 @@ glamor_init(ScreenPtr screen, unsigned int flags)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!glamor_priv->is_core_profile &&
|
||||||
|
!epoxy_has_gl_extension("GL_ARB_texture_border_clamp")) {
|
||||||
|
ErrorF("GL_ARB_texture_border_clamp required\n");
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
if (!glamor_check_instruction_count(gl_version))
|
if (!glamor_check_instruction_count(gl_version))
|
||||||
goto fail;
|
goto fail;
|
||||||
} else {
|
} else {
|
||||||
|
@ -581,6 +591,11 @@ glamor_init(ScreenPtr screen, unsigned int flags)
|
||||||
ErrorF("GL_EXT_texture_format_BGRA8888 required\n");
|
ErrorF("GL_EXT_texture_format_BGRA8888 required\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!epoxy_has_gl_extension("GL_OES_texture_border_clamp")) {
|
||||||
|
ErrorF("GL_OES_texture_border_clamp required\n");
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
glamor_priv->has_rw_pbo = FALSE;
|
glamor_priv->has_rw_pbo = FALSE;
|
||||||
|
@ -612,10 +627,6 @@ glamor_init(ScreenPtr screen, unsigned int flags)
|
||||||
glamor_priv->has_dual_blend =
|
glamor_priv->has_dual_blend =
|
||||||
epoxy_has_gl_extension("GL_ARB_blend_func_extended");
|
epoxy_has_gl_extension("GL_ARB_blend_func_extended");
|
||||||
|
|
||||||
/* assume a core profile if we are GL 3.1 and don't have ARB_compatibility */
|
|
||||||
glamor_priv->is_core_profile =
|
|
||||||
gl_version >= 31 && !epoxy_has_gl_extension("GL_ARB_compatibility");
|
|
||||||
|
|
||||||
glamor_priv->can_copyplane = (gl_version >= 30);
|
glamor_priv->can_copyplane = (gl_version >= 30);
|
||||||
|
|
||||||
glamor_setup_debug_output(screen);
|
glamor_setup_debug_output(screen);
|
||||||
|
|
|
@ -533,16 +533,8 @@ glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit,
|
||||||
repeat_type = picture->repeatType;
|
repeat_type = picture->repeatType;
|
||||||
switch (picture->repeatType) {
|
switch (picture->repeatType) {
|
||||||
case RepeatNone:
|
case RepeatNone:
|
||||||
if (glamor_priv->gl_flavor != GLAMOR_GL_ES2) {
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
|
||||||
/* XXX GLES2 doesn't support GL_CLAMP_TO_BORDER. */
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,
|
|
||||||
GL_CLAMP_TO_BORDER);
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,
|
|
||||||
GL_CLAMP_TO_BORDER);
|
|
||||||
} else {
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case RepeatNormal:
|
case RepeatNormal:
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||||
|
@ -573,12 +565,12 @@ glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* Handle RepeatNone in the shader when the source is missing the
|
||||||
* GLES2 doesn't support RepeatNone. We need to fix it anyway.
|
* alpha channel, as GL will return an alpha for 1 if the texture
|
||||||
*
|
* is RGB (no alpha), which we use for 16bpp textures.
|
||||||
**/
|
*/
|
||||||
if (glamor_pixmap_priv_is_large(pixmap_priv) ||
|
if (glamor_pixmap_priv_is_large(pixmap_priv) ||
|
||||||
((!PICT_FORMAT_A(picture->format) || glamor_priv->gl_flavor == GLAMOR_GL_ES2) &&
|
(!PICT_FORMAT_A(picture->format) &&
|
||||||
repeat_type == RepeatNone && picture->transform)) {
|
repeat_type == RepeatNone && picture->transform)) {
|
||||||
glamor_pixmap_fbo_fix_wh_ratio(wh, pixmap, pixmap_priv);
|
glamor_pixmap_fbo_fix_wh_ratio(wh, pixmap, pixmap_priv);
|
||||||
glUniform4fv(wh_location, 1, wh);
|
glUniform4fv(wh_location, 1, wh);
|
||||||
|
|
Loading…
Reference in New Issue