I'm trying to create a dynamic vertex buffer that is write only (for the performance boost). I keep a local copy of all the data in the buffer so that I never hace to read directly from the buffer itself. I only ever modify the data in this local copy and then later I write the contents of the local copy into the vertex buffer. However, this causes an error. This seems odd to me as I'm writing to the buffer, not reading from it.
Here's how I create my buffer:
Device->CreateVertexBuffer((iNumPointsPerSeg * (iNumTotalSegments + iNumTotalBranches)) * sizeof(d3d::VertexPos), D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, 0, D3DPOOL_DEFAULT, &vbTree, 0);
and here's the part where I update the buffer with the local copy (I'm only writing to the buffer, not reading from it):
vbTree->Lock(0, 0, (void**)&v, 0);
for(int i = 0; i < vLocal.size(); i++)
v = vLocal; //Debugger says this line is the problem
vbTree->Unlock();
Anyone any idea what the problem is?