limit of glsl shader output numbers how much output a shader can have


I have a question regarding the maximum output per shader language using glsl. I have impression that n in gl_FragData[n] should be less than 8, that means one can only output 32 float per shader ( not including the other float by gl_FragDepth )

Is this true?



This forum is for CUDA questions only.

Please try posting on the registered developer forums, or

(But to answer your question - yes, the maximum is 8 on G80, 4 on G70).


Thank you for your reply. I’ll post OpenGL questions in other places later.

Just curious, my understanding is that CUDA removed the limitation of 8, right? I can write much more output per thread to global memory and output them.


Yes, in CUDA you can write an arbitrary number of outputs per thread, and more interestingly you can write them to any address (scattered writes).

CUDA is much more like programming a regular CPU in this regard.

Thank you, Simon.