/// <summary> /// Create a new instance of <see cref="Adapter"/> /// </summary> public Adapter( ComPtr <IDXGIAdapter1> adapter, string description, AdapterVendor vendorId, uint deviceId, uint subSysId, uint revision, ulong dedicatedVideoMemory, ulong dedicatedSystemMemory, ulong sharedSystemMemory, LUID adapterLuid, bool isSoftware ) { _adapter = adapter; Description = description; VendorId = vendorId; DeviceId = deviceId; SubSysId = subSysId; Revision = revision; DedicatedVideoMemory = dedicatedVideoMemory; DedicatedSystemMemory = dedicatedSystemMemory; SharedSystemMemory = sharedSystemMemory; AdapterLuid = adapterLuid; IsSoftware = isSoftware; }
/// <summary> /// Create a new instance of <see cref="Adapter"/> /// </summary> internal unsafe Adapter( UniqueComPtr <IUnknown> adapter, string description, AdapterVendor vendorId, uint deviceId, uint subSysId, uint revision, ulong dedicatedVideoMemory, ulong dedicatedSystemMemory, ulong sharedSystemMemory, LUID adapterLuid, ulong driverVersion, bool isSoftware, DeviceType type ) { _adapter = adapter; Description = description; VendorId = vendorId; DeviceId = deviceId; SubSysId = subSysId; Revision = revision; DedicatedVideoMemory = dedicatedVideoMemory; DedicatedSystemMemory = dedicatedSystemMemory; SharedSystemMemory = sharedSystemMemory; AdapterLuid = adapterLuid.LowPart | ((uint)adapterLuid.HighPart << 32); DriverVersion = driverVersion; IsSoftware = isSoftware; Type = type; }
private static bool IsVendorIgnored(AdapterVendor vender, AdapterVendor[] ignoredVendors) { foreach (var v in ignoredVendors) { if (vender == v) { return(true); } } return(false); }
public AdapterInfo ( bool isPrimary, int index, string name, uint vendorID, int nodeCount, ulong dedicatedGPUMemory, ulong deticatedSystemMemory, ulong sharedSystemMemory ) { this.isPrimary = isPrimary; this.index = index; this.name = name; this.vendorID = vendorID; this.nodeCount = nodeCount; this.dedicatedGPUMemory = dedicatedGPUMemory; this.deticatedSystemMemory = deticatedSystemMemory; this.sharedSystemMemory = sharedSystemMemory; if (dedicatedGPUMemory >= 0) { maxReservedMemory += dedicatedGPUMemory; maxMemory += dedicatedGPUMemory; } if (deticatedSystemMemory >= 0) { maxReservedMemory += deticatedSystemMemory; maxMemory += deticatedSystemMemory; } if (sharedSystemMemory >= 0) { maxMemory += sharedSystemMemory; } switch (vendorID) { case 0x8086: vendor = AdapterVendor.Intel; break; case 0x10DE: vendor = AdapterVendor.Nvidia; break; case 0x1002: vendor = AdapterVendor.AMD; break; case 0x1414: vendor = AdapterVendor.Microsoft; break; } }