Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Viper173

glfinish

This topic is 5854 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
>>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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!