Closed Saancreed closed 3 months ago
Maybe it would be better to have the Reflex NVAPI entry points return NVAPI_INVALID_ARGUMENT if the device is null?
Maybe it would be better to have the Reflex NVAPI entry points return NVAPI_INVALID_ARGUMENT if the device is null?
Yeah, good point. I intend to also check how native NVAPI behaves on Windows here first but something like NVAPI_INVALID_ARGUMENT
or NVAPI_INVALID_POINTER
sounds likely to be the case.
Native Windows NVAPI returns -5 / NVAPI_INVALID_ARGUMENT
for NvAPI_D3D_*
Reflex entry points accepting device as IUnknown*
and -14 / NVAPI_INVALID_POINTER
for NvAPI_D3D12_*
Reflex entry points accepting ID3D12CommandQueue*
. I updated each relevant function to behave like this and added tests to verify this behavior.
I've kept the null check in GetLowLatencyDevice
for general robustness, even though it shouldn't be needed anymore. We can probably drop that commit though.
Fixes a crash in Horizon Forbidden West.