Skip to content

Commit

Permalink
nvapi: Use correct error code
Browse files Browse the repository at this point in the history
  • Loading branch information
jp7677 committed Oct 19, 2021
1 parent 9e11c95 commit 16d36c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/nvapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ extern "C" {

auto adapter = reinterpret_cast<NvapiAdapter*>(hLogicalGPU);
if (!nvapiAdapterRegistry->IsAdapter(adapter))
return ExpectedPhysicalGpuHandle(n);
return ExpectedLogicalGpuHandle(n);

hPhysicalGPU[0] = reinterpret_cast<NvPhysicalGpuHandle>(adapter);
*pGpuCount = 1;
Expand Down
5 changes: 5 additions & 0 deletions src/util/util_statuscode.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ namespace dxvk {
return NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE;
}

inline NvAPI_Status ExpectedLogicalGpuHandle(const std::string& logMessage) {
log::write(str::format(logMessage, ": Expected logical GPU handle"));
return NVAPI_EXPECTED_LOGICAL_GPU_HANDLE;
}

inline NvAPI_Status IncompatibleStructVersion(const std::string& logMessage) {
log::write(str::format(logMessage, ": Incompatible struct version"));
return NVAPI_INCOMPATIBLE_STRUCT_VERSION;
Expand Down

0 comments on commit 16d36c7

Please sign in to comment.