Parellel Processing - Achievable With 2 Buffers?

Started by
0 comments, last by Muhammad Haggag 18 years, 10 months ago
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)
{
     Proccess(buffer);
     device.SetStreamSource(buffer);
     device.DrawPrimitives(whatever, 0, 512);
}
Would that be just as efficient as parellel processing or is it killed by the upload by SetStreamSource?
Advertisement
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]

This topic is closed to new replies.

Advertisement