Пример #1
0
 /// <summary>
 ///
 /// </summary>
 public static unsafe void BindBufferMemory2(this SharpVk.Device extendedHandle, SharpVk.Khronos.Experimental.BindBufferMemoryInfo[] bindInfos)
 {
     try
     {
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Khronos.Experimental.BindBufferMemoryInfo *marshalledBindInfos = default(SharpVk.Interop.Khronos.Experimental.BindBufferMemoryInfo *);
         commandCache = extendedHandle.commandCache;
         if (bindInfos != null)
         {
             var fieldPointer = (SharpVk.Interop.Khronos.Experimental.BindBufferMemoryInfo *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.Khronos.Experimental.BindBufferMemoryInfo>(bindInfos.Length).ToPointer());
             for (int index = 0; index < (uint)(bindInfos.Length); index++)
             {
                 bindInfos[index].MarshalTo(&fieldPointer[index]);
             }
             marshalledBindInfos = fieldPointer;
         }
         else
         {
             marshalledBindInfos = null;
         }
         SharpVk.Interop.Khronos.Experimental.VkDeviceBindBufferMemory2Delegate commandDelegate = commandCache.GetCommandDelegate <SharpVk.Interop.Khronos.Experimental.VkDeviceBindBufferMemory2Delegate>("vkBindBufferMemory2KHX", "instance");
         Result methodResult = commandDelegate(extendedHandle.handle, (uint)(bindInfos?.Length ?? 0), marshalledBindInfos);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
Пример #2
0
 /// <summary>
 /// Bind device memory to buffer objects.
 /// </summary>
 /// <param name="extendedHandle">
 /// The Device handle to extend.
 /// </param>
 public static unsafe void BindBufferMemory2(this SharpVk.Device extendedHandle, ArrayProxy <SharpVk.Khronos.Experimental.BindBufferMemoryInfo>?bindInfos)
 {
     try
     {
         CommandCache commandCache = default(CommandCache);
         SharpVk.Interop.Khronos.Experimental.BindBufferMemoryInfo *marshalledBindInfos = default(SharpVk.Interop.Khronos.Experimental.BindBufferMemoryInfo *);
         commandCache = extendedHandle.commandCache;
         if (bindInfos.IsNull())
         {
             marshalledBindInfos = null;
         }
         else
         {
             if (bindInfos.Value.Contents == ProxyContents.Single)
             {
                 marshalledBindInfos = (SharpVk.Interop.Khronos.Experimental.BindBufferMemoryInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.Experimental.BindBufferMemoryInfo>());
                 bindInfos.Value.GetSingleValue().MarshalTo(&*(SharpVk.Interop.Khronos.Experimental.BindBufferMemoryInfo *)(marshalledBindInfos));
             }
             else
             {
                 var fieldPointer = (SharpVk.Interop.Khronos.Experimental.BindBufferMemoryInfo *)(Interop.HeapUtil.AllocateAndClear <SharpVk.Interop.Khronos.Experimental.BindBufferMemoryInfo>(Interop.HeapUtil.GetLength(bindInfos.Value)).ToPointer());
                 for (int index = 0; index < (uint)(Interop.HeapUtil.GetLength(bindInfos.Value)); index++)
                 {
                     bindInfos.Value[index].MarshalTo(&fieldPointer[index]);
                 }
                 marshalledBindInfos = fieldPointer;
             }
         }
         SharpVk.Interop.Khronos.Experimental.VkDeviceBindBufferMemory2Delegate commandDelegate = commandCache.GetCommandDelegate <SharpVk.Interop.Khronos.Experimental.VkDeviceBindBufferMemory2Delegate>("vkBindBufferMemory2KHX", "instance");
         Result methodResult = commandDelegate(extendedHandle.handle, (uint)(Interop.HeapUtil.GetLength(bindInfos)), marshalledBindInfos);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }