summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/video_shaders.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-11-19 21:20:40 +0100
committerwm4 <wm4@nowhere>2015-11-19 21:20:40 +0100
commit1a8b06f67e8063f687bfc251440235c86b7bdcb7 (patch)
tree14387335facf7da57bf8538e8a3d9ebf341f98fe /video/out/opengl/video_shaders.c
parent92d06f43fa1ee1a39d4b97849d11ca8e68d01813 (diff)
downloadmpv-1a8b06f67e8063f687bfc251440235c86b7bdcb7.tar.bz2
mpv-1a8b06f67e8063f687bfc251440235c86b7bdcb7.tar.xz
vo_opengl: make 1D textures completely optional
Polar scalers use 1D textures, because they're slightly faster on some GPUs than 2D textures. But 2D textures work too, so add support for them. Allows using these scalers with ANGLE.
Diffstat (limited to 'video/out/opengl/video_shaders.c')
-rw-r--r--video/out/opengl/video_shaders.c6
1 files changed, 5 insertions, 1 deletions
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;)