View Full Version : Programability slower than fixed function?
12-02-2004, 08:57 AM
I bound a fragment program that only passes white, and it runs slower than the fixed function version implemented in the hardware. So am I doing something wrong, or is it that the programable interface is slower than the fixed function pipeline?
I'm using a GeForce 5200, but I don't see how that could matter because I'm not doing anything that isn't supported...I'm just passing white, every video card that supports fragment programs should be able to handle that :) .
12-02-2004, 09:07 AM
This problem actually leads me to ask another question: how much time does it take to bind a vertex and fragment program? Does it take about the same amount of time as binding a texture?
12-02-2004, 10:54 AM
Yeah, but your white is 32 bit float per channel, the fixed function pipe may have only 8 or 9 bits. ;)
Try a fragment shader with half, or a fragment program assembly version with the fixed type.
GeForce FX 5200 is not that fast overall.
Binding a program might involve downloading the microcode to the chip. Depending on the program's size it's probably more data than setting all mipmap addresses of a texture.
The answer is: bench it.
12-02-2004, 11:22 AM
I tried half like you suggested, it didn't speed up at all. My fps drops from 230 to 133.
I only know high level programming, not that low level stuff ;) .
Maybe the 5200 just sux then :( ...or high level programming doesn't get compiled very efficiently.
Let me know if you have any other suggestions, the compiler can't be that inefficient.
12-02-2004, 02:30 PM
The GeForce FX 5000 series is noticeable slower on programmable (float) shaders than fixed or semi-fixed (ps 1.1) shading. Meanwhile, the equivalent Radeon 9500+ series is about on par in 2.0 shaders.
For the current generation, GeForce FX 6000 series is doing a lot better on programmable shaders, and the highest end is (in my opinion) better than the equivalent Radeon (X800).
This just goes to show that you really, really, have to be careful about profiling what you will actually be using on as wide a range of hardware as possible, and make smart choices inside your renderer that adapts suitably.
12-03-2004, 04:32 AM
I had a nagging suspicion that it would be difficult to make a programable type of shader be just as fast as hardware, I just needed to make sure. Vertex programs seem to run just as fast, so that's good news.
Thanks for the help.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.