-2
\$\begingroup\$

Should I initialize it before Map() or before `Unmap()? Does it make a difference?

\$\endgroup\$
1
\$\begingroup\$

There is no need to initialize a constant buffer with default values, simply ensure you have created it initially by calling CreateBuffer() on the d3d device. You then have to call Map() before you can copy any data into that buffer, and then Unmap() to return control of it to the GPU. It is good practice to initialize object members to default values on construction, but with a buffer it would simply depend on the context.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.