GLSL: glLinkProgram slow with instancing

Started by
2 comments, last by dchristopherfennell 13 years, 5 months ago
Anyone have this problem with instancing? I have a uniform buffer object shared between shaders. The block looks like this:
#version 150#extension GL_ARB_uniform_buffer_object : enableuniform MatrixBlock{    mat4 MVMatrix;      mat4 NormalMatrix;    mat4 ProjectionMatrix;};uniform InstanceBlock{    vec4 rotation[1000];    vec4 position[1000];};....mat4 quatToMatrix(in vec4 q);void main(){    mat4 world = quatToMatrix(rotation[gl_InstanceID]);    world[3][0] = position[gl_InstanceID].x;    world[3][1] = position[gl_InstanceID].y;    world[3][2] = position[gl_InstanceID].z;    ....}

This causes glLinkProgram to take a very long time to link for each shader that uses this block. It's painfully slow. If I reduce the number from 1000 to 100 for the position and rotation arrays, the link is considerably faster. I'm compiling on ATI 5700 HD series.

Is this the norm or am I doing it wrong?

Advertisement
Perhaps the statement should have been that glLinkProgram is slow with UBO's containing large arrays.
I encountered the exact same behavior last night, as I just started working on some instancing stuff that uses large uniform blocks. This appears to be an ATI issue, as my NVidia card and drivers don't seem to have an issue.

I'm currently testing on HD4850. May be worth mentioning in the ATI developer forums and/or in the Drivers section in the OpenGL.org forums.
Thanks for the input. I'm glad to know that it wasn't just me. I've contacted ATI about this too.

This topic is closed to new replies.

Advertisement