Heck no! That’d be ugly.
We’re talking about a std list consisting of over 2000 elements
I hope we’re not talking about a std::list, because that’s typically implemented as a doubly-linked list with lots of pointer chasing and plenty of cache misses to show for it. Forget efficient memcpy uploads with that thing.
I’m trying to do GPU skinning, is there a way to pass a std::vector through 1 uniform call?
Absolutely. Let’s suppose you have a standard uniform array of mat4s in the shader:
uniform mat4 transforms[ MAX_LENGTH ];
Then you just populate them with:
glUniformMatrix4fv( loc, array_len, false, ptr )
where array_len is the number of matrices to update (which is <= MAX_LENGTH). There are similar glUniform* calls for other element types.
Note that I am not suggesting you upload your skinning transforms as mat4s. You could, but if you’re only doing linear blend skinning (LBS), you could also consider using mat4x3s for a 25% space savings (avoids sending the 0,0,0,1 row). Or you could use a mat2x4 containing a dual quaternion (or a quaternion-translation pairs) and decode/blend them in the shader (if you’re doing Dual Quaternion or Spherical Blend Skinning). Up to you.
Also, while you could upload these to an ordinary uniform array using the above, if in your skeletal/rendering system you have the possibility for reusing a set of transforms multiple times, then you’ll probably be better off to upload these transforms into a texture or a buffer object. These can then be uploaded once and then rebound to one or more shaders for reuse fairly quickly.
…and I realize that I have no choice but to send it over each draw call because the vector list is per mesh rather than the entire object…
See my last paragraph. You don’t have to send it over for each draw call necessarily, but can send it only when it is updated and reuse it across multiple shader invocations.