diff options
author | Philip Langdale <philipl@overt.org> | 2021-12-17 15:55:55 -0800 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2021-12-19 01:51:54 +0100 |
commit | fd63bf398af14c95ee7df18815dc3c9d1b4d9b49 (patch) | |
tree | e3da78ba264bdb4a2bca721b9d27da6aab10a423 /video/out/gpu/video.c | |
parent | c8b6dc489baf21b3945fabfb069be884c53e138a (diff) | |
download | mpv-fd63bf398af14c95ee7df18815dc3c9d1b4d9b49.tar.bz2 mpv-fd63bf398af14c95ee7df18815dc3c9d1b4d9b49.tar.xz |
vo_gpu: stop hard-coding max compute group threads
We've been assuming that maximum number of compute group threads is
never less than the 1024 defined by the desktop GL spec. Given that we
haven't had working compute shaders for GLES and I guess the Vulkan
spec defines at least as high a value, we've gotten away with it so
far.
But we should really look the value up and respect it.
Diffstat (limited to 'video/out/gpu/video.c')
-rw-r--r-- | video/out/gpu/video.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/video/out/gpu/video.c b/video/out/gpu/video.c index 035619891b..841cf36db4 100644 --- a/video/out/gpu/video.c +++ b/video/out/gpu/video.c @@ -2698,12 +2698,9 @@ static void pass_dither(struct gl_video *p) struct image img = image_wrap(p->error_diffusion_tex[0], PLANE_RGB, p->components); - // Ensure the block size doesn't exceed the minimum defined by the - // specification (1024 in desktop GL, 128 in GLES). - // TODO: Look up the actual maximum block size for the - // implementation using: - // glGetIntegerv(MAX_COMPUTE_WORK_GROUP_INVOCATIONS, &value); - int block_size = MPMIN(p->ra->glsl_es ? 128 : 1024, o_h); + // Ensure the block size doesn't exceed the maximum of the + // implementation. + int block_size = MPMIN(p->ra->max_compute_group_threads, o_h); pass_describe(p, "dither=error-diffusion (kernel=%s, depth=%d)", kernel->name, dst_depth); |