Ejemplo n.º 1
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;
        }
Ejemplo n.º 2
0
        internal static void _ctor(ref D3D12MA_BlockVector pThis, D3D12MA_AllocatorPimpl *hAllocator, D3D12_HEAP_TYPE heapType, D3D12_HEAP_FLAGS heapFlags, [NativeTypeName("UINT64")] ulong preferredBlockSize, [NativeTypeName("size_t")] nuint minBlockCount, [NativeTypeName("size_t")] nuint maxBlockCount, bool explicitBlockSize)
        {
            pThis.m_hAllocator         = hAllocator;
            pThis.m_HeapType           = heapType;
            pThis.m_HeapFlags          = heapFlags;
            pThis.m_PreferredBlockSize = preferredBlockSize;
            pThis.m_MinBlockCount      = minBlockCount;
            pThis.m_MaxBlockCount      = maxBlockCount;
            pThis.m_ExplicitBlockSize  = explicitBlockSize;
            pThis.m_MinBytes           = 0;
            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);
        }
Ejemplo n.º 3
0
 public static void _ctor(ref D3D12MA_RW_MUTEX mutex)
 {
     InitializeSRWLock((RTL_SRWLOCK *)Unsafe.AsPointer(ref mutex.m_Lock));
 }
 public D3D12MA_MutexLockRead([NativeTypeName("D3D12MA_RW_MUTEX&")] ref D3D12MA_RW_MUTEX mutex, bool useMutex = true)
     : this((D3D12MA_RW_MUTEX *)Unsafe.AsPointer(ref mutex), useMutex)
 {
 }