Jump to content
  • Advertisement
Sign in to follow this  
lynedavid

Vertex shader slower than fixed function pipeline?

This topic is 4710 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Quote:
Original post by Kalidor
Does performance increase if you just bind the shader once instead of every frame (assuming your shader's begin() and end() functions bind and unbind the shader)?


Not noticably.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by gold
ok, the real answer here is: it depends on the shader. While its possible to write an efficient shader its also possible to write one which is horribly inefficient. The driver internally builds shaders to implement fixed function T&L (this is true for both NVIDIA and ATI for the last two generations of chips) so the comparison is really between driver-built shaders and user-built shaders.

The driver writers get paid to make sure the fixed function emulation shaders are very fast!


As I understand it, the NV40 does not have a different implementation for the fixed function pipeline. Although this did used to be the case. Although, noone really knows!

The vertex shader I am using in this test is very simple. I am even using the special ftransform macro, which is supposed to accelerate the modelview*projection matrix vertex transformation (somehow):


void main()
{
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_Position = ftransform();

}

Share this post


Link to post
Share on other sites
Quote:
Original post by lynedavid
I am even using the special ftransform macro, which is supposed to accelerate the modelview*projection matrix vertex transformation (somehow)


The ftransform() function is not meant to accelerate the transform, but it is there to ensure that, for example, if you're performing a multipass algorithm (with one pass using FFP and one using the PP) that both will arrive at the same transformed vertex.

From the GLSL specification:

This function will ensure that the incoming vertex
value will be transformed in a way that produces
exactly the same result as would be produced by
OpenGL's fixed functionality transform.

Share this post


Link to post
Share on other sites
Quote:
Original post by lynedavid
Although, noone really knows!
gold knows.

This is pretty perplexing. Your vertex shader is about as simple as it gets, so it shouldn't be slower than fixed function. Have you tried out your test program on other hardware?

Share this post


Link to post
Share on other sites
Quote:
Original post by Myopic Rhino
Quote:
Original post by lynedavid
Although, noone really knows!
gold knows.

This is pretty perplexing. Your vertex shader is about as simple as it gets, so it shouldn't be slower than fixed function. Have you tried out your test program on other hardware?


A Geforce 7800 GTX 512mb card (at work). A little faster for both cases but the same relationship still holds.

Havn't tried an ATI card though. I've just given my Radeon 9800 Pro to one of my friends.

Share this post


Link to post
Share on other sites
Hi,

FFP will be always faster. Thats because its FIXED so its optimized for certain processes but won't give you the flexibility of a VS.

On the other hand, if you program a shader and compile it as a 1.1 VS and compile the same shader as 2.0 Shader and compile the same shader as a 3.0 shader, the 1.1 shader wil run faster. Its because each shader version allows for more flexible execution. I.E. In VS1.1 you don't get loops and conditionals while in VS 2.0 and 3.0 they are accepted.

Maybe you should check the nVidia and ATI programmer sites for more info about this. Anyway I wouldn't bother. VS and PS are way superior than FFP and FFP will be dropped in future HW so make you a favor and drop it from your game or engine.

Luck!
Guimo





Share this post


Link to post
Share on other sites
Quote:
Original post by Guimo
FFP will be always faster. Thats because its FIXED so its optimized for certain processes but won't give you the flexibility of a VS.
The fixed-function pipeline hasn't existed in hardware for at least the last two generations. It's implemented using shaders in the programmable pipeline.
Quote:
Original post by Guimo
Maybe you should check the nVidia and ATI programmer sites for more info about this.
He's already getting support from ATI and nVidia engineers in this thread; why go elsewhere? [grin]

Share this post


Link to post
Share on other sites
Quote:
Original post by Myopic Rhino
He's already getting support from ATI and nVidia engineers in this thread; why go elsewhere? [grin]

I don't mean to digress from the purpose of the thread, but I (and I'm sure a lot of other people) am quite in the dark about who you are referring to ...

If this is classified information [grin], or this post isn't appropriate here please PM me or say so and I'll delete it at once.

Share this post


Link to post
Share on other sites
gold, i believe is michael gold. whos prolly been invloved with gl for >10 years (with sgi + now nvidia) not implying hes an old fart or anything.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!