Sign in to follow this  
James Noble

glEnable(GL_FRAGMENT_PROGRAM_ARB) slows my code down!

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this