tkrul
02-19-2003, 04:24 AM
I am working on an octree implementation. When rendering nodes I use glDrawElement. Everything worked perfectly on my old Nvidia GF4 MX. Yet I recently bought a ATi Radeon 9700, and now I have a strange performance bottleneck. Whenever I use:
glDrawElements(GL_TRIANGLES, 3*nFaces, GL_UNSIGNED_INT, faces);
rendering slows to a crawl (approx. 1 fps). Yet when replacing the glDrawElement call with:
glBegin(GL_TRIANGLES);
for (unsigned int j=0; j< nFaces; j++)
{
glArrayElement((faces+j)->getIndexA());
glArrayElement((faces+j)->getIndexB());
glArrayElement((faces+j)->getIndexC());
}
glEnd();
everything works and performs as expected. Yet the effect of glDrawElements is defined to be (almost) identical to the code above. One would even expect the code above to be slightly slower due to the function call overhead of 3x glArrayElement...
What is happening here???
glDrawElements(GL_TRIANGLES, 3*nFaces, GL_UNSIGNED_INT, faces);
rendering slows to a crawl (approx. 1 fps). Yet when replacing the glDrawElement call with:
glBegin(GL_TRIANGLES);
for (unsigned int j=0; j< nFaces; j++)
{
glArrayElement((faces+j)->getIndexA());
glArrayElement((faces+j)->getIndexB());
glArrayElement((faces+j)->getIndexC());
}
glEnd();
everything works and performs as expected. Yet the effect of glDrawElements is defined to be (almost) identical to the code above. One would even expect the code above to be slightly slower due to the function call overhead of 3x glArrayElement...
What is happening here???