public MemoryAlloc Allocate(SharpVulkan.Buffer buffer, SharpVulkan.MemoryPropertyFlags propertyFlags) { GetBufferMemoryRequirements(buffer, out var requirements, out var prefersDedicated, out bool requiresDedicated); var dedicatedAllocateInfo = new SharpVulkan.Ext.MemoryDedicatedAllocateInfo { StructureType = SharpVulkan.Ext.StructureType.MemoryDedicatedAllocateInfo, Buffer = buffer }; var alloc = Allocate( requirements, &dedicatedAllocateInfo, prefersDedicated, requiresDedicated, propertyFlags, true); Context.Device.BindBufferMemory(buffer, alloc.Memory.Memory, alloc.Offset); return(alloc); }
public MemoryAlloc Allocate(SharpVulkan.Image image, SharpVulkan.MemoryPropertyFlags propertyFlags, SharpVulkan.ImageTiling tiling) { GetImageMemoryRequirements(image, out var requirements, out var prefersDedicated, out bool requiresDedicated); var dedicatedAllocateInfo = new SharpVulkan.Ext.MemoryDedicatedAllocateInfo { StructureType = SharpVulkan.Ext.StructureType.MemoryDedicatedAllocateInfo, Image = image }; var alloc = Allocate( requirements, &dedicatedAllocateInfo, prefersDedicated, requiresDedicated, propertyFlags, tiling == SharpVulkan.ImageTiling.Linear); Context.Device.BindImageMemory(image, alloc.Memory.Memory, alloc.Offset); return(alloc); }