Hi,
I hava a palette shader implementation that uses a uniform to supply an array of 4x4 matrices. This all works fine but the cost of supplying matrices as a FloatBuffer is enormous.
I’ve done some investigative work and it seems that calling any glUniform… method (either ARB or GL 2.0) with FloatBuffers is > 50 times slower than using a non-FloatBuffer equivalent.
As an example calling
glUniform4fARB(int location, float v0, float v1, float v2, float v3)
is > 50 times faster then calling
glUniform4fvARB(int location, int count, FloatBuffer value) - (where the FloatBuffer has size 4)
This behaviour extends to all glUniform methods.
Data is always correctly supplied to the shader when using FloatBuffers.
Has anyone come across this kind of problem before?
Could it be Gfx driver related? (I’m running on an Nvidia GeForce Go 7900 GS on Windows)
Even if no-one can directly help it would be good to get confirmation that others can pass a vec4 as a FloatBuffer into a shader without this kind of performance drop-off. (Preferrably on an Nvidia card)