glEnable(GL_FRAGMENT_PROGRAM_ARB) slows my code down!

Started by
0 comments, last by deavik 17 years, 10 months ago
I am gearing up to transition my existing game to shaders. Everything is going smoothly, but last night I was testing my performance and I noticed something VERY strange. I have a scene that renders at about 100fps (not using any shaders at all). I enabled and loaded some shaders, but didn't *use* them -- yet I immediately took a performance hit of about 30% to 70fps.. after some tinkering I found the culprit to be: glEnable(GL_FRAGMENT_PROGRAM_ARB); I load my vertex shader just fine but the minute I call the above glEnable to begin loading up my fragment program the performance of my app is permanently degraded. Even if I call glDisable(GL_FRAGMENT_PROGRAM_ARB) immediately after the above call (e.g. don't do ANY actual fragment work whatsoever) my performance gets hit. Long story short if I put only: glEnable(GL_FRAGMENT_PROGRAM_ARB); glDisable(GL_FRAGMENT_PROGRAM_ARB); in my program initialization, it crushes my non-shader performance for the duration of my program execution! I am using an ATI Radeon 9800 with up-to-date drivers.. Has anyone else experienced this issue? And does anyone know what I can do to resolve this issue?
Advertisement
Honestly I'm also flummoxed as to how glEnable / glDisable at initialization can cause the program to slow down later - but I wanted to say (just in case you hadn't noticed) that your card has GLSL support, and you'll probably find it easier to use a high level shader language than an assembly fragment program.

This topic is closed to new replies.

Advertisement