-2
\$\begingroup\$

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

\$\endgroup\$

1 Answer 1

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\$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.