From b86a59aa4f55c809494a2e5058c51d52d3afc2ce Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 19 Nov 2015 21:17:45 +0100 Subject: vo_opengl: better check for float texture support We don't only need float textures for advanced scaling - we also need them to be filterable with GL_LINEAR. On GLES, this is not supported until GLES 3.1, but some implementation expose them with extensions. --- video/out/opengl/common.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'video') diff --git a/video/out/opengl/common.c b/video/out/opengl/common.c index 93b20c04ee..09d47d5e1c 100644 --- a/video/out/opengl/common.c +++ b/video/out/opengl/common.c @@ -223,13 +223,6 @@ static const struct gl_functions gl_functions[] = { {0} } }, - // Float textures, extension in GL 2.x, core in GL 3.x core. - { - .ver_core = 300, - .ver_es_core = 300, - .extension = "GL_ARB_texture_float", - .provides = MPGL_CAP_FLOAT_TEX, - }, // GL_RED / GL_RG textures, extension in GL 2.x, core in GL 3.x core. { .ver_core = 300, @@ -486,6 +479,14 @@ void mpgl_load_functions2(GL *gl, void *(*get_fn)(void *ctx, const char *n), mp_verbose(log, "Detected suspected software renderer.\n"); } + // Detect 16F textures that work with GL_LINEAR filtering. + if ((!gl->es && (gl->version >= 300 || check_ext(gl, "GL_ARB_texture_float"))) || + (gl->es && (gl->version >= 310 || check_ext(gl, "GL_OES_texture_half_float_linear")))) + { + mp_verbose(log, "Filterable half-float textures supported.\n"); + gl->mpgl_caps |= MPGL_CAP_FLOAT_TEX; + } + // Provided for simpler handling if no framebuffer support is available. if (!gl->BindFramebuffer) gl->BindFramebuffer = &dummy_glBindFramebuffer; -- cgit v1.2.3