In my spare time, I am working on a 3D engine using D3D11. To get the 3D effect, I use the typical model view projection matrix multiplication in my HLSL shaders. These matrices are uploaded to a d3d11 constant buffer. The projection matrix only changes when the viewport is resized but the model and view matrix can change on a frame per frame basis (when the model or camera is moved). These changes in the matrices must be uploaded to the same constant buffer in order to be used in the shaders. When uploading these changes, the projection matrix is (generally) not changed so I do not want to reupload this matrix. So in short, I need to partially update my constant buffer by only updating specific parts (offsets) in my buffer.
In openGL, we have uniform buffers and these work (I think) in the same way as a d3d11 constant buffer does. However, if you want to update a specific part of the uniform buffer, you can use the openGL function glBufferSubData. I tried looking for a similar way to do this in D3D11 but I did not found anything. I did find someone with a similar issue but he was using D3D11.1. link to original post: How to partially update constant buffer in DirectX 11.1. Someone also said that in D3D11, you need to upload all the data in to the constant buffer if you want to change a specifi portion. But this could result in keeping an entire copy of my buffer on the CPU side (RAM). There must be a better way right?
tldr; How can I update my d3d11 constant buffer on a specific offset?