Esempio n. 1
0
        internal static unsafe PhysicalDeviceMemoryProperties2 MarshalFrom(Interop.PhysicalDeviceMemoryProperties2 *value)
        {
            PhysicalDeviceMemoryProperties2 result = new PhysicalDeviceMemoryProperties2();

            result.MemoryProperties = PhysicalDeviceMemoryProperties.MarshalFrom(&value->MemoryProperties);
            return(result);
        }
        /// <summary>
        ///
        /// </summary>
        internal static unsafe PhysicalDeviceMemoryProperties MarshalFrom(SharpVk.Interop.PhysicalDeviceMemoryProperties *pointer)
        {
            PhysicalDeviceMemoryProperties result = default(PhysicalDeviceMemoryProperties);

            if (pointer->MemoryTypeCount != 0)
            {
                var fieldPointer = new SharpVk.MemoryType[(uint)(pointer->MemoryTypeCount)];
                for (int index = 0; index < (uint)(pointer->MemoryTypeCount); index++)
                {
                    fieldPointer[index] = (&(pointer->MemoryTypes_0))[index];
                }
                result.MemoryTypes = fieldPointer;
            }
            else
            {
                result.MemoryTypes = null;
            }
            if (pointer->MemoryHeapCount != 0)
            {
                var fieldPointer = new SharpVk.MemoryHeap[(uint)(pointer->MemoryHeapCount)];
                for (int index = 0; index < (uint)(pointer->MemoryHeapCount); index++)
                {
                    fieldPointer[index] = (&(pointer->MemoryHeaps_0))[index];
                }
                result.MemoryHeaps = fieldPointer;
            }
            else
            {
                result.MemoryHeaps = null;
            }
            return(result);
        }
Esempio n. 3
0
 /// <summary>
 /// Reports memory information for the specified physical device.
 /// </summary>
 public PhysicalDeviceMemoryProperties GetMemoryProperties()
 {
     unsafe
     {
         try
         {
             PhysicalDeviceMemoryProperties         result = default(PhysicalDeviceMemoryProperties);
             Interop.PhysicalDeviceMemoryProperties marshalledMemoryProperties;
             Interop.Commands.vkGetPhysicalDeviceMemoryProperties(this.handle, &marshalledMemoryProperties);
             result = PhysicalDeviceMemoryProperties.MarshalFrom(&marshalledMemoryProperties);
             return(result);
         }
         finally
         {
             Interop.HeapUtil.FreeLog();
         }
     }
 }
        internal static unsafe PhysicalDeviceMemoryProperties MarshalFrom(Interop.PhysicalDeviceMemoryProperties *value)
        {
            PhysicalDeviceMemoryProperties result = new PhysicalDeviceMemoryProperties();

            result.MemoryTypes = new MemoryType[value->MemoryTypeCount];
            MemoryType *MemoryTypesPointer = &value->MemoryTypes;

            for (int index = 0; index < value->MemoryTypeCount; index++)
            {
                result.MemoryTypes[index] = *MemoryTypesPointer;
                MemoryTypesPointer++;
            }
            result.MemoryHeaps = new MemoryHeap[value->MemoryHeapCount];
            MemoryHeap *MemoryHeapsPointer = &value->MemoryHeaps;

            for (int index = 0; index < value->MemoryHeapCount; index++)
            {
                result.MemoryHeaps[index] = *MemoryHeapsPointer;
                MemoryHeapsPointer++;
            }
            return(result);
        }