Skip to content

Commit

Permalink
opengl: avoid GL_MAX_FRAGMENT_UNIFORM_VECTORS on 2.1
Browse files Browse the repository at this point in the history
Unavailable.

cf. #111
  • Loading branch information
haasn committed Nov 19, 2021
1 parent 93d05c4 commit 9f0c143
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/opengl/gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,9 @@ pl_gpu pl_gpu_create_gl(pl_log log, pl_opengl gl, const struct pl_opengl_params
// This doesn't really map too well to OpenGL, so just set a conservative
// upper bound, which assumes (optimistically) that all uniforms are
// individual floats.
size_t max_vectors = 0;
get(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &max_vectors);
size_t max_vectors = 16; // conservative default
if (gl_test_ext(gpu, NULL, 30, 20))
get(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &max_vectors);
limits->max_variables = max_vectors * 4;

if (glsl->compute) {
Expand Down

0 comments on commit 9f0c143

Please sign in to comment.