Open KySpace opened 7 years ago
Using DataStream as output doesn't help either. In either cases if I check the vertex buffer I get only one vertex.
A few things come to mind. Firstly, you have checked the relevant capabilities I assume as per page map
secondly, I checked my code and use the following call.
var dataBox = a_context.MapSubresource(m_d3dBuffer, D3D11.MapMode.WriteDiscard, D3D11.MapFlags.None, out DataStream stream);
Obviously I use writediscard, but the flag can be what you desire. This outputs the stream you read and write to.
I am trying to dynamically update the vertex buffer, once every time I call the following method, where context is the device context member.
I am expecting to keep the old data during the update process. However each time I call this method, the previous data is overwritten. I checked the pointer of dataBox.DataPointer and it remains the same value in every call. But shouldn't the MapSubresource method protect the old data if I choose the WriteNoOverwrite mode? What should I do to keep the previous data during update?