13 D3D12MA::ALLOCATOR_DESC allocatorDesc = {};
14 allocatorDesc.pAdapter = adapter;
15 allocatorDesc.pDevice =
device;
16 allocatorDesc.Flags = D3D12MA::ALLOCATOR_FLAG_SINGLETHREADED;
18 D3D12MA::Allocator* allocator;
19 HRESULT hr = D3D12MA::CreateAllocator(&allocatorDesc, &allocator);
28 D3D12_HEAP_TYPE heapType,
const D3D12_RESOURCE_DESC* resourceDesc,
30 const D3D12_CLEAR_VALUE* clearValue) {
31 D3D12MA::ALLOCATION_DESC allocationDesc = {};
32 allocationDesc.HeapType = heapType;
38 D3D12MA::Allocation* d3d12maAllocation;
39 HRESULT hr = fAllocator->CreateResource(&allocationDesc, resourceDesc,
40 initialResourceState, clearValue,
41 &d3d12maAllocation, IID_PPV_ARGS(&
resource));
46 allocation->reset(
new Alloc(d3d12maAllocation));
52 const D3D12_RESOURCE_DESC* resourceDesc, D3D12_RESOURCE_STATES initialResourceState,
53 const D3D12_CLEAR_VALUE* clearValue) {
56 HRESULT hr = fAllocator->CreateAliasingResource(alloc->fAllocation, localOffset, resourceDesc,
57 initialResourceState, clearValue,
static SkString resource(SkPDFResourceType type, int index)
static sk_sp< GrD3DMemoryAllocator > Make(IDXGIAdapter *adapter, ID3D12Device *device)
gr_cp< ID3D12Resource > createAliasingResource(sk_sp< GrD3DAlloc > &allocation, uint64_t localOffset, const D3D12_RESOURCE_DESC *, D3D12_RESOURCE_STATES initialResourceState, const D3D12_CLEAR_VALUE *) override
gr_cp< ID3D12Resource > createResource(D3D12_HEAP_TYPE, const D3D12_RESOURCE_DESC *, D3D12_RESOURCE_STATES initialResourceState, sk_sp< GrD3DAlloc > *allocation, const D3D12_CLEAR_VALUE *) override