Completely ignore non-dx use of nvenc

This commit is contained in:
baldurk
2021-07-07 10:13:23 +01:00
parent fc08cb17f9
commit ca0b4eabf3
+14
View File
@@ -637,6 +637,13 @@ private:
return NV_ENC_ERR_INVALID_PTR;
}
if(devType != NV_ENC_DEVICE_TYPE_DIRECTX)
{
RDCWARN("Unsupported device type %d in encode session, passing through but this may break!",
devType);
return nvhooks.real_nvEncOpenEncodeSession(device, devType, encoder);
}
INVAPID3DDevice *nvapiDev = NULL;
HRESULT hr = ((IUnknown *)device)->QueryInterface(__uuidof(INVAPID3DDevice), (void **)&nvapiDev);
@@ -658,6 +665,13 @@ private:
return NV_ENC_ERR_INVALID_PTR;
}
if(params->deviceType != NV_ENC_DEVICE_TYPE_DIRECTX)
{
RDCWARN("Unsupported device type %d in encode session, passing through but this may break!",
params->deviceType);
return nvhooks.real_nvEncOpenEncodeSessionEx(params, encoder);
}
// attempt to unwrap the handle in place
void *origDevice = params->device;