Beispiel #1
0
        internal static unsafe PhysicalDeviceProperties2 MarshalFrom(Interop.PhysicalDeviceProperties2 *value)
        {
            PhysicalDeviceProperties2 result = new PhysicalDeviceProperties2();

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

            result.ApiVersion        = (Version)(pointer->ApiVersion);
            result.DriverVersion     = (Version)(pointer->DriverVersion);
            result.VendorID          = pointer->VendorID;
            result.DeviceID          = pointer->DeviceID;
            result.DeviceType        = pointer->DeviceType;
            result.DeviceName        = Interop.HeapUtil.MarshalStringFrom(pointer->DeviceName, Constants.MaxPhysicalDeviceNameSize, true);
            result.PipelineCacheUUID = new Guid(Interop.HeapUtil.MarshalFrom(pointer->PipelineCacheUUID, Constants.UuidSize));
            result.Limits            = SharpVk.PhysicalDeviceLimits.MarshalFrom(&pointer->Limits);
            result.SparseProperties  = SharpVk.PhysicalDeviceSparseProperties.MarshalFrom(&pointer->SparseProperties);
            return(result);
        }
        internal static unsafe PhysicalDeviceProperties MarshalFrom(Interop.PhysicalDeviceProperties *value)
        {
            PhysicalDeviceProperties result = new PhysicalDeviceProperties();

            result.ApiVersion    = value->ApiVersion;
            result.DriverVersion = value->DriverVersion;
            int DeviceNameActualLength;

            result.DeviceName        = System.Text.Encoding.UTF8.GetString(Interop.HeapUtil.MarshalFrom(value->DeviceName, Constants.MaxPhysicalDeviceNameSize, out DeviceNameActualLength, true), 0, DeviceNameActualLength);
            result.PipelineCacheUUID = new Guid(Interop.HeapUtil.MarshalFrom(value->PipelineCacheUUID, Constants.UuidSize));
            result.Limits            = PhysicalDeviceLimits.MarshalFrom(&value->Limits);
            result.VendorID          = value->VendorID;
            result.DeviceID          = value->DeviceID;
            result.DeviceType        = value->DeviceType;
            result.SparseProperties  = value->SparseProperties;
            return(result);
        }
Beispiel #4
0
 /// <summary>
 /// Returns properties of a physical device.
 /// </summary>
 public PhysicalDeviceProperties GetProperties()
 {
     unsafe
     {
         try
         {
             PhysicalDeviceProperties         result = default(PhysicalDeviceProperties);
             Interop.PhysicalDeviceProperties marshalledProperties;
             Interop.Commands.vkGetPhysicalDeviceProperties(this.handle, &marshalledProperties);
             result = PhysicalDeviceProperties.MarshalFrom(&marshalledProperties);
             return(result);
         }
         finally
         {
             Interop.HeapUtil.FreeLog();
         }
     }
 }