View Full Version : what happen if i use dynamic branching on radeon ?

05-06-2005, 12:40 PM
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 ?

Java Cool Dude
05-06-2005, 01:43 PM
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.

05-07-2005, 03:50 AM
ok thanks, so why do we hear that radeon don't support dynamic branching ?

Java Cool Dude
05-07-2005, 05:43 AM
Because there is no such thing as dynamic branching where all conditional paths are evaluated before picking the right one.

05-07-2005, 11:35 AM
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.

05-07-2005, 02:10 PM
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.


Java Cool Dude
05-07-2005, 10:11 PM
/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 :p

05-08-2005, 01:40 AM
Originally posted by Java Cool Dude:
but is afraid to come off as a demo prostitute... :p We know that already, so just go along... ;)

Java Cool Dude
05-08-2005, 08:44 AM

clicky (http://www.nvnews.net/vbulletin/showthread.php?t=49664)