summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-11-19 21:17:45 +0100
committerwm4 <wm4@nowhere>2015-11-19 21:17:45 +0100
commitb86a59aa4f55c809494a2e5058c51d52d3afc2ce (patch)
treee5c5d308370435d97f0b571dc133619b89a6bed3
parent368431f57c16efd19d0eea316341de0717157001 (diff)
downloadmpv-b86a59aa4f55c809494a2e5058c51d52d3afc2ce.tar.bz2
mpv-b86a59aa4f55c809494a2e5058c51d52d3afc2ce.tar.xz
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.
-rw-r--r--video/out/opengl/common.c15
1 files changed, 8 insertions, 7 deletions
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;