Ben Cope
05-15-2006, 11:15 AM
Hi,
I am trying to measure the performance of an OpenGL application (also using Cg fragment/vertex shader elements). At the moment I am using the Pentium assembly 'rdtsc' instruction, which simply returns the cycle count, calling it around the rendering loop as follows:
start = rdtsc();
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f); glVertex2f(-1.0f, -1.0f);
glTexCoord2f(float(xsize), 0.0f); glVertex2f(1.0f, -1.0f);
glTexCoord2f(float(xsize), float(ysize)); glVertex2f(1.0f, 1.0f);
glTexCoord2f(0.0f, float(ysize)); glVertex2f(-1.0f, 1.0f);
glEnd();
glFinish();
end = rdtsc();
time = time + (end - start);
Doing this I am getting some (perhaps unbelievable) fast rendering times - is there any other considerations that I need to take into account?
I am not rendering to texture - and I ensure the window is fully visable on the screen during execution (to prevent clipping.)
Thank you for your help in advance.
Ben
I am trying to measure the performance of an OpenGL application (also using Cg fragment/vertex shader elements). At the moment I am using the Pentium assembly 'rdtsc' instruction, which simply returns the cycle count, calling it around the rendering loop as follows:
start = rdtsc();
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f); glVertex2f(-1.0f, -1.0f);
glTexCoord2f(float(xsize), 0.0f); glVertex2f(1.0f, -1.0f);
glTexCoord2f(float(xsize), float(ysize)); glVertex2f(1.0f, 1.0f);
glTexCoord2f(0.0f, float(ysize)); glVertex2f(-1.0f, 1.0f);
glEnd();
glFinish();
end = rdtsc();
time = time + (end - start);
Doing this I am getting some (perhaps unbelievable) fast rendering times - is there any other considerations that I need to take into account?
I am not rendering to texture - and I ensure the window is fully visable on the screen during execution (to prevent clipping.)
Thank you for your help in advance.
Ben