From b31020b193db24e175bce077755c2f3e814e57ff Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Wed, 26 Jul 2017 01:42:19 +0200 Subject: vo_opengl: check against shmem limits The radius check was not strict enough, especially not for all platforms. To fix this, actually check the hardware capabilities instead of relying on a hard-coded maximum radius. --- video/out/opengl/video_shaders.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'video/out/opengl/video_shaders.c') diff --git a/video/out/opengl/video_shaders.c b/video/out/opengl/video_shaders.c index 854c829f1d..c0ca40b48e 100644 --- a/video/out/opengl/video_shaders.c +++ b/video/out/opengl/video_shaders.c @@ -217,18 +217,13 @@ void pass_sample_polar(struct gl_shader_cache *sc, struct scaler *scaler, GLSLF("}\n"); } +// bw/bh: block size +// iw/ih: input size (pre-calculated to fit all required texels) void pass_compute_polar(struct gl_shader_cache *sc, struct scaler *scaler, - int components, int bw, int bh, float ratiox, - float ratioy) + int components, int bw, int bh, int iw, int ih) { int bound = ceil(scaler->kernel->radius_cutoff); int offset = bound - 1; // padding top/left - int padding = offset + bound; // total padding - - // We need to sample everything from base_min to base_max, so make sure - // we have enough space to fit all relevant texels in shmem - int iw = (int)ceil(bw / ratiox) + padding + 1, - ih = (int)ceil(bh / ratioy) + padding + 1; GLSL(color = vec4(0.0);) GLSLF("{\n"); -- cgit v1.2.3