Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17560

[D3D12] Unmap resource while command list is being recorded

$
0
0

Say I have a simple frame is set up as follows:

ID3D12CommandAllocator::Reset

ID3D12GraphicsCommandList::Reset

ID3D12Resource::Map  <- this is for a cbuffer

[ copy a new matrix to the mapped pointer for the cbuffer ]

ID3D12Resource::Unmap

[ submit draw calls ]

ID3D12GraphicsCommandList::Close

ID3D12CommandQueue::ExecuteCommandLists

 

Is there any problem with mapping/unmapping that buffer while the command list is being recorded?  The page on Unmap says "Unmap also flushes the CPU cache, when necessary, so that GPU reads to this address reflect any modifications made by the CPU."  I am seeing some weird behaviour when I update the buffer in this manner (single frames where objects jump around), and I don't if I move the map/memcpy/unmap to before the Resets.  But I'm confused, because I would think that the GPU won't try to access that data until after the call to ExecuteCommandLists.


Viewing all articles
Browse latest Browse all 17560

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>