Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jp7677/dxvk-nvapi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Peters <jp7677@gmail.com>2021-12-08 23:01:15 +0300
committerJens Peters <jp7677@gmail.com>2022-01-27 09:09:23 +0300
commit1644008a7eb9d5b3534807af16f9c3125d195ab2 (patch)
treefd4a9f0cc348a1f36cb7755554860dee072c2ae7
parent04b9dbdc3492ebba37b612374d499ab023a0d89a (diff)
nvapi-d3d: Add NvAPI_D3D_ImplicitSLIControl
-rw-r--r--src/nvapi_d3d.cpp9
-rw-r--r--src/nvapi_interface.cpp1
-rw-r--r--tests/nvapi_d3d.cpp10
3 files changed, 19 insertions, 1 deletions
diff --git a/src/nvapi_d3d.cpp b/src/nvapi_d3d.cpp
index 58bee63..88c20cc 100644
--- a/src/nvapi_d3d.cpp
+++ b/src/nvapi_d3d.cpp
@@ -52,6 +52,15 @@ extern "C" {
return Ok(n, alreadyLoggedOk);
}
+ NvAPI_Status __cdecl NvAPI_D3D_ImplicitSLIControl(IMPLICIT_SLI_CONTROL implicitSLIControl) {
+ constexpr auto n = __func__;
+
+ if (implicitSLIControl == ENABLE_IMPLICIT_SLI)
+ return Error(n); // No SLI with this implementation
+
+ return Ok(n);
+ }
+
NvAPI_Status __cdecl NvAPI_D3D1x_GetGraphicsCapabilities(IUnknown *pDevice,
NvU32 structVersion,
NV_D3D1x_GRAPHICS_CAPS *pGraphicsCaps) {
diff --git a/src/nvapi_interface.cpp b/src/nvapi_interface.cpp
index f90b2f7..80f6e4e 100644
--- a/src/nvapi_interface.cpp
+++ b/src/nvapi_interface.cpp
@@ -70,6 +70,7 @@ extern "C" {
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_D3D_GetObjectHandleForResource)
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_D3D_SetResourceHint)
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_D3D_GetCurrentSLIState)
+ INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_D3D_ImplicitSLIControl)
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_D3D_BeginResourceRendering)
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_D3D_EndResourceRendering)
INSERT_AND_RETURN_WHEN_EQUALS(NvAPI_GPU_GetGPUType)
diff --git a/tests/nvapi_d3d.cpp b/tests/nvapi_d3d.cpp
index 46f69b6..f70789a 100644
--- a/tests/nvapi_d3d.cpp
+++ b/tests/nvapi_d3d.cpp
@@ -13,7 +13,7 @@ TEST_CASE("D3D methods succeed", "[.d3d]") {
REQUIRE(NvAPI_D3D_SetResourceHint(&unknown, NVDX_ObjectHandle(), NVAPI_D3D_SRH_CATEGORY_SLI, 1, &value) == NVAPI_NO_IMPLEMENTATION);
}
- SECTION("SetResourceHint returns NoImplementation") {
+ SECTION("SetResourceHint returns no-implementation") {
REQUIRE(NvAPI_D3D_SetResourceHint(&unknown, NVDX_ObjectHandle(), NVAPI_D3D_SRH_CATEGORY_SLI, 0, nullptr) == NVAPI_NO_IMPLEMENTATION);
}
@@ -38,6 +38,14 @@ TEST_CASE("D3D methods succeed", "[.d3d]") {
REQUIRE(state.numVRSLIGpus == 0);
}
+ SECTION("ImplicitSLIControl returns OK") {
+ REQUIRE(NvAPI_D3D_ImplicitSLIControl(DISABLE_IMPLICIT_SLI) == NVAPI_OK);
+ }
+
+ SECTION("ImplicitSLIControl returns error when enabling SLI") {
+ REQUIRE(NvAPI_D3D_ImplicitSLIControl(ENABLE_IMPLICIT_SLI) == NVAPI_ERROR);
+ }
+
SECTION("GetGraphicsCapabilities (V1) returns OK") {
NV_D3D1x_GRAPHICS_CAPS_V1 caps;
REQUIRE(NvAPI_D3D1x_GetGraphicsCapabilities(&unknown, NV_D3D1x_GRAPHICS_CAPS_VER1, reinterpret_cast<NV_D3D1x_GRAPHICS_CAPS*>(&caps)) == NVAPI_OK);