示例#1
0
 /// <summary>
 ///
 /// </summary>
 public unsafe SharpVk.PhysicalDeviceGroupProperties[] EnumeratePhysicalDeviceGroups()
 {
     try
     {
         SharpVk.PhysicalDeviceGroupProperties[] result = default(SharpVk.PhysicalDeviceGroupProperties[]);
         uint marshalledPhysicalDeviceGroupCount        = default(uint);
         SharpVk.Interop.PhysicalDeviceGroupProperties *marshalledPhysicalDeviceGroupProperties = default(SharpVk.Interop.PhysicalDeviceGroupProperties *);
         SharpVk.Interop.VkInstanceEnumeratePhysicalDeviceGroupsDelegate commandDelegate        = commandCache.Cache.vkEnumeratePhysicalDeviceGroups;
         Result methodResult = commandDelegate(this.handle, &marshalledPhysicalDeviceGroupCount, marshalledPhysicalDeviceGroupProperties);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
         marshalledPhysicalDeviceGroupProperties = (SharpVk.Interop.PhysicalDeviceGroupProperties *)(Interop.HeapUtil.Allocate <SharpVk.Interop.PhysicalDeviceGroupProperties>((uint)(marshalledPhysicalDeviceGroupCount)));
         commandDelegate(this.handle, &marshalledPhysicalDeviceGroupCount, marshalledPhysicalDeviceGroupProperties);
         if (marshalledPhysicalDeviceGroupProperties != null)
         {
             var fieldPointer = new SharpVk.PhysicalDeviceGroupProperties[(uint)(marshalledPhysicalDeviceGroupCount)];
             for (int index = 0; index < (uint)(marshalledPhysicalDeviceGroupCount); index++)
             {
                 fieldPointer[index] = SharpVk.PhysicalDeviceGroupProperties.MarshalFrom(&marshalledPhysicalDeviceGroupProperties[index]);
             }
             result = fieldPointer;
         }
         else
         {
             result = null;
         }
         return(result);
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }
        /// <summary>
        ///
        /// </summary>
        internal static unsafe PhysicalDeviceGroupProperties MarshalFrom(SharpVk.Interop.PhysicalDeviceGroupProperties *pointer)
        {
            PhysicalDeviceGroupProperties result = default(PhysicalDeviceGroupProperties);

            if (pointer->PhysicalDeviceCount != 0)
            {
                var fieldPointer = new SharpVk.PhysicalDevice[(uint)(pointer->PhysicalDeviceCount)];
                for (int index = 0; index < (uint)(pointer->PhysicalDeviceCount); index++)
                {
                    fieldPointer[index] = new SharpVk.PhysicalDevice(default(SharpVk.Instance), (&(pointer->PhysicalDevices_0))[index]);
                }
                result.PhysicalDevices = fieldPointer;
            }
            else
            {
                result.PhysicalDevices = null;
            }
            result.SubsetAllocation = pointer->SubsetAllocation;
            return(result);
        }