Avoid if statements in DirectX 10 shaders?
- by PolGraphic
I have heard that if statements should be avoid in shaders, because both parts of the statements will be execute, and than the wrong will be dropped (which harms the performance).
It's still a problem in DirectX 10? Somebody told me, that in it only the right branch will be execute.
For the illustration I have the code:
float y1 = 5; float y2 =…