Can I perform loop e.g for loops inside Cg? my GPU is a pre-war intel GMA 3100, SM2.0 lol
1 Answer
1I believe that, while the Cg for loop syntax is identical to that in C, Cg only supports for loops that can be fully unrolled at compile-time.
for(i = 0; i<5; i++) is ok, because the number of loop iterations is entirely deterministic and known at compile-time. Therefore it is possible to unroll - rewrite this code omitting the for loop by just duplicating that block of code five times. for(i = 0; i
– tanoshimi
What do you mean by "Cg" ?
– luckruns0utwell, as the tag says, Cg = C for Graphics :), Cg in Shaderlab
– DaKocha