Example #1
0
 public MemoryAllocateFlagsInfoKHR
 (
     StructureType sType       = StructureType.MemoryAllocateFlagsInfo,
     void *pNext               = default,
     MemoryAllocateFlags flags = default,
     uint deviceMask           = default
 )
 {
     SType      = sType;
     PNext      = pNext;
     Flags      = flags;
     DeviceMask = deviceMask;
 }
Example #2
0
        public unsafe DeviceMemory(Api api, ulong size, uint memoryTypeBits, MemoryAllocateFlags allocateFlags, MemoryPropertyFlags propertyFlags)
        {
            _api = api;

            var flagsInfo = new MemoryAllocateFlagsInfo();

            flagsInfo.SType = StructureType.MemoryAllocateFlagsInfo;
            flagsInfo.PNext = null;
            flagsInfo.Flags = allocateFlags;

            var allocInfo = new MemoryAllocateInfo();

            allocInfo.SType           = StructureType.MemoryAllocateInfo;
            allocInfo.PNext           = &flagsInfo;
            allocInfo.AllocationSize  = size;
            allocInfo.MemoryTypeIndex = FindMemoryType(memoryTypeBits, propertyFlags);

            Util.Verify(_api.Vk.AllocateMemory(_api.Device.VkDevice, allocInfo, null, out _vkDeviceMemory), $"{nameof(DeviceMemory)}: Unable to allocate memory.");
        }