I have a fragmented shader that executes a for loop with the number of passes passed as a single int variable.
uniform int numPasses;
void main(void) {
for (int i=0; i<numPasses; i=i+1) {
}
}
I see that performance drops sharply as the number of cycles increases. So is this the right way to do loops in a fragment shader, or should I just loop through the processor using ping-ponging between two framebuffer attachments?
I'm trying to try ping-ponging, but I just wanted to know the opinions of people who may have come across this before.
source
share