Jump to content
  • Advertisement
Sign in to follow this  
dave

I really Dont Undestand These Framerate Drops...

This topic is 5170 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

So im writing an engioen for a puzzle game im making. below is some code that when it is executed per frame drops the fps from 340fps to 256.
	int vertexIndex = 0;
	D3DXVECTOR3 vec;
	D3DXMATRIXA16 matTot, matTrans, matScale;


	bgNode = &bgStart;
	bgNode = bgNode->next;

	while (bgNode)
	{
		memcpy(&finalBuffer[vertexIndex], &bgNode->pBL->v[0], sizeof(bgNode->pBL->v) );
		vertexIndex += 36;
		bgNode = bgNode->next;
	}


The linked list is 1000 nodes long, the stuff thats being copied using memcpy is 36 of these:
struct GENERICVERTEX3D
{
	float x,  y,  z;
	float tu, tv;
};


Is traversing linked lists this expensive. Also what worries me is that i need to render 36000 vertices after this is per frame and i dont think i can do it without it dropping below 100fps. Without the memcpy line the framrate barely drops. Are multiple calls to memcpy slow? Anyone have any ideas as to why its so slow. ace

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by ace_lovegrove
Thanx for that, i feel silly.

I would have thought i would have worked that out


Similar questions come up quite often, so don't feel bad - a lot of people get caught out by this the first time they start taking note of their framerates.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!