summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--video/out/opengl/video.c5
-rw-r--r--video/out/opengl/video_shaders.c6
2 files changed, 6 insertions, 5 deletions
diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c
index 9bc3c61f6c..f7ca9d79d4 100644
--- a/video/out/opengl/video.c
+++ b/video/out/opengl/video.c
@@ -1041,7 +1041,7 @@ static void reinit_scaler(struct gl_video *p, struct scaler *scaler,
scaler->insufficient = !mp_init_filter(scaler->kernel, sizes, scale_factor);
- if (scaler->kernel->polar) {
+ if (scaler->kernel->polar && (gl->mpgl_caps & MPGL_CAP_1D_TEX)) {
scaler->gl_target = GL_TEXTURE_1D;
} else {
scaler->gl_target = GL_TEXTURE_2D;
@@ -2355,7 +2355,6 @@ static void check_gl_features(struct gl_video *p)
GL *gl = p->gl;
bool have_float_tex = gl->mpgl_caps & MPGL_CAP_FLOAT_TEX;
bool have_fbo = gl->mpgl_caps & MPGL_CAP_FB;
- bool have_1d_tex = gl->mpgl_caps & MPGL_CAP_1D_TEX;
bool have_3d_tex = gl->mpgl_caps & MPGL_CAP_3D_TEX;
bool have_mix = gl->glsl_version >= 130;
bool have_texrg = gl->mpgl_caps & MPGL_CAP_TEX_RG;
@@ -2400,8 +2399,6 @@ static void check_gl_features(struct gl_video *p)
char *reason = NULL;
if (!have_float_tex)
reason = "(float tex. missing)";
- if (!have_1d_tex && kernel->polar)
- reason = "(1D tex. missing)";
if (reason) {
p->opts.scaler[n].kernel.name = "bilinear";
MP_WARN(p, "Disabling scaler #%d %s.\n", n, reason);
diff --git a/video/out/opengl/video_shaders.c b/video/out/opengl/video_shaders.c
index 162a66efe2..3af200b87c 100644
--- a/video/out/opengl/video_shaders.c
+++ b/video/out/opengl/video_shaders.c
@@ -141,7 +141,11 @@ void pass_sample_polar(struct gl_shader_cache *sc, struct scaler *scaler)
// Check for samples that might be skippable
if (dmax >= radius - 1)
GLSLF("if (d < 1.0) {\n");
- GLSL(w = texture1D(lut, d).r;)
+ if (scaler->gl_target == GL_TEXTURE_1D) {
+ GLSL(w = texture1D(lut, d).r;)
+ } else {
+ GLSL(w = texture(lut, vec2(0.5, d)).r;)
+ }
GLSL(wsum += w;)
GLSLF("c = texture(tex, base + pt * vec2(%d.0, %d.0));\n", x, y);
GLSL(color += vec4(w) * c;)