mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-09-13 09:16:14 -07:00
tests: Print adapter info on Windows.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
09f667ce4e
commit
b4d2306b9b
@ -38,7 +38,6 @@ typedef enum DXGI_MODE_ROTATION
|
||||
DXGI_MODE_ROTATION_ROTATE270 = 0x4,
|
||||
} DXGI_MODE_ROTATION;
|
||||
|
||||
interface IDXGIAdapter;
|
||||
interface IDXGIAdapter1;
|
||||
interface IDXGIOutput;
|
||||
typedef struct DXGI_SWAP_CHAIN_DESC DXGI_SWAP_CHAIN_DESC;
|
||||
@ -54,6 +53,19 @@ const DXGI_USAGE DXGI_USAGE_READ_ONLY = 0x00000100ul;
|
||||
const DXGI_USAGE DXGI_USAGE_DISCARD_ON_PRESENT = 0x00000200ul;
|
||||
const DXGI_USAGE DXGI_USAGE_UNORDERED_ACCESS = 0x00000400ul;
|
||||
|
||||
typedef struct DXGI_ADAPTER_DESC
|
||||
{
|
||||
WCHAR Description[128];
|
||||
UINT VendorId;
|
||||
UINT DeviceId;
|
||||
UINT SubSysId;
|
||||
UINT Revision;
|
||||
SIZE_T DedicatedVideoMemory;
|
||||
SIZE_T DedicatedSystemMemory;
|
||||
SIZE_T SharedSystemMemory;
|
||||
LUID AdapterLuid;
|
||||
} DXGI_ADAPTER_DESC;
|
||||
|
||||
[
|
||||
local,
|
||||
object,
|
||||
@ -79,6 +91,18 @@ interface IDXGIDeviceSubObject : IDXGIObject
|
||||
HRESULT GetDevice(REFIID riid, void **device);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
local,
|
||||
uuid(2411e7e1-12ac-4ccf-bd14-9798e8534dc0)
|
||||
]
|
||||
interface IDXGIAdapter : IDXGIObject
|
||||
{
|
||||
HRESULT EnumOutputs(UINT output_idx, IDXGIOutput **output);
|
||||
HRESULT GetDesc(DXGI_ADAPTER_DESC *desc);
|
||||
HRESULT CheckInterfaceSupport(REFGUID guid, void *umd_version);
|
||||
}
|
||||
|
||||
[
|
||||
local,
|
||||
object,
|
||||
|
@ -890,18 +890,41 @@ static IUnknown *create_adapter(void)
|
||||
return adapter;
|
||||
}
|
||||
|
||||
if (use_adapter_idx)
|
||||
hr = IDXGIFactory4_EnumAdapters(factory, use_adapter_idx, (IDXGIAdapter **)&adapter);
|
||||
hr = IDXGIFactory4_EnumAdapters(factory, use_adapter_idx, (IDXGIAdapter **)&adapter);
|
||||
IDXGIFactory4_Release(factory);
|
||||
if (FAILED(hr))
|
||||
trace("Failed to get adapter, hr %#x.\n", hr);
|
||||
return adapter;
|
||||
}
|
||||
|
||||
static void print_adapter_info(void)
|
||||
{
|
||||
IDXGIAdapter *dxgi_adapter;
|
||||
DXGI_ADAPTER_DESC desc;
|
||||
IUnknown *adapter;
|
||||
HRESULT hr;
|
||||
|
||||
if (!(adapter = create_adapter()))
|
||||
return;
|
||||
|
||||
hr = IUnknown_QueryInterface(adapter, &IID_IDXGIAdapter, (void **)&dxgi_adapter);
|
||||
ok(hr == S_OK, "Failed to query IDXGIAdapter, hr %#x.\n", hr);
|
||||
IUnknown_Release(adapter);
|
||||
|
||||
hr = IDXGIAdapter_GetDesc(dxgi_adapter, &desc);
|
||||
ok(hr == S_OK, "Failed to get adapter desc, hr %#x.\n", hr);
|
||||
|
||||
trace("Adapter: %04x:%04x.\n", desc.VendorId, desc.DeviceId);
|
||||
|
||||
IDXGIAdapter_Release(dxgi_adapter);
|
||||
}
|
||||
#else
|
||||
static IUnknown *create_adapter(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void print_adapter_info(void) {}
|
||||
#endif
|
||||
|
||||
static ID3D12Device *create_device(void)
|
||||
@ -21923,6 +21946,8 @@ START_TEST(d3d12)
|
||||
ID3D12Debug_Release(debug);
|
||||
}
|
||||
|
||||
print_adapter_info();
|
||||
|
||||
run_test(test_create_device);
|
||||
run_test(test_node_count);
|
||||
run_test(test_check_feature_support);
|
||||
|
Loading…
Reference in New Issue
Block a user