forked from FFmpeg/FFmpeg
hwcontext_d3d11: Log adapter details on device creation
This is helpful to know what device has actually been used.
This commit is contained in:
parent
4af050c46e
commit
8bbf2dacbf
1 changed files with 8 additions and 1 deletions
|
@ -515,8 +515,15 @@ static int d3d11va_device_create(AVHWDeviceContext *ctx, const char *device,
|
||||||
|
|
||||||
hr = mD3D11CreateDevice(pAdapter, pAdapter ? D3D_DRIVER_TYPE_UNKNOWN : D3D_DRIVER_TYPE_HARDWARE, NULL, creationFlags, NULL, 0,
|
hr = mD3D11CreateDevice(pAdapter, pAdapter ? D3D_DRIVER_TYPE_UNKNOWN : D3D_DRIVER_TYPE_HARDWARE, NULL, creationFlags, NULL, 0,
|
||||||
D3D11_SDK_VERSION, &device_hwctx->device, NULL, NULL);
|
D3D11_SDK_VERSION, &device_hwctx->device, NULL, NULL);
|
||||||
if (pAdapter)
|
if (pAdapter) {
|
||||||
|
DXGI_ADAPTER_DESC2 desc;
|
||||||
|
hr = IDXGIAdapter2_GetDesc(pAdapter, &desc);
|
||||||
|
if (!FAILED(hr)) {
|
||||||
|
av_log(ctx, AV_LOG_INFO, "Using device %04x:%04x (%ls).\n",
|
||||||
|
desc.VendorId, desc.DeviceId, desc.Description);
|
||||||
|
}
|
||||||
IDXGIAdapter_Release(pAdapter);
|
IDXGIAdapter_Release(pAdapter);
|
||||||
|
}
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
av_log(ctx, AV_LOG_ERROR, "Failed to create Direct3D device (%lx)\n", (long)hr);
|
av_log(ctx, AV_LOG_ERROR, "Failed to create Direct3D device (%lx)\n", (long)hr);
|
||||||
return AVERROR_UNKNOWN;
|
return AVERROR_UNKNOWN;
|
||||||
|
|
Loading…
Add table
Reference in a new issue