Jump to content
  • Advertisement
Sign in to follow this  
kuharh

Vertex buffer issues

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

My application was locking up and causing my radeon 9200 to reset its VPU. I am using three functions to draw, these are DrawSprite(...), DrawSpriteRHW(..), and DrawString(...). I removed DrawString() and DrawSpriteRHW() and the problem persisted. I managed to fix the problem by modifying the DrawSpite command. The function was locking the vertex buffer, copying one quad, unlocking, and sending the data for every tile(around 500 tile) once per frame. I changed the function to write the vertex data to an array(using stl vector). I then do the buffer lock,... in a function called FlushSprites(...). Here are my questions: Can locking and unlocking a vertex buffer too often crash a Radeon VPU? My application has benefitted greatly from eliminating the extra VPU calls. It was using about 5 - 12% cpu and now it never goes above 0%. I use RHW transform for HUD and Ortho transform for the game so I can use scale and translate. Can I use multiple vertex formats with out using multiple locks? I have the FlushSprites(...) routine set to fill up the lock, vertex buffer, copy data, unlock, draw primitive, and then loop back if there were more vertecies than the buffer could hold. Map sizes are only bound by sizeof(int) which should be 2^32. More likly though maps would not get bigger than 100 x 100 or 10,000 quads = 60,000 verticies. I have my buffer set to 6,000 verticies now but this will result in multiple locks when text is enables since each letter is drawn as a quad. What size would you recommend for the vertex buffer?

Share this post


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