Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

 

 Performance issue in SFMLQuadRenderer

Go down 
AuthorMessage
hermitC
Guest




Performance issue in SFMLQuadRenderer Empty
PostSubject: Performance issue in SFMLQuadRenderer   Performance issue in SFMLQuadRenderer Icon_minitimeFri Jan 14, 2011 11:47 am

I've encountered a strange performance drop in

Code:
void SFMLQuadRenderer::innerRender(const Group& group)

In this method line

Code:
glDrawArrays(GL_QUADS,0,nbToRender << 2);

blocks up to 1/60 second when it is either the first or last call to it for the same group. I'm identifying the group by its ID.
Every call in between is as fast as it should be. Each time it blocks that long nbToRender is zero.

Any idea what that could be? I know that OGL has lazy texture loading. Theoretically that would explain the long blocking of the first call for a group. But why does the last call block so long to?

AFAIK SPARK does caching so texture loading can't be the reason, right?

Finally I've worked around this issue this way:

Code:
if(0 < nbToRender) glDrawArrays(GL_QUADS,0,nbToRender << 2);

------------------------------------------------------------------------------------------------------------------------
Windows Vista 32bit
NVIDIA GeForce GO 7300
SPARK 1.5.4
SFML 1.5
Visual Studio 2005 Express


Back to top Go down
Juff
Developer



Messages : 539
Date d'inscription : 2009-07-14
Age : 41

Performance issue in SFMLQuadRenderer Empty
PostSubject: Re: Performance issue in SFMLQuadRenderer   Performance issue in SFMLQuadRenderer Icon_minitimeFri Jan 14, 2011 4:39 pm

Hi,

that's a strange one !

First of all, how did you profile the application ?

A call to glDrawArrays with a count of 0 is perfectly valid in OpenGL (Only a call with a negative count is invalid and will generate an error which can lead to performance drop). If calling glDrawArray with a count equal to 0 causes performance drops, it is therefore an issue in the driver implementation. Try updating your driver to the latest version. If your fix with the test corrects that, it is clearly a bug on the driver's side.

At the beginning I was thinking of something else that can take time on the first render : SPARK has lazy render buffer creation. Therefore at the first render, if there is no spark render buffer attached to a group for this renderer, one will be created. However it doesnt really match the symptoms you describe.

Anyway, maybe I can make a fix somewhere in the renderer : if there is no particle to render, escape as soon as possible. However this may have border effect. I ll check that.

Finally, 1/60s is not really a big deal and should not be noticeable by the user.

Anyway try to update your driver, and keep me informed. Thanks.

Back to top Go down
http://spark.developpez.com
 
Performance issue in SFMLQuadRenderer
Back to top 
Page 1 of 1
 Similar topics
-
» SPK_Copy issue in iOS
» SFML 1.6 and SPARK -- Freezing Issue
» One issue on explosion demo of SPARK using Irrlicht as a renderer?

Permissions in this forum:You cannot reply to topics in this forum
 :: English Forum :: Questions (en)-
Jump to: