DemoCoder said:DiGuru said:In a SIMD architecture, if using predicates, that might still require different instructions issued for each fragment. That will only be faster if it doesn't 'break' the quad (ie. the chip can issue the instructions for each fragment and continue executing the whole quad afterwards, instead of dropping down to serial processing).
No, predicates do not require different instructions to be issued for each fragment. With predicates, instructions are still executed, the results simply aren't written to registers. It's a write disabling mechanism, that's all.
Yes, but the results still have to be calculated. All of them, with the correct ones being used.
Also, in the examples above:
Code:
if (tex2D(sampler, coords) > 0.5)
oColor = func1();
else
oColor = func2();
Code:
oColor = (tex2D(sampler, coords) > 0.5)? func1() : func2();
Those functions (func1, func2) have to be executed, whatever mechanism is used. And that requires different instructions issued.
The difference is in calculating all possibilities versus stalling parts of the pipeline. Both have a penalty.