int a = 5;
if(a)
{
for(int i = 0;i < a: i++)
{
DoSomething();
}
}
Can you do the same in HLSL?If you could,it would be really convenient to both check if an effect is enabled to begin with and to serve as a parameter to the said effect.
Can you use integers as bools in HLSL just like in C++?
Started by mrheisenberg, Oct 14 2012 04:00 PM
4 replies to this topic
#1 Members - Reputation: 333
Posted 14 October 2012 - 04:00 PM
In C++ you can have:
Sponsor:
#4 Members - Reputation: 322
Posted 14 October 2012 - 10:12 PM
In C++ you can have:
int a = 5; if(a) { for(int i = 0;i < a: i++) { DoSomething(); } }Can you do the same in HLSL?If you could,it would be really convenient to both check if an effect is enabled to begin with and to serve as a parameter to the said effect.
it works perfectly, but i would still do the additional
if(a != 0)
// readability






