question about preshader

Started by
3 comments, last by circlesoft 18 years ago
Hi,all! I'm reading the topic"Using an Effect",it refers to a Improve Performance with Preshaders. Can I see the result of preshader? either I use fxc to compile the shader with /Od or not, the output results is the same.Did it means the optimizations is inside,I can't see?
Advertisement
hi,

Quote:A preshader is a technique for increasing shader efficiency by pre-calculating constant shader expressions. The effect compiler automatically pulls out shader computations from the body of a shader and executes them on the CPU prior to the shader running.
Yes, the purpuse of the preshader is to increase speed transparently. It would be bad if you could recognize differences because of an optimization, right? [smile]

kp
------------------------------------------------------------Neo, the Matrix should be 16-byte aligned for better performance!
You'll only see a performance increase from preshaders if your application is vertex-shader or [sometimes] shader constant bound. This is because some work is taken from the GPU and given to the CPU.

If your application is CPU bound, you will actually see a performance decrease because you're giving more work to an already overworked CPU. In this case, the GPU is likely sat idle a lot of the time.

If your application is bound by something else, such as fillrate, then you won't see any big difference in performance with/without preshaders.


Your performance is capped by whatever is your biggest bottleneck, [premature] optimization of things that aren't bottlenecks won't lead to any significant performance increases (if any at all).


Recipe for good performance:
1)make it work [v.little point in tuning something that's unfinished],
2)profile it to find the biggest bottleneck [PIX & co. are your friends],
3)optimize that bottleneck [e.g. use preshaders if it's vertex shader],
4)goto 1

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

Quote:2)profile it to find the biggest bottleneck [PIX & co. are your friends],

what is co.?
Quote:Original post by 6666662000
Quote:2)profile it to find the biggest bottleneck [PIX & co. are your friends],

what is co.?

Co. is short for Company. He was just meaning PIX and other applications like it. Intel's VTune, for example, is a very good CPU application profiler.
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )

This topic is closed to new replies.

Advertisement