Sign in to follow this  
Zaph-0

HLSL Intrinsic Functions performance

Recommended Posts

Hi guys, I am optimizing my (quite complex) vertex shader code and am looking for a list with the performance (clocks or whatever) of the HLSL Intrinsic Functions. Does anyone of you know where I can get something like that or do I have to try all kinds of different ways to get my algorithm going to find the best way ? I'd rather avoid that kind of try-and-error coding because there are really alot of ways to do this and that makes it just too time consuming. Thanks in advance... ^_^ Edit: I am using xp/dx9

Share this post


Link to post
Share on other sites
I haven't seen exact "clock" measurements for any recent GPUs specified anywhere. In presentations, AMD and nVidia tehc guys advise to optimize just w.r.t. the number of used TEX and ALU instructions. The GPUs can typically co-execute some instructions, like a TEX and an 4-vector op at the same time, and perhaps a scalar op as well.

Note that some high-level instructions expand to more than one instruction in shader asm code, so check the exact ASM command counts. That's proved to be good enough for me.

Also, AMD and nVidia shader authoring tools can optimize/show the exact instruction counts when compiling for particular GPU series.

Share this post


Link to post
Share on other sites
Have a look at the ASM shader reference in the DirectX C++ documentation. For each shader model there is a list of all instructions defined for that model, including precise instruction count. Although you can't derive precise performance measures from this for the reasons clb named, mainly vendor-specific internal optimisation, parallel-issuing or hidden data stalls, these instruction lists might be able to show you want basic operations are possible. Some intrinsics directly map to one of these operations, others need multiple operations.

Share this post


Link to post
Share on other sites
The number of clocks per instruction will vary considerably between chip architectures and can even change with driver releases. Your best bet is to look for tools from the chip companies. ATI has the Shader Analyzer tool, which can tell you how much your shader will take on different cards. NVIDIA has a less friendly ShaderPerf tool. Maybe there are other tools, I don't know. Haven't used the NVIDIA one, but ATI's is a nice tool.

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