How to properly use DrawMaterialToRenderTarget in C++?

I’m pretty sure that you have to wait until the material is done rendering to the render target before constructing a texture 2D or else it will be blank.