summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-06-23 10:23:36 +0800
committerErik Kundiman <erik@megapahit.org>2025-06-23 10:30:19 +0800
commitce7feccefb41764546a840d8e1abca12ea6e68c7 (patch)
treefac80f1c0879f5ee1365387b6d1329cb5cd13b62
parentaac750c57fbd22814958a112d6c262254243130f (diff)
No NVAPI on Windows ARM64
-rw-r--r--indra/cmake/NVAPI.cmake4
-rw-r--r--indra/newview/llappviewerwin32.cpp10
2 files changed, 12 insertions, 2 deletions
diff --git a/indra/cmake/NVAPI.cmake b/indra/cmake/NVAPI.cmake
index ff5a5428e0..1bec691a18 100644
--- a/indra/cmake/NVAPI.cmake
+++ b/indra/cmake/NVAPI.cmake
@@ -4,10 +4,10 @@ include(Prebuilt)
set(NVAPI ON CACHE BOOL "Use NVAPI.")
if (NVAPI)
- if (WINDOWS)
+ if (WINDOWS AND NOT ($ENV{MSYSTEM_CARCH} MATCHES aarch64))
add_library( ll::nvapi INTERFACE IMPORTED )
target_link_libraries( ll::nvapi INTERFACE nvapi)
use_prebuilt_binary(nvapi)
- endif (WINDOWS)
+ endif ()
endif (NVAPI)
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index 4f5fa53312..3e51a900ce 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -47,8 +47,10 @@
#include "llviewercontrol.h"
#include "lldxhardware.h"
+#if !_M_ARM64
#include "nvapi/nvapi.h"
#include "nvapi/NvApiDriverSettings.h"
+#endif
#include <stdlib.h>
@@ -206,6 +208,7 @@ LONG WINAPI catchallCrashHandler(EXCEPTION_POINTERS * /*ExceptionInfo*/)
const std::string LLAppViewerWin32::sWindowClass = "Second Life";
+#if !_M_ARM64
/*
This function is used to print to the command line a text message
describing the nvapi error and quits
@@ -219,6 +222,7 @@ void nvapi_error(NvAPI_Status status)
//should always trigger when asserts are enabled
//llassert(status == NVAPI_OK);
}
+#endif
// Create app mutex creates a unique global windows object.
// If the object can be created it returns true, otherwise
@@ -241,6 +245,7 @@ bool create_app_mutex()
return result;
}
+#if !_M_ARM64
void ll_nvapi_init(NvDRSSessionHandle hSession)
{
// (2) load all the system settings into the session
@@ -395,6 +400,7 @@ void ll_nvapi_init(NvDRSSessionHandle hSession)
return;
}
}
+#endif
//#define DEBUGGING_SEH_FILTER 1
#if DEBUGGING_SEH_FILTER
@@ -464,6 +470,7 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
return -1;
}
+#if !_M_ARM64
NvDRSSessionHandle hSession = 0;
static LLCachedControl<bool> use_nv_api(gSavedSettings, "NvAPICreateApplicationProfile", true);
if (use_nv_api)
@@ -488,6 +495,7 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
}
}
}
+#endif
// Have to wait until after logging is initialized to display LFH info
if (num_heaps > 0)
@@ -545,12 +553,14 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,
delete viewer_app_ptr;
viewer_app_ptr = NULL;
+#if !_M_ARM64
// (NVAPI) (6) We clean up. This is analogous to doing a free()
if (hSession)
{
NvAPI_DRS_DestroySession(hSession);
hSession = 0;
}
+#endif
return 0;
}