shader - Do #defines in HLSL add any performance overhead? -


in hlsl preprocessor equivalent 1 in c(++) literally alters code before compilation? if case using such methods seem allow specializing shader without adding run-time conditional statements... true?

#defines work expect them to. evaluated @ compile-time.

if check output of compiler sure there no (unnecessary) branching occurring, use /fc <file> option hlsl compiler (fxc) generate assembly listing of compiled shader.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -