confused about these performance testing results

BlitzMax Forums/OpenGL Module/confused about these performance testing results

beanage(Posted 2009) [#1]
Hey guys,

just did some tests on drawing performance with DrawRect(), and had some results i barely understand:

using the glmax2ddriver(), graphics( 1440,900 ) and MASKBLEND blending mode, i draw 200 000 screen-sized (1440*900) rectangles.

on my 1 gb gf 9800 gt this takes about 90 millisecs.

a single call to flip afterwards rises this to 500 millisecs.

anyone an idea why?

thx for fast answers,

BeAnAge

EDIT: calling the whole thing WITHOUT the glmax2ddriver() rises the runtime to 26k millisecs, both with and without flip(). its just ridiculous to me.


Floyd(Posted 2009) [#2]
This must mean that you have the graphics card draw the rectangles and then call Millisecs(). This gives the time when the CPU has finished sending the drawing commands, not the time when the graphics card has actually finished drawing.

The subsequent Flip must wait for the flip to be performed. At this point the CPU and GPU are back "in sync" and Millisecs() now reports the actual time when all the graphics activity has finished.


beanage(Posted 2009) [#3]
ok, thanx.

should actually have known that, but it propably was more a wish than a real idea that it could actually take 90 ms to perform drawing 200000 screen-sized rectangles :)

greez from germany,

BeAnAge


ImaginaryHuman(Posted 2009) [#4]
try a glFinish() at the end of your drawing before you read how long it took.


xlsior(Posted 2009) [#5]
When you use the draw command, all you do is tell the graphics card what you want it to do.
It won't actually do it until the flip


beanage(Posted 2009) [#6]
ok, confusion gone so far :)

@imaginaryhuman: glFinish() at this point seems to effect the same results as flip()..

are there actually kinda "guidlines" how to speed up the drawing perrformance? e.g. using real opengl code instead of the bmax commands, or gl_quadstrip instead of gl_quads, changing MASKBLEND to SOLIDBLEND?

actually i'm not new to bmax or graphics programming itself (at least what bmax shows me from the chocolate side of it^^), but at this point my "experience" seems turning to zero ..