When I reuse index buffer and fill it with new data that is smaller that previous data in that buffer, the rest of “dirty” data in index buffer is also used for rendering.
And because of that I get strange artefact’s.
I solve it by filling the buffer with zeros and then once again with my new data.
Shouldn’t it work that SetData sets also length of the data in buffer that should be used for rendering so I can declare much bigger buffers than data I will fill it which and reused it as often I want?