I'm using a GeForce 6800 with 9746 NVIDIA video drivers (also see the problem with 9604 on a Quadro FX 4400). I'm using OpenSceneGraph 1.2 and newer.
I have my own custom shader with uniforms and I'm seeing occasional large spikes (80-100ms) in draw times after updating a particular uniform. I assume these spikes are because the driver is recompiling my shader. The problem only exists for the first frame after the uniform is changed the first time otherwise things run fine.
I've posted this problem on the OpenSceneGraph mailing list and I was told the problem is probably with the video driver. The thought was that the driver initially was changing the uniforms definition in the shader to constant and then needs to (re)compile the shader once I make my first change to it. This seems strange (if true).
I have other uniforms and they seem to not have this problem. The problem also seems to relate somehow to a texture but I haven't figured out the complete picture yet.
Anybody know what's going on here? I've spent over 2 weeks looking at this and still don't have my hands around the problem.
Here are a few of the links to the issue in the OpenSceneGraph forums: