PDA

View Full Version : profile does not support "for"... any work-around?



Dr_Davenstein
05-01-2008, 07:18 PM
Is there such a thing? I'm trying to write a fragment shader that requires a varying variable from the vertex shader for use in a loop. My card doesn't seem to support *any* form of looping with uniform or varying variables. Is three any way I can get around this? If it's of any help, I have a nVidia 5500FX w/256 mem.

-NiCo-
05-02-2008, 03:48 AM
GF5 doesn't support dynamically calculated loop counts. IIRC you could set the loop count to the maximum possible loop count and put a conditional inside the loop to determine whether it needs to e executed.



uniform loop_count;

for (int i = 0; i < max_loop_count; ++i)
{
if (i < loop_count)
{
function(i)
}
}

Dr_Davenstein
05-02-2008, 02:08 PM
Yeah, i see. Thanks. I was hoping there was something else, but I guess not. Oh well... at least that works. ;)