The main issue is that the value being passed to the count parameter for glUniform*v calls is the (byte) length of the ArrayLikeBuffer instead of the number of uniform variables (vectors/matrices). This can cause crashes when calling those functions.
The main issue is that the value being passed to the
count
parameter forglUniform*v
calls is the (byte) length of theArrayLikeBuffer
instead of the number of uniform variables (vectors/matrices). This can cause crashes when calling those functions.Doc references: https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glUniform.xhtml https://www.khronos.org/opengl/wiki/GLSL_:_common_mistakes#How_to_use_glUniform
In order to determine the number of elements in an ALB,
size()
was added. Right now it just uses a switch statement to match the destructor.This change is