As per title. How do you effectively copy or create an ID3D11 buffer by copying another ID3D11Buffer?
Specifically I would like to copy a Vertex Shader Constant Buffer.
Any help would be appreciated. Thank you.
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
As per title. How do you effectively copy or create an ID3D11 buffer by copying another ID3D11Buffer?
Specifically I would like to copy a Vertex Shader Constant Buffer.
Any help would be appreciated. Thank you.
You can use the ID3D11DeviceContext::CopyResource function, or do it manually with Map/memcpy.
Create the destination buffer and copy the data to it with one of the methods above.
What are you trying to achieve because map/memcpy and CopyResource work. But if you are just instancing some data and need the same working data as another object just setting that data might be better solution to begin with. The PCI-E bus transfer might incur some perfromance stalls you don't want.