Sign in to follow this  

Vertex buffer issues

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

This topic is 4752 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this