Advantages of HLSL?

In theory higher level program descriptions allow the compiler (assuming the compiler has adequate knowledge of the target hardware) more optimization opportunities. For example, a high level program that calls the normalize method in a high-level shading language can implement with the fast nrm_pp instruction on the NV4X. It's riskier to change the DP3/RSQ/MUL sequence into nrm_pp since the result is not guaranteed to be equivalent. Another example - DIV in NV_FP2 is allowed to have different output than the a sequence of RCP and MUL.

Assemblers really have less flexibility in this regard since they have little/no knowledge of original programmer intent.
 
XxStratoMasterXx said:
Is there a performance overhead?

Only when the shaders need to be compiled, usually at level load time.

Will the HLSL shaders be less efficient than hand tuned shaders? Sometimes.
 
Back
Top