IDXGIAdapter::GetDesc
Retrieves a description of the graphics adapter.
Syntax
HRESULT GetDesc(
[out] DXGI_ADAPTER_DESC *pDesc
);
Parameters
Parameter | Description |
---|---|
pDesc |
A pointer to a DXGI_ADAPTER_DESC structure that receives a description of the adapter. |
Return value
On success, returns S_OK. On failure, returns one of the DXGI error codes described in DXGI Error Codes.
Remarks
This function retrieves a description of the graphics adapter (which corresponds to a display adapter). The description includes information such as the adapter's description string, vendor ID, device ID, and memory size.
The adapter description string is useful for identifying the specific graphics hardware. The vendor ID and device ID can be used to look up more detailed information about the hardware from manufacturer websites or system information tools.
The DXGI_ADAPTER_DESC structure contains the following members:
Description
: ALPCWSTR
string that contains the adapter description.VendorId
: The adapter's PCI vendor identifier.DeviceId
: The adapter's PCI device identifier.SubSysId
: The adapter's PCI subsystem identifier.Revision
: The adapter's PCI revision number.DedicatedVideoMemory
: The amount of dedicated video memory.DedicatedSystemMemory
: The amount of dedicated system memory.SharedSystemMemory
: The amount of shared system memory.AdapterLuid
: ALUID
that represents the adapter.
Example
#include <dxgi.h>
#include <wrl.h> // For Microsoft::WRL::ComPtr
// ...
Microsoft::WRL::ComPtr<IDXGIAdapter> pAdapter;
// Assume pAdapter is already initialized and points to a valid adapter
DXGI_ADAPTER_DESC adapterDesc;
HRESULT hr = pAdapter->GetDesc(&adapterDesc);
if (SUCCEEDED(hr))
{
wprintf(L"Adapter Description: %s\n", adapterDesc.Description);
wprintf(L"Vendor ID: 0x%X\n", adapterDesc.VendorId);
wprintf(L"Device ID: 0x%X\n", adapterDesc.DeviceId);
wprintf(L"Dedicated Video Memory: %I64u bytes\n", adapterDesc.DedicatedVideoMemory);
}
else
{
// Handle error
fwprintf(stderr, L"Failed to get adapter description: %ld\n", hr);
}
Note
The values in DedicatedVideoMemory
, DedicatedSystemMemory
, and SharedSystemMemory
are given in bytes.
Requirements
Minimum supported client | Windows 7 [desktop apps | UWP apps ] |
Minimum supported server | Windows Server 2008 R2 [desktop apps | UWP apps ] |
Header | dxgi.h |
Library | dxgi.lib |
DLL | dxgi.dll |