Exemplo n.º 1
0
 /// <summary>
 /// Query the memory requirements for a sparse image.
 /// </summary>
 public unsafe SharpVk.SparseImageMemoryRequirements[] GetSparseMemoryRequirements()
 {
     try
     {
         SharpVk.SparseImageMemoryRequirements[] result = default(SharpVk.SparseImageMemoryRequirements[]);
         uint sparseMemoryRequirementCount = default(uint);
         SharpVk.SparseImageMemoryRequirements *marshalledSparseMemoryRequirements  = default(SharpVk.SparseImageMemoryRequirements *);
         SharpVk.Interop.VkImageGetSparseMemoryRequirementsDelegate commandDelegate = commandCache.Cache.vkGetImageSparseMemoryRequirements;
         commandDelegate(this.parent.handle, this.handle, &sparseMemoryRequirementCount, marshalledSparseMemoryRequirements);
         marshalledSparseMemoryRequirements = (SharpVk.SparseImageMemoryRequirements *)(Interop.HeapUtil.Allocate <SharpVk.SparseImageMemoryRequirements>((uint)(sparseMemoryRequirementCount)));
         commandDelegate(this.parent.handle, this.handle, &sparseMemoryRequirementCount, marshalledSparseMemoryRequirements);
         if (marshalledSparseMemoryRequirements != null)
         {
             var fieldPointer = new SharpVk.SparseImageMemoryRequirements[(uint)(sparseMemoryRequirementCount)];
             for (int index = 0; index < (uint)(sparseMemoryRequirementCount); index++)
             {
                 fieldPointer[index] = marshalledSparseMemoryRequirements[index];
             }
             result = fieldPointer;
         }
         else
         {
             result = null;
         }
         return(result);
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
Exemplo n.º 2
0
 public static extern void vkGetImageSparseMemoryRequirements(SharpVk.Interop.Device device, SharpVk.Interop.Image image, uint *sparseMemoryRequirementCount, SharpVk.SparseImageMemoryRequirements *sparseMemoryRequirements);