Sign in to follow this  

Parellel Processing - Achievable With 2 Buffers?

Recommended Posts

Hey all, Fairly simple question here: Is it possible to achieve parallel processing with two vertex buffers? I remember running through the old particle example in the SDK. They took a 2048 vertex buffer, locked 512 vertices, processed, rendered. Then they took the next 512, locked it, processed and rendered. This would allow them to upload the 512 vertices to the video card (GPU) while computing the information for the next 512 (CPU). If they were to use 4 vertex buffers of 512 each, could they achieve the same thing? Something along these lines:
for(int i = 0; i < 4; ++i)
     device.DrawPrimitives(whatever, 0, 512);
Would that be just as efficient as parellel processing or is it killed by the upload by SetStreamSource?

Share this post

Link to post
Share on other sites
What you're basically doing here is mimicking what the driver does internally when you use dynamic buffers. With dynamic buffers, a DISCARD lock returns a pointer to new memory (buffer renaming). However, your method has an extra SetStreamSource so I'd expect it to be slower.

Just use dynamic buffers [smile]

Share this post

Link to post
Share on other sites

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