PDA

View Full Version : Best way to process lists?



Linuxhippy
10-05-2007, 01:20 AM
Hi there,

I am currently working on a 2.0 shader which should iterate through a list (list = data stored in a texture).

Do best practises exist for such work? Is such complex stuff even possible with ps-2.0 shader cards?

My problem seems to be that:
- Howto iterate if dynamic branching is not supported?
- Howto start at an index, if another pixel bevore the current already consumed an entry of the list?


Thank you in advance, lg Clemens

PaladinOfKaos
10-05-2007, 07:36 AM
If dynamic branching isn't supported, you'll have to unroll the loop. The loop should cover a small range (say, 1/16th for a 4x4 pixel kernel) of the total list. Each pixel then determines its base index based on its location, and adds that to the loop range. It then can compute it's own chunk of the list.

Check out http://gpgpu.org . They have some tutorials on list processing there.

Linuxhippy
10-05-2007, 01:06 PM
Cool, thanks a lot :)