My fragment shader was significantly slowed down by a recent change, and I've been trying to understand why.
I isolated the main slow-down to accessing a single particular uniform float. If I include this line:
float not_used = my_uniform;
then the shader runs more than twice as slowly as it does without this line. The
not_used float is never referenced again.
Why would this be happening? I hope to understand it so that I can try to come up with a workaround that runs more quickly.
I'm running this on a mac with Intel HD Graphics 3000. I'm measuring the performance by making OpenGL timestamp queries before and after executing my
glDraw calls and looking at the ms intervals. I can provide more specs / details if it would be helpful in diagnosing the problem.