Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: Programability slower than fixed function?

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2004
    Location
    CA
    Posts
    17

    Programability slower than fixed function?

    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 .

  2. #2
    Junior Member Newbie
    Join Date
    Dec 2004
    Location
    CA
    Posts
    17

    Re: Programability slower than fixed function?

    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?

  3. #3
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,453

    Re: Programability slower than fixed function?

    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.

  4. #4
    Junior Member Newbie
    Join Date
    Dec 2004
    Location
    CA
    Posts
    17

    Re: Programability slower than fixed function?

    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.

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,411

    Re: Programability slower than fixed function?

    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.
    "If you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

  6. #6
    Junior Member Newbie
    Join Date
    Dec 2004
    Location
    CA
    Posts
    17

    Re: Programability slower than fixed function?

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •