Phineas
07-05-2010, 01:28 PM
I am using the fragment shader for a GPGPU algorithm. The algorithm requires the fragment shaders to read fragment output from previous steps, therefore I use the ping pong approach (two framebuffers where one is read and the other is written, and the two are swapped after each iteration).
As an experiment, I made the algorithm use the same buffer for reading and writing. The algorithm still works! Is this to be expected? Isn't it wrong to read from a texture and write to it at the same time? Does this work only because my hardware/GL implementation allows it (GTX 275)?
Note that each fragment shader instance is embarrassingly parellel: it only reads and writes one fragment, and leaves its neighbors alone.
Thanks!
As an experiment, I made the algorithm use the same buffer for reading and writing. The algorithm still works! Is this to be expected? Isn't it wrong to read from a texture and write to it at the same time? Does this work only because my hardware/GL implementation allows it (GTX 275)?
Note that each fragment shader instance is embarrassingly parellel: it only reads and writes one fragment, and leaves its neighbors alone.
Thanks!