I have some fixed-function OpenGL code that I'm upgrading to use shaders. I've done the code work, but am seeing a huge performance drop. The frame rate in a typical scene has halved. There are still some parts of the scene using the fixed-function pipeline though. Are there any obvious gotchas that could account for this?
Off the top of my head, the code looks comparable. I've replaced the fixed-function code which used one directional light, ambient and diffuse only, for a simple vertex shader with per-vertex directional ambient/diffuse lighting, and a trivial pixel shader with one texture lookup modulated withthe interpolated colour. Previously the code called glInterleavedArrays; now I have three calls to glVertexAttribPointer instead (not using vertex array objects.) The vertex & index data are stored in buffer objects. The rendering looks identical.
The test machine is an Intel Clarkdale Core i5-660 running Windows 7 Ultimate x64 SP1, using the Clarkdale GPU. Driver version is 220.127.116.119. I don't see the same issue on another GeForce test machine, so I think it's something to do with Intel's GPU or drivers.