From fd63bf398af14c95ee7df18815dc3c9d1b4d9b49 Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Fri, 17 Dec 2021 15:55:55 -0800 Subject: 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. --- video/out/opengl/gl_headers.h | 1 + video/out/opengl/ra_gl.c | 2 ++ 2 files changed, 3 insertions(+) (limited to 'video/out/opengl') diff --git a/video/out/opengl/gl_headers.h b/video/out/opengl/gl_headers.h index ad276b3c7b..5c367185bd 100644 --- a/video/out/opengl/gl_headers.h +++ b/video/out/opengl/gl_headers.h @@ -138,6 +138,7 @@ typedef uint64_t GLuint64; #define GL_COMPUTE_SHADER 0x91B9 #define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 +#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB // --- GL 4.3 or GL_ARB_shader_storage_buffer_object diff --git a/video/out/opengl/ra_gl.c b/video/out/opengl/ra_gl.c index e08f5ed9bf..8eddb5fabc 100644 --- a/video/out/opengl/ra_gl.c +++ b/video/out/opengl/ra_gl.c @@ -224,6 +224,8 @@ static int ra_init_gl(struct ra *ra, GL *gl) if (ra->caps & RA_CAP_COMPUTE) { gl->GetIntegerv(GL_MAX_COMPUTE_SHARED_MEMORY_SIZE, &ival); ra->max_shmem = ival; + gl->GetIntegerv(GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS, &ival); + ra->max_compute_group_threads = ival; } gl->Disable(GL_DITHER); -- cgit v1.2.3