I'm using ID3D12Resource::Map
method to update a GPU resource. Is that the most efficient way? What alternatives do exist?
Upload heap resources have an associated cost for reading, which is higher than a default resource.
In case of Constant buffers, this is generally fine (as you are in a write once/read once scenario), but in other cases (large Vertex/Index buffers), this is generally not desirable.
A general approach is to create two resources (one within an upload heap, one within a default heap),copy your data into the upload resource (using map as you mentioned), then perform a gpu copy using either CopyResource or CopyBufferRegion in the default resource.
Please make sure that you have the Right resource state set up before/after the resource copy, using ResourceBarrier and a transition state.
Before to call copy, resource should be in the D3D12_RESOURCE_STATE_COPY_DEST before copy, and any of the read flag that is dependent on your resource.
Please also note that you can use a Copy Command queue for the GPU copy (so you can avoid to perform in in the Direct Command list), but you will need to ensure that the copy is completed before to use the resource (by using Fences).
Multi engine is described in msdn here