What happen if i use dynamic branching on radeon?

In that case the shader is executed more slowly or it is the microprocessor which excute it ?
if it is not the microprossor (thus it’s the VPU)how it works ?

If it’s implemented in a GLSL shader, the GPU will evaluate all the branches and pick the one corresponding to the sets of conditions.
Other than that, you’d have to use options like NV_fragment_program2 and bump straight into a compiling error since only NV40+ class hardware supports it.

ok thanks, so why do we hear that radeon don’t support dynamic branching ?

Because there is no such thing as dynamic branching where all conditional paths are evaluated before picking the right one.

what happen if i use dynamic branching on radeon ?
If you use dynamic conditional branches on a Radeon through glslang, then the driver will either unroll the branch so that each side gets executed, or if that goes over hardware resources, it will let you know that the shader will run in software.

Dynamic branching in a fragment shader is not that special, because it lets you do things depending on a conditional (which is already possible even without dynamic branching), but it is special, because it actually only computes one of the branches.

The advantage of this is, that you can save lots of cycles and therefore speedup certain computations quite a bit (for example soft shadows with shadowmaps -> more texture fetches where needed).

However, this will only be the case if you actually avoid a big chunk of work, through dynamic branching. Else you will even lose speed.


/me is tempted to post a soft shadow demo using dynamic branching on NV40 hardware but is afraid to come off as a demo prostitute…again :stuck_out_tongue:

Originally posted by Java Cool Dude:
but is afraid to come off as a demo prostitute… :stuck_out_tongue:
We know that already, so just go along… :wink:



This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.