public D3D12MA_JsonWriter([NativeTypeName("const D3D12MA_ALLOCATION_CALLBACKS&")] ref D3D12MA_ALLOCATION_CALLBACKS allocationCallbacks, [NativeTypeName("StringBuilder&")] D3D12MA_StringBuilder *stringBuilder)
        {
            m_SB = stringBuilder;

            Unsafe.SkipInit(out m_Stack);
            D3D12MA_Vector <StackItem> ._ctor(ref m_Stack, (D3D12MA_ALLOCATION_CALLBACKS *)Unsafe.AsPointer(ref allocationCallbacks));

            m_InsideString = false;
        }
        // allocationCallbacks externally owned, must outlive this object.
        public static void _ctor(ref D3D12MA_PoolAllocator <T> pThis, [NativeTypeName("D3D12MA_ALLOCATION_CALLBACKS&")] D3D12MA_ALLOCATION_CALLBACKS *allocationCallbacks, [NativeTypeName("UINT")] uint firstBlockCapacity)
        {
            pThis.m_AllocationCallbacks = allocationCallbacks;
            pThis.m_FirstBlockCapacity  = firstBlockCapacity;

            D3D12MA_Vector <ItemBlock> ._ctor(ref pThis.m_ItemBlocks, allocationCallbacks);

            D3D12MA_ASSERT((D3D12MA_DEBUG_LEVEL > 0) && (pThis.m_FirstBlockCapacity > 1));
        }
        internal static void _ctor(ref D3D12MA_BlockMetadata_Generic pThis, [NativeTypeName("const D3D12MA_ALLOCATION_CALLBACKS&")] D3D12MA_ALLOCATION_CALLBACKS *allocationCallbacks, bool isVirtual)
        {
            pThis.Base        = new D3D12MA_BlockMetadata(allocationCallbacks, isVirtual);
            pThis.Base.lpVtbl = Vtbl;

            pThis.m_FreeCount   = 0;
            pThis.m_SumFreeSize = 0;
            D3D12MA_List <D3D12MA_Suballocation> ._ctor(ref pThis.m_Suballocations, allocationCallbacks);

            D3D12MA_Vector <D3D12MA_List <D3D12MA_Suballocation> .iterator> ._ctor(ref pThis.m_FreeSuballocationsBySize, allocationCallbacks);

            Unsafe.SkipInit(out pThis.m_ZeroInitializedRange);

            D3D12MA_ASSERT((D3D12MA_DEBUG_LEVEL > 0) && (allocationCallbacks != null));
        }
Esempio n. 4
0
        internal static void _ctor(ref D3D12MA_BlockVector pThis, D3D12MA_Allocator *hAllocator, [NativeTypeName("const D3D12_HEAP_PROPERTIES&")] D3D12_HEAP_PROPERTIES *heapProps, D3D12_HEAP_FLAGS heapFlags, [NativeTypeName("UINT64")] ulong preferredBlockSize, [NativeTypeName("size_t")] nuint minBlockCount, [NativeTypeName("size_t")] nuint maxBlockCount, bool explicitBlockSize, [NativeTypeName("UINT64")] ulong minAllocationAlignment)
        {
            pThis.m_hAllocator             = hAllocator;
            pThis.m_HeapProps              = *heapProps;
            pThis.m_HeapFlags              = heapFlags;
            pThis.m_PreferredBlockSize     = preferredBlockSize;
            pThis.m_MinBlockCount          = minBlockCount;
            pThis.m_MaxBlockCount          = maxBlockCount;
            pThis.m_ExplicitBlockSize      = explicitBlockSize;
            pThis.m_MinAllocationAlignment = minAllocationAlignment;
            pThis.m_HasEmptyBlock          = false;
            D3D12MA_Vector <Pointer <D3D12MA_NormalBlock> > ._ctor(ref pThis.m_Blocks, hAllocator->GetAllocs());

            pThis.m_NextBlockId = 0;

            D3D12MA_RW_MUTEX._ctor(ref pThis.m_Mutex);
        }
 public D3D12MA_StringBuilder(ref D3D12MA_ALLOCATION_CALLBACKS allocationCallbacks)
 {
     Unsafe.SkipInit(out m_Data);
     D3D12MA_Vector <ushort> ._ctor(ref m_Data, (D3D12MA_ALLOCATION_CALLBACKS *)Unsafe.AsPointer(ref allocationCallbacks));
 }