[Bf-blender-cvs] [7691ba9d540] tmp_arcpath-D11868: Cycles: make OptiX 7.3 the minimum required SDK version [WIP]

Brecht Van Lommel noreply at git.blender.org
Tue Jul 13 18:58:34 CEST 2021


Commit: 7691ba9d540c7c7a7240504ce2c68955a27ef169
Author: Brecht Van Lommel
Date:   Tue Jul 13 18:48:22 2021 +0200
Branches: tmp_arcpath-D11868
https://developer.blender.org/rB7691ba9d540c7c7a7240504ce2c68955a27ef169

Cycles: make OptiX 7.3 the minimum required SDK version [WIP]

This is will be done in the cycles-x branch, this is just a temporary patch
so we can test it on the buildbot which assumes master.

Differential Revision: https://developer.blender.org/D11868

===================================================================

M	build_files/cmake/Modules/FindOptiX.cmake
M	build_files/config/pipeline_config.json
M	intern/cycles/CMakeLists.txt

===================================================================

diff --git a/build_files/cmake/Modules/FindOptiX.cmake b/build_files/cmake/Modules/FindOptiX.cmake
index cfcdd9cd23b..67106740f57 100644
--- a/build_files/cmake/Modules/FindOptiX.cmake
+++ b/build_files/cmake/Modules/FindOptiX.cmake
@@ -33,11 +33,23 @@ FIND_PATH(OPTIX_INCLUDE_DIR
     include
 )
 
+IF(EXISTS "${OPTIX_INCLUDE_DIR}/optix.h")
+  FILE(STRINGS "${OPTIX_INCLUDE_DIR}/optix.h" _optix_version REGEX "^#define OPTIX_VERSION[ \t].*$")
+  STRING(REGEX MATCHALL "[0-9]+" _optix_version ${_optix_version})
+
+  MATH(EXPR _optix_version_major "${_optix_version} / 10000")
+  MATH(EXPR _optix_version_minor "(${_optix_version} % 10000) / 100")
+  MATH(EXPR _optix_version_patch "${_optix_version} % 100")
+
+  SET(OPTIX_VERSION "${_optix_version_major}.${_optix_version_minor}.${_optix_version_patch}")
+ENDIF()
+
 # handle the QUIETLY and REQUIRED arguments and set OPTIX_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(OptiX DEFAULT_MSG
-    OPTIX_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OptiX
+    REQUIRED_VARS OPTIX_INCLUDE_DIR
+    VERSION_VAR OPTIX_VERSION)
 
 IF(OPTIX_FOUND)
   SET(OPTIX_INCLUDE_DIRS ${OPTIX_INCLUDE_DIR})
@@ -45,6 +57,7 @@ ENDIF()
 
 MARK_AS_ADVANCED(
   OPTIX_INCLUDE_DIR
+  OPTIX_VERSION
 )
 
 UNSET(_optix_SEARCH_DIRS)
diff --git a/build_files/config/pipeline_config.json b/build_files/config/pipeline_config.json
index c9a5e25eaaf..a353d35bd6c 100644
--- a/build_files/config/pipeline_config.json
+++ b/build_files/config/pipeline_config.json
@@ -33,7 +33,7 @@
         {
             "optix":
             {
-                "version": "7.1.0"
+                "version": "7.3.0"
             },
             "cuda10":
             {
diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt
index b01bf1bd1e2..736481a5be7 100644
--- a/intern/cycles/CMakeLists.txt
+++ b/intern/cycles/CMakeLists.txt
@@ -247,7 +247,7 @@ if(WITH_CYCLES_OSL)
 endif()
 
 if(WITH_CYCLES_DEVICE_OPTIX)
-  find_package(OptiX)
+  find_package(OptiX 7.3.0)
 
   if(OPTIX_FOUND)
     add_definitions(-DWITH_OPTIX)



More information about the Bf-blender-cvs mailing list