Luminescent
Veteran
Hopefully it is option a, Simon.
Depends on how branching is implemented. CPUs have branch prediction algorithms, which in most situations hide latency quite well. But I doubt that GPUs are already that advanced.DemoCoder said:It's b. You can't hide the branch latency.
Anandtech said:Whereas in the CPU world you need to be able to predict branches with ~95% accuracy, the requirements are no where near as stringent in the GPU world. NVIDIA insists that their branch predictor is significantly more accurate/efficient than ATI's, however it is difficult to back up those claims with hard numbers.
psurge said:any idea why the "endif" also takes 2 cycles? (that's just bizarre). Also was the "if add else add endif" shader running on the VS or the PS?
It was run in the pixel shader with 61.11 and DX9.0c beta2 runtime.psurge said:any idea why the "endif" also takes 2 cycles? (that's just bizarre). Also was the "if add else add endif" shader running on the VS or the PS?
While it does depend upon how the branch is implemented, branch prediction is not an absolute necessity in hiding the branch latency.sonix666 said:Depends on how branching is implemented. CPUs have branch prediction algorithms, which in most situations hide latency quite well. But I doubt that GPUs are already that advanced.
If all branches, whether conditional or not, are handled by a simple goto statement, then endif could well force a branch. That is, the "endif" signifies returning to the rest of the program.psurge said:any idea why the "endif" also takes 2 cycles? (that's just bizarre). Also was the "if add else add endif" shader running on the VS or the PS?