Skip to content

Commit

Permalink
nvapi-d3d: Stub GetLatency/SetLatencyMarker
Browse files Browse the repository at this point in the history
  • Loading branch information
jp7677 committed Mar 6, 2022
1 parent e01157b commit d712221
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/nvapi_d3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,4 +147,14 @@ extern "C" {
pGetSleepStatusParams->bLowLatencyMode = nvapiD3dInstance->IsReflexEnabled();
return Ok(n);
}

NvAPI_Status __cdecl NvAPI_D3D_GetLatency(IUnknown *pDev, NV_LATENCY_RESULT_PARAMS *pGetLatencyParams) {
static bool alreadyLogged = false;
return NoImplementation(__func__, alreadyLogged);
}

NvAPI_Status __cdecl NvAPI_D3D_SetLatencyMarker(IUnknown *pDev, NV_LATENCY_MARKER_PARAMS* pSetLatencyMarkerParams) {
static bool alreadyLogged = false;
return NoImplementation(__func__, alreadyLogged);
}
}
2 changes: 2 additions & 0 deletions src/nvapi_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ extern "C" {
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_D3D_SetSleepMode)
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_D3D_GetSleepStatus)
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_D3D_Sleep)
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_D3D_GetLatency)
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_D3D_SetLatencyMarker)
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_GPU_GetGPUType)
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_GPU_GetPCIIdentifiers)
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_GPU_GetFullName)
Expand Down
12 changes: 12 additions & 0 deletions tests/nvapi_d3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,4 +215,16 @@ TEST_CASE("D3D Reflex/LatencyFleX depending methods succeed", "[.d3d]"){
REQUIRE(NvAPI_D3D_Sleep(&unknown) == NVAPI_NO_IMPLEMENTATION);
}
}

SECTION("GetLatency returns no-implementation") {
NV_LATENCY_RESULT_PARAMS params;
params.version = NV_LATENCY_RESULT_PARAMS_VER;
REQUIRE(NvAPI_D3D_GetLatency(&unknown, &params) == NVAPI_NO_IMPLEMENTATION);
}

SECTION("SetLatencyMarker returns no-implementation") {
NV_LATENCY_MARKER_PARAMS params;
params.version = NV_LATENCY_MARKER_PARAMS_VER;
REQUIRE(NvAPI_D3D_SetLatencyMarker(&unknown, &params) == NVAPI_NO_IMPLEMENTATION);
}
}

0 comments on commit d712221

Please sign in to comment.