summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/error_diffusion.c
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2021-12-11 19:28:46 -0800
committerPhilip Langdale <github.philipl@overt.org>2021-12-12 20:23:31 -0800
commit584ab29c88d6c5ffa03666bffbbc93e4f0740f67 (patch)
treefd5db4e42bfdd3cb217cdca82494de8b3fff9b6e /video/out/gpu/error_diffusion.c
parent2fc327f2fdd48f0cd58a4d4382a7aa57f3fabd77 (diff)
downloadmpv-584ab29c88d6c5ffa03666bffbbc93e4f0740f67.tar.bz2
mpv-584ab29c88d6c5ffa03666bffbbc93e4f0740f67.tar.xz
vo_gpu: opengl: some fixes to make compute shaders work with GLES
It's supposed to work with GLES >= 3.1 but we had all sorts of bad assumptions in our version handling, and then our compute shaders turn out not to be GLSL-ES compliant. This change contains some necessary, but insufficient, tweaks to the shaders. Perhaps we'll make it actually work some day.
Diffstat (limited to 'video/out/gpu/error_diffusion.c')
-rw-r--r--video/out/gpu/error_diffusion.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/video/out/gpu/error_diffusion.c b/video/out/gpu/error_diffusion.c
index 88c0903d35..c1ea542c86 100644
--- a/video/out/gpu/error_diffusion.c
+++ b/video/out/gpu/error_diffusion.c
@@ -110,7 +110,7 @@ void pass_error_diffusion(struct gl_shader_cache *sc,
// Initialize the ring buffer.
GLSL("for (int i = int(gl_LocalInvocationIndex); i < %d; i += %d) ",
ring_buffer_size, block_size);
- GLSL("err_rgb8[i] = 0;\n");
+ GLSL("err_rgb8[i] = 0u;\n");
GLSL("for (int block_id = 0; block_id < %d; ++block_id) {\n", blocks);
@@ -170,7 +170,7 @@ void pass_error_diffusion(struct gl_shader_cache *sc,
"int((err_u32 >> %d) & 255u) - 128,"
"int( err_u32 & 255u) - 128"
") / %d.0;\n", dither_quant, bitshift_r, bitshift_g, uint8_mul);
- GLSL("err_rgb8[idx] = 0;\n");
+ GLSL("err_rgb8[idx] = 0u;\n");
// Write the dithered pixel.
GLSL("vec3 dithered = round(pix);\n");