public int CreateResource2([NativeTypeName("const ALLOCATION_DESC*")] D3D12MA_ALLOCATION_DESC *pAllocDesc, [NativeTypeName("const D3D12_RESOURCE_DESC1*")] D3D12_RESOURCE_DESC1 *pResourceDesc, D3D12_RESOURCE_STATES InitialResourceState, [NativeTypeName("const D3D12_CLEAR_VALUE*")] D3D12_CLEAR_VALUE *pOptimizedClearValue, ID3D12ProtectedResourceSession *pProtectedSession, D3D12MA_Allocation **ppAllocation, [NativeTypeName("REFIID")] Guid *riidResource, void **ppvResource)
        {
            if ((pAllocDesc == null) || (pResourceDesc == null) || (ppAllocation == null))
            {
                D3D12MA_ASSERT(false); // "Invalid arguments passed to Allocator::CreateResource2."
                return(E_INVALIDARG);
            }

            using var debugGlobalMutexLock = D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK();

            return(m_Pimpl->CreateResource2(pAllocDesc, pResourceDesc, InitialResourceState, pOptimizedClearValue, pProtectedSession, ppAllocation, riidResource, ppvResource));
        }
Beispiel #2
0
 public void GetCopyableFootprints1([NativeTypeName("const D3D12_RESOURCE_DESC1 *")] D3D12_RESOURCE_DESC1 *pResourceDesc, [NativeTypeName("UINT")] uint FirstSubresource, [NativeTypeName("UINT")] uint NumSubresources, [NativeTypeName("UINT64")] ulong BaseOffset, D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, [NativeTypeName("UINT *")] uint *pNumRows, [NativeTypeName("UINT64 *")] ulong *pRowSizeInBytes, [NativeTypeName("UINT64 *")] ulong *pTotalBytes)
 {
     ((delegate * unmanaged <ID3D12Device8 *, D3D12_RESOURCE_DESC1 *, uint, uint, ulong, D3D12_PLACED_SUBRESOURCE_FOOTPRINT *, uint *, ulong *, ulong *, void>)(lpVtbl[72]))((ID3D12Device8 *)Unsafe.AsPointer(ref this), pResourceDesc, FirstSubresource, NumSubresources, BaseOffset, pLayouts, pNumRows, pRowSizeInBytes, pTotalBytes);
 }
Beispiel #3
0
 public int CreatePlacedResource1(ID3D12Heap *pHeap, [NativeTypeName("UINT64")] ulong HeapOffset, [NativeTypeName("const D3D12_RESOURCE_DESC1 *")] D3D12_RESOURCE_DESC1 *pDesc, D3D12_RESOURCE_STATES InitialState, [NativeTypeName("const D3D12_CLEAR_VALUE *")] D3D12_CLEAR_VALUE *pOptimizedClearValue, [NativeTypeName("const IID &")] Guid *riid, void **ppvResource)
 {
     return(((delegate * unmanaged <ID3D12Device8 *, ID3D12Heap *, ulong, D3D12_RESOURCE_DESC1 *, D3D12_RESOURCE_STATES, D3D12_CLEAR_VALUE *, Guid *, void **, int>)(lpVtbl[70]))((ID3D12Device8 *)Unsafe.AsPointer(ref this), pHeap, HeapOffset, pDesc, InitialState, pOptimizedClearValue, riid, ppvResource));
 }
