pjcozzi

07-13-2010, 05:22 AM

Hello,

Does anyone know how to determine the number of scalars output from a geometry shader? In their programming guide (http://developer.download.nvidia.com/GPU_Programming_Guide/GPU_Programming_Guide_G80.pdf), NVIDIA recommends making this number no greater than 20 for peak performance on the GeForce 8800 GTX. More recent hardware must have a larger upper bound.

I'm not sure if the number of scalars output is as simple as the number of vertices times the size of each vertex. How do you determine the size of each vertex? Does an output with the flat qualifier count? Does every member in gl_PerVertex count? Or just the ones I write to?

out gl_PerVertex {

vec4 gl_Position;

float gl_PointSize;

float gl_ClipDistance[];

};

The reason I ask is because if you are doing something simple like point sprites in a geometry shader, the output is at least gl_Position (4 scalars) and a texture coordinate (2 scalars) per vertex, for a total of 24 scalars - above NVIDIA's limit of 20. Unless, you can compute the texture coordinate in the fragment shader and this results outputting less.

Regards,

Patrick

Does anyone know how to determine the number of scalars output from a geometry shader? In their programming guide (http://developer.download.nvidia.com/GPU_Programming_Guide/GPU_Programming_Guide_G80.pdf), NVIDIA recommends making this number no greater than 20 for peak performance on the GeForce 8800 GTX. More recent hardware must have a larger upper bound.

I'm not sure if the number of scalars output is as simple as the number of vertices times the size of each vertex. How do you determine the size of each vertex? Does an output with the flat qualifier count? Does every member in gl_PerVertex count? Or just the ones I write to?

out gl_PerVertex {

vec4 gl_Position;

float gl_PointSize;

float gl_ClipDistance[];

};

The reason I ask is because if you are doing something simple like point sprites in a geometry shader, the output is at least gl_Position (4 scalars) and a texture coordinate (2 scalars) per vertex, for a total of 24 scalars - above NVIDIA's limit of 20. Unless, you can compute the texture coordinate in the fragment shader and this results outputting less.

Regards,

Patrick