Loading...
Searching...
No Matches
D3D12HostImportUpload.hpp File Reference

Zero-copy CPU->GPU upload on D3D12, the counterpart of VkHostImportUpload. More...

Detailed Description

Zero-copy CPU->GPU upload on D3D12, the counterpart of VkHostImportUpload.

ID3D12Device3::OpenExistingHeapFromAddress wraps memory the application already owns in an ID3D12Heap, which is D3D12's equivalent of VK_EXT_external_memory_host: a capture buffer the card has DMA'd into becomes something the GPU can copy out of directly, with no staging copy.

Three constraints, all established by probing the runtime rather than read off a page:

  • The address must come from a virtual-memory reservation at the 64 KB system allocation granularity. _aligned_malloc memory is refused with E_INVALIDARG, so slots must come from importableAlloc. The size needs no rounding – the opened heap reports exactly the requested bytes.
  • The opened heap comes back CUSTOM with SHARED|SHARED_CROSS_ADAPTER, and a placed resource is refused unless it opts in with D3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER. Without it every combination of initial state fails; with it COPY_SOURCE succeeds.
  • D3D12_PLACED_SUBRESOURCE_FOOTPRINT::RowPitch is documented to require 256-byte alignment. Some drivers copy unaligned pitches byte-correctly anyway, but that is undocumented tolerance and not something to depend on, so init() refuses an unaligned pitch unless SCORE_GFX_D3D12_ALLOW_UNALIGNED_PITCH is set.

Go to the source code of this file.

Classes

class  score::gfx::interop::D3D12HostImportUpload
 

Namespaces

namespace  score
 Base toolkit upon which the software is built.
 
namespace  score::gfx
 Graphics rendering pipeline for ossia score.