Nicolas Lelong

09-22-2010, 06:28 AM

Hi everyone !

I'm not used to work with geometry shaders, and I set up a small synthetic benchmark to check peak performances on triangles throughput using VBOs and geometry shaders.

I do this by drawing triangles covering half-a-pixel, and measuring time with GL_TIME_ELAPSED queries.

On my GF9800, drivers version 257.21, I get :

- without GS, ~274 M triangles/sec

- with GS, ~92 M triangles/sec (slowdown ~3x)

On my Radeon HD 5570 + Cat.10.9, I get :

- without GS, ~428 M triangles/sec

- with GS, ~21 M triangles/sec (slowdown ~20x !)

My geometry shader is a simple passthrough shader :

#version 120

#extension GL_EXT_geometry_shader4 : enable

void main()

{

for(int i = 0; i < gl_VerticesIn; ++i)

{

gl_Position = gl_PositionIn[i];

EmitVertex();

}

EndPrimitive();

}

The only amount of additional code I have for GS support is :

#if USE_GEOMETRY_SHADER

mgd::GLShaderObject geomShader(GL_GEOMETRY_SHADER);

geomShader.compile(test_GL_vbo_speed_geom);

program.attachObject(geomShader);

glProgramParameteriEXT(program.handle(), GL_GEOMETRY_INPUT_TYPE_EXT, GL_TRIANGLES);

glProgramParameteriEXT(program.handle(), GL_GEOMETRY_OUTPUT_TYPE_EXT, GL_TRIANGLE_STRIP);

glProgramParameteriEXT(program.handle(), GL_GEOMETRY_VERTICES_OUT_EXT, 3);

#endif

Drawing is done using :

::glDrawRangeElements(GL_TRIANGLES, 0, 3*NUM_VERTEX_SET, 3*NUM_TRIANGLES, GL_UNSIGNED_SHORT, 0);

Is a 20x slowdown normal on ATI ? Do I miss something ?

Cheers,

Nicolas.

I'm not used to work with geometry shaders, and I set up a small synthetic benchmark to check peak performances on triangles throughput using VBOs and geometry shaders.

I do this by drawing triangles covering half-a-pixel, and measuring time with GL_TIME_ELAPSED queries.

On my GF9800, drivers version 257.21, I get :

- without GS, ~274 M triangles/sec

- with GS, ~92 M triangles/sec (slowdown ~3x)

On my Radeon HD 5570 + Cat.10.9, I get :

- without GS, ~428 M triangles/sec

- with GS, ~21 M triangles/sec (slowdown ~20x !)

My geometry shader is a simple passthrough shader :

#version 120

#extension GL_EXT_geometry_shader4 : enable

void main()

{

for(int i = 0; i < gl_VerticesIn; ++i)

{

gl_Position = gl_PositionIn[i];

EmitVertex();

}

EndPrimitive();

}

The only amount of additional code I have for GS support is :

#if USE_GEOMETRY_SHADER

mgd::GLShaderObject geomShader(GL_GEOMETRY_SHADER);

geomShader.compile(test_GL_vbo_speed_geom);

program.attachObject(geomShader);

glProgramParameteriEXT(program.handle(), GL_GEOMETRY_INPUT_TYPE_EXT, GL_TRIANGLES);

glProgramParameteriEXT(program.handle(), GL_GEOMETRY_OUTPUT_TYPE_EXT, GL_TRIANGLE_STRIP);

glProgramParameteriEXT(program.handle(), GL_GEOMETRY_VERTICES_OUT_EXT, 3);

#endif

Drawing is done using :

::glDrawRangeElements(GL_TRIANGLES, 0, 3*NUM_VERTEX_SET, 3*NUM_TRIANGLES, GL_UNSIGNED_SHORT, 0);

Is a 20x slowdown normal on ATI ? Do I miss something ?

Cheers,

Nicolas.