Updating an instance buffer. #475
-
Can anyone help with this buffer updating code? Not much too it, but it just doesn't work. The buffer initialization looks good and it's working without the update code. But the update code just tromps all over the buffer and set's it to mostly zero's with some odd values at the start.
And the buffer desc...
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The data in the buffer looks like it might be a pointer. That reminds me of some situations where data needs to be pinned. Or the ref to the array data is giving the pointer rather than the data. I tried creating a local reference.
But that didn't work. I succeeded by using Unsafe.CopyBlock instead of using the Copy method with the following code
But I still can't get Copy to work. |
Beta Was this translation helpful? Give feedback.
Hi,
Use one of the SetData helpers methods I've added in the pass:
https://github.com/amerkoleci/Vortice.Windows/blob/main/src/Vortice.Direct3D11/ID3D11Buffer.cs#L10