I'd like to know whether the HLSL compiler is smart enough sort out conditions that depend on constants. Specifically, I want to know what it will do in these two made-up examples. 1) Code: const static int myconstant = 3; float myvar = (myconstant == 3 || checksomething()) ? getsomething() : getsomethingelse(); 2) Code: const static int myconstant = 3; if (myconstant == 3 || checksomething()) { float myvar = getsomething(); } else { float myvar = getsomethingelse(); } In both cases I'd want the compiler to end up with simply Code: float myvar = getsomething(); Will it?