Example #1
0
 public Suballocation(long offset, long size, SuballocationType type = SuballocationType.Free, BlockAllocation?alloc = null)
 {
     Offset     = offset;
     Size       = size;
     Allocation = alloc;
     Type       = type;
 }
Example #2
0
        public static bool IsBufferImageGranularityConflict(SuballocationType type1, SuballocationType type2)
        {
            if (type1 > type2)
            {
                //Swap
                var type3 = type1;
                type1 = type2;
                type2 = type3;
            }

            switch (type1)
            {
            case SuballocationType.Free:
                return(false);

            case SuballocationType.Unknown:
                return(true);

            case SuballocationType.Buffer:
                return(type2 == SuballocationType.Image_Unknown || type2 == SuballocationType.Image_Optimal);

            case SuballocationType.Image_Unknown:
                return(type2 == SuballocationType.Image_Unknown || type2 == SuballocationType.Image_Linear || type2 == SuballocationType.Image_Optimal);

            case SuballocationType.Image_Linear:
                return(type2 == SuballocationType.Image_Optimal);

            case SuballocationType.Image_Optimal:
                return(false);

            default:
                Debug.Assert(false);
                return(true);
            }
        }
Example #3
0
 public AllocationContext(int currentFrame, int framesInUse, long bufferImageGranularity, long allocationSize, long allocationAlignment, AllocationStrategyFlags strategy, SuballocationType suballocType, bool canMakeOtherLost)
 {
     CurrentFrame           = currentFrame;
     FrameInUseCount        = framesInUse;
     BufferImageGranularity = bufferImageGranularity;
     AllocationSize         = allocationSize;
     AllocationAlignment    = allocationAlignment;
     Strategy          = strategy;
     SuballocationType = suballocType;
     CanMakeOtherLost  = canMakeOtherLost;
 }
 public DedicatedAllocation(VulkanMemoryAllocator allocator, int memTypeIndex, DeviceMemory memory, SuballocationType suballocType, IntPtr mappedData, long size) : base(allocator, 0)
 {
     this.memory          = memory;
     this.mappedData      = mappedData;
     this.memoryTypeIndex = memTypeIndex;
 }