Beispiel #4
0
 public int CreateCommittedResource2([NativeTypeName("const D3D12_HEAP_PROPERTIES *")] D3D12_HEAP_PROPERTIES *pHeapProperties, D3D12_HEAP_FLAGS HeapFlags, [NativeTypeName("const D3D12_RESOURCE_DESC1 *")] D3D12_RESOURCE_DESC1 *pDesc, D3D12_RESOURCE_STATES InitialResourceState, [NativeTypeName("const D3D12_CLEAR_VALUE *")] D3D12_CLEAR_VALUE *pOptimizedClearValue, ID3D12ProtectedResourceSession *pProtectedSession, [NativeTypeName("const IID &")] Guid *riidResource, void **ppvResource)
 {
     return(((delegate * unmanaged <ID3D12Device8 *, D3D12_HEAP_PROPERTIES *, D3D12_HEAP_FLAGS, D3D12_RESOURCE_DESC1 *, D3D12_RESOURCE_STATES, D3D12_CLEAR_VALUE *, ID3D12ProtectedResourceSession *, Guid *, void **, int>)(lpVtbl[69]))((ID3D12Device8 *)Unsafe.AsPointer(ref this), pHeapProperties, HeapFlags, pDesc, InitialResourceState, pOptimizedClearValue, pProtectedSession, riidResource, ppvResource));
 }
Beispiel #5
0
        public D3D12_RESOURCE_ALLOCATION_INFO GetResourceAllocationInfo2([NativeTypeName("UINT")] uint visibleMask, [NativeTypeName("UINT")] uint numResourceDescs, [NativeTypeName("const D3D12_RESOURCE_DESC1 *")] D3D12_RESOURCE_DESC1 *pResourceDescs, D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1)
        {
            D3D12_RESOURCE_ALLOCATION_INFO result;

            return(*((delegate * unmanaged <ID3D12Device8 *, D3D12_RESOURCE_ALLOCATION_INFO *, uint, uint, D3D12_RESOURCE_DESC1 *, D3D12_RESOURCE_ALLOCATION_INFO1 *, D3D12_RESOURCE_ALLOCATION_INFO *>)(lpVtbl[68]))((ID3D12Device8 *)Unsafe.AsPointer(ref this), &result, visibleMask, numResourceDescs, pResourceDescs, pResourceAllocationInfo1));
        }
Beispiel #6
0
        public int CreateResource2([NativeTypeName("UINT64")] ulong size, [NativeTypeName("UINT64")] ulong alignment, [NativeTypeName("const D3D12MA_ALLOCATION_DESC&")] D3D12MA_ALLOCATION_DESC *allocDesc, [NativeTypeName("const D3D12_RESOURCE_DESC1&")] D3D12_RESOURCE_DESC1 *resourceDesc, D3D12_RESOURCE_STATES InitialResourceState, [NativeTypeName("const D3D12_CLEAR_VALUE&")] D3D12_CLEAR_VALUE *pOptimizedClearValue, ID3D12ProtectedResourceSession *pProtectedSession, D3D12MA_Allocation **ppAllocation, [NativeTypeName("REFIID")] Guid *riidResource, void **ppvResource)
        {
            D3D12MA_ASSERT((D3D12MA_DEBUG_LEVEL > 0) && (pProtectedSession == null)); // "Should never get here. pProtectedSession != NULL currently requires committed resources."

            ID3D12Device8 *device8 = m_hAllocator->GetDevice8();

            if (device8 == null)
            {
                return(E_NOINTERFACE);
            }

            HRESULT hr = Allocate(size, alignment, allocDesc, 1, ppAllocation);

            if (SUCCEEDED(hr))
            {
                ID3D12Resource *res = null;
                hr = device8->CreatePlacedResource1(
                    (*ppAllocation)->m_Placed.block->GetHeap(),
                    (*ppAllocation)->GetOffset(),
                    resourceDesc,
                    InitialResourceState,
                    pOptimizedClearValue,
                    __uuidof <ID3D12Resource>(), (void **)&res
                    );

                if (SUCCEEDED(hr))
                {
                    if (ppvResource != null)
                    {
                        hr = res->QueryInterface(riidResource, ppvResource);
                    }

                    if (SUCCEEDED(hr))
                    {
                        (*ppAllocation)->SetResource(res, resourceDesc);
                    }
                    else
                    {
                        res->Release();
                        SAFE_RELEASE(ref *ppAllocation);
                    }
                }
                else
                {
                    SAFE_RELEASE(ref *ppAllocation);
                }
            }

            return(hr);
        }