Archived

This topic is now archived and is closed to further replies.

nhatkthanh

sending vertices and indices to the graphic card once.

Recommended Posts

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.

Share this post


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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites