Пример #1
0
 public VkResult MapMemory(
     [FromProperty("Device")] GenDevice device,
     [FromProperty("this")] GenDeviceMemory memory,
     ulong offset,
     ulong size,
     VkMemoryMapFlags flags,
     [Return] IntPtr *ppData)
 => default(VkResult);
Пример #2
0
 public static extern VkResult MapMemory(
     VkDevice device,
     VkDeviceMemory memory,
     ulong offset,
     ulong size,
     VkMemoryMapFlags flags,
     out IntPtr ppData
     );
Пример #3
0
 public VkObjectResult<IntPtr> Map(ulong offset, ulong size, VkMemoryMapFlags flags)
 {
     var _device = Device.Handle;
     var _memory = Handle;
     var _offset = offset;
     var _size = size;
     var _flags = flags;
     IntPtr _ppData;
     var result = Direct.MapMemory(_device, _memory, _offset, _size, _flags, &_ppData);
     return new VkObjectResult<IntPtr>(result, _ppData);
 }
Пример #4
0
        public VkObjectResult <IntPtr> Map(ulong offset, ulong size, VkMemoryMapFlags flags)
        {
            var    _device = Device.Handle;
            var    _memory = Handle;
            var    _offset = offset;
            var    _size   = size;
            var    _flags  = flags;
            IntPtr _ppData;
            var    result = Direct.MapMemory(_device, _memory, _offset, _size, _flags, &_ppData);

            return(new VkObjectResult <IntPtr>(result, _ppData));
        }
Пример #5
0
        public static Span <T> vkMapMemory <T>(VkDevice device, VkImage image, VkDeviceMemory memory, ulong offset = 0, ulong size = WholeSize, VkMemoryMapFlags flags = VkMemoryMapFlags.None) where T : unmanaged
        {
            void *pData;

            vkMapMemory(device, memory, offset, size, flags, &pData).CheckResult();


            if (size == WholeSize)
            {
                vkGetImageMemoryRequirements(device, image, out var memoryRequirements);
                return(new Span <T>(pData, (int)memoryRequirements.size));
            }

            return(new Span <T>(pData, (int)size));
        }
Пример #6
0
        public static Span <T> vkMapMemory <T>(VkDevice device, VkImage image, VkDeviceMemory memory, ulong offset = 0, ulong size = WholeSize, VkMemoryMapFlags flags = VkMemoryMapFlags.None) where T : unmanaged
        {
            void *pData;

            vkMapMemory(device, memory, offset, size, flags, &pData).CheckResult();

            if (size == WholeSize)
            {
                vkGetImageMemoryRequirements(device, image, out VkMemoryRequirements memoryRequirements);
                size = memoryRequirements.size;
            }

            int oneItemSize = sizeof(T);
            int spanLength  = (int)size / oneItemSize;

            return(new Span <T>(pData, spanLength));
        }
Пример #7
0
        public static IntPtr MapMemory(VkDeviceMemory memory, ulong offset, ulong size, VkMemoryMapFlags flags)
        {
            void *mappedLocal;

            vkMapMemory(device, memory, offset, size, flags, &mappedLocal);
            return((IntPtr)mappedLocal);
        }