Example #1
0
        public static void _ctor(ref D3D12MA_CommittedAllocationList pThis)
        {
            pThis.m_useMutex = 1;
            pThis.m_HeapType = D3D12_HEAP_TYPE.D3D12_HEAP_TYPE_CUSTOM;
            pThis.m_Pool     = null;

            D3D12MA_RW_MUTEX._ctor(ref pThis.m_Mutex);
        }
Example #2
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);
        }
Example #3
0
        public static void _ctor(ref D3D12MA_CurrentBudgetData pThis)
        {
            D3D12MA_RW_MUTEX._ctor(ref pThis.m_BudgetMutex);

            for (uint i = 0; i < D3D12MA_HEAP_TYPE_COUNT; ++i)
            {
                Volatile.Write(ref pThis.m_BlockBytes[(int)i], 0);
                Volatile.Write(ref pThis.m_AllocationBytes[(int)i], 0);
                pThis.m_BlockBytesAtBudgetFetch[(int)i] = 0;
            }

            pThis.m_D3D12UsageLocal            = 0;
            pThis.m_D3D12UsageNonLocal         = 0;
            pThis.m_D3D12BudgetLocal           = 0;
            pThis.m_D3D12BudgetNonLocal        = 0;
            pThis.m_OperationsSinceBudgetFetch = 0;
        }
Example #4
0
 public D3D12MA_MutexLockRead([NativeTypeName("D3D12MA_RW_MUTEX&")] ref D3D12MA_RW_MUTEX mutex, bool useMutex = true)
     : this((D3D12MA_RW_MUTEX *)Unsafe.AsPointer(ref mutex), useMutex)
 {
 }
Example #5
0
 public static void _ctor(ref D3D12MA_RW_MUTEX mutex)
 {
     InitializeSRWLock((SRWLOCK *)Unsafe.AsPointer(ref mutex.m_Lock));
 }