diff --git a/src/glsl/link_uniforms.cpp b/src/glsl/link_uniforms.cpp index 2f1c9f5..9991c90 100644 --- a/src/glsl/link_uniforms.cpp +++ b/src/glsl/link_uniforms.cpp @@ -270,6 +270,7 @@ private: * array elements for arrays. */ this->next_sampler += MAX2(1, this->uniforms[id].array_elements); + this->next_sampler = MIN2(this->next_sampler, MAX_SAMPLERS); const gl_texture_index target = base_type->sampler_index(); const unsigned shadow = base_type->sampler_shadow;