Esempio n. 1
0
        /// <summary>
        /// Get the adapter description.
        /// </summary>
        /// <param name="desc">Adapter description</param>
        /// <returns>Result of the query.</returns>
        public Result GetDesc(out AdapterDesc desc)
        {
            if (getDesc1 == null)
            {
                getDesc1 = GetFunction <GetDesc1>(functionIndex: 10);
            }

            return(getDesc1(NativeInterface, out desc));
        }
Esempio n. 2
0
 private static DeviceInfo ConvertToDeviceInfo(int index, AdapterDesc desc)
 {
     var(vendorName, vendorId) = Lookup(desc.VendorId);
     return(new DeviceInfo
     {
         DeviceId = index,
         Type = QueryDeviceType(desc.Description, vendorId),
         Description = desc.Description,
         VendorName = vendorName,
         VendorId = vendorId,
         VideoMemoryInMB = (int)(desc.DedicatedVideoMemory >> 20),
         SystemMemoryInMB = (int)(desc.DedicatedSystemMemory >> 20),
         SharedMemoryInMB = (int)(desc.SharedSystemMemory >> 20),
     });
 }