sending vertices and indices to the graphic card once.

Started by
3 comments, last by nhatkthanh 20 years, 1 month ago
My question is if I have a static vertex buffer and index buffer that won''t change for the duration of the application, can I send it to the graphic card once and no over and over each frame (thinking that with large data carry over the slow bus system). Basically each frame I call the render function which in turn call the drawprimitive to send those vertex and index buffer. is this how it is done? and that it will send over and over? thanks.
Advertisement
If you have a static buffer, in POOL_DEFAULT it will be in video card memory. In POOL_MANAGED it will be in AGP memory. Things in POOL_DEFAULT should be created with USAGE_WRITEONLY. Because you should never re-lock or read from a static VB, using POOL_DEFAULT and USAGE_WRITEONLY is all you should worry about.

DX8 class cards don''t store indices on the video card, and transfer them each time you ask to draw... there is no way around this. If you crank up the debug output level you may see "Unable to create driver index buffer" each time you try to make an index buffer.

On DX9 cards, both indices and vertices should go into video memory with the settings above.
Thank you very much.
While in general this is correct in many cases, overall it isn''t.

POOL_DEFAULT will place the resource in device-accessible memory. This could be local video memory or it could be AGP. Typically it will tend to place the resources in AGP if the resources are DYNAMIC and in local vid mem if not DYNAMIC. But the only guarantee is that it''s device-accessible.

POOL_MANAGED means there is a System memory copy that gets swapped into device-accessible (ie DEFAULT) memory as needed.

Unless you need a DYNAMIC resource, just make it a MANAGED resource. It will be swapped in as needed and only swapped out if necessary.


Stay Casual,

Ken
Drunken Hyena
Stay Casual,KenDrunken Hyena
yeah, I thought this might be the cause of the slow down but apparently it wasn''t, see my other topic posted, what I''m trying to render is about 500 large quads about 5000 x 5000 units in size, with single texture and it render at about 10 fps. 500 quads is just 1000 tris and I don''t know where or what cause this slow down.

This topic is closed to new replies.

Advertisement