glfinish

Started by
4 comments, last by Viper173 21 years, 7 months ago
two weeks ago I have seen a game where you could simply ''press a key'' and a chart appeared, showing how much time each part of the game consumed. the actual method was glFinish, showing how much time the graphics card had left processing its geometry. the most amazing thing, however was that you could see the diagram and check how much time shadowing / path finding etc. consumed. how much time is needed to render an element wouldn''t be that hard to do. but does anybody know how to use glfinish??? Am I right when I think of it as a measure of how effectivly I''m implementing parallism?
Advertisement
At runtime OGL commands are sent into a queue. OGL then processes these commands async. .When you call glFinish(), this function blocks until all OGL commands are processed.
Am I right?
There are 10 kinds of people,those who understand binaryand those who not.
quote:Original post by Martin Foerster
At runtime OGL commands are sent into a queue. OGL then processes these commands async. .When you call glFinish(), this function blocks until all OGL commands are processed.
Am I right?


Yep you're right.

Im outta my depth here ( not into performance analysis and all that guff, i do it the slow way and speed it slowly by playing with it ) but lemme give it a shot. And im only doing this cos im stoned

OK, before glFinish() read the performance timer and store it as 'A'. After the glFinish() call read the timer again and store it as 'B'. Take 'A' away from 'B' and store it in 'C', so you have the amount of time in milliseconds( or whatever you measure in ) in 'C'.
Store this value for each of your drawing functions( lighting, shadowing, etc.... till you go as deep as you wanna ) and display it as a percentage of how long it took to draw the whole frame ( for each graphic function ).

[edit aded here for clarity ]

it would go like this for every drawing function:
 glBegin( WHATEVER YOU WANT );  //Your rendering code here glEnd(); float a = Timer.GetTime(); //Read the performance timer glFinish(); //Hold until all drawing commands are finished float b = Timer.GetTime(); //Read the timer again float c = b - a; //Take Them Away, and be left with time taken to draw g_rendersequence = c; //store it in a unique variable for each different sequence you wanna test 

[end edit ]

Sorry if i was a bit cryptic there, but i dont think i was cut out to be able to share my ideas cos they only really make sense in my head, and im crap at explaining them

Plus, it might lag your program a little (obviously )

[edited by - Hairybudda on September 13, 2002 2:42:26 PM]
*st0ned*
>>glFinish, showing how much time the graphics card had left processing its geometry.
the most amazing thing, however was that you could see the diagram and check how much time shadowing / path finding etc. consumed.<<

i think a *lot* more work went into it than just adding a glFinish to the code

http://uk.geocities.com/sloppyturds/gotterdammerung.html
quote:Original post by zedzeek
>>glFinish, showing how much time the graphics card had left processing its geometry.
the most amazing thing, however was that you could see the diagram and check how much time shadowing / path finding etc. consumed.<<

i think a *lot* more work went into it than just adding a glFinish to the code

http://uk.geocities.com/sloppyturds/gotterdammerung.html


agreed, but i still tried to help him
*st0ned*
thanx

This topic is closed to new replies.

Advertisement