What it the difference between Heap-allocating, stack-allocating UpdateSubresources API for uploading data from UPLOAD heap to DEFAULT heap?
Is it just a wrapper around plain UpdateSubresource function?
Also, I assume copying happens in GPU timeline when CommandQueue is executed, but there are two copies at work; one from system memory to UPLOAD heap and other from UPLOAD heap to DEFAULT heap.
Do both of them happen at GPU timeline or system memory data can be re-used immediately after calling UpdateSubresource?
Heap-allocating vs Stack-allocating UpdateSubresources
Those functions aren't part of D3D12, they're part of D3DX12, which is open source, so you can have a peek
Yes, D3DX functions are just wrappers around common D3D functions.
The "normal" version requires an array of D3D12_PLACED_SUBRESOURCE_FOOTPRINT structures.
The "Heap-allocating" version creates this array for you, using HeapAlloc/HeapFree.
The "Stack-allocating" version creates this array for you on the stack, and requires you to pass in a safe maximum size as a template argument.
The "normal" version calls Map/Unmap on the UPLOAD resource and memcpy's your data into it. It then adds a series of CopyBufferRegion / CopyTextureRegion commands to your command list.
. 22 Racing Series .
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement