2023-08-16 00:20:26 +10:00
|
|
|
# SPDX-FileCopyrightText: 2019 Blender Authors
|
2023-06-14 22:49:59 +10:00
|
|
|
#
|
2022-02-11 14:23:56 +11:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
|
2019-09-12 14:50:06 +02:00
|
|
|
# - Find OptiX library
|
|
|
|
|
# Find the native OptiX includes and library
|
|
|
|
|
# This module defines
|
|
|
|
|
# OPTIX_INCLUDE_DIRS, where to find optix.h, Set when
|
|
|
|
|
# OPTIX_INCLUDE_DIR is found.
|
|
|
|
|
# OPTIX_ROOT_DIR, The base directory to search for OptiX.
|
|
|
|
|
# This can also be an environment variable.
|
|
|
|
|
# OPTIX_FOUND, If false, do not try to use OptiX.
|
|
|
|
|
|
2024-03-01 16:22:06 +11:00
|
|
|
if(NOT (DEFINED OPTIX_ROOT_DIR))
|
|
|
|
|
set(OPTIX_ROOT_DIR "")
|
|
|
|
|
endif()
|
|
|
|
|
|
2023-07-29 13:47:55 +10:00
|
|
|
# If `OPTIX_ROOT_DIR` was defined in the environment, use it.
|
2024-03-01 16:22:06 +11:00
|
|
|
if(OPTIX_ROOT_DIR)
|
2023-07-29 13:47:55 +10:00
|
|
|
# Pass.
|
2023-08-17 13:15:56 +10:00
|
|
|
elseif(DEFINED ENV{OPTIX_ROOT_DIR})
|
|
|
|
|
set(OPTIX_ROOT_DIR $ENV{OPTIX_ROOT_DIR})
|
|
|
|
|
endif()
|
2019-09-12 14:50:06 +02:00
|
|
|
|
2023-08-17 13:15:56 +10:00
|
|
|
set(_optix_SEARCH_DIRS
|
2019-09-12 14:50:06 +02:00
|
|
|
${OPTIX_ROOT_DIR}
|
|
|
|
|
)
|
|
|
|
|
|
2023-01-19 17:07:23 +11:00
|
|
|
# TODO: Which environment uses this?
|
|
|
|
|
if(DEFINED ENV{PROGRAMDATA})
|
2024-10-07 11:22:57 +02:00
|
|
|
list(APPEND _optix_SEARCH_DIRS
|
|
|
|
|
"$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 7.4.0"
|
|
|
|
|
"$ENV{PROGRAMDATA}/NVIDIA Corporation/OptiX SDK 7.3.0"
|
|
|
|
|
)
|
2023-01-19 17:07:23 +11:00
|
|
|
endif()
|
|
|
|
|
|
2023-08-17 13:15:56 +10:00
|
|
|
find_path(OPTIX_INCLUDE_DIR
|
2019-09-12 14:50:06 +02:00
|
|
|
NAMES
|
|
|
|
|
optix.h
|
|
|
|
|
HINTS
|
|
|
|
|
${_optix_SEARCH_DIRS}
|
|
|
|
|
PATH_SUFFIXES
|
|
|
|
|
include
|
|
|
|
|
)
|
|
|
|
|
|
2023-08-17 13:15:56 +10:00
|
|
|
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})
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
|
2023-08-17 13:15:56 +10:00
|
|
|
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")
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
|
2023-08-17 13:15:56 +10:00
|
|
|
set(OPTIX_VERSION "${_optix_version_major}.${_optix_version_minor}.${_optix_version_patch}")
|
|
|
|
|
endif()
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
|
2019-09-12 14:50:06 +02:00
|
|
|
# handle the QUIETLY and REQUIRED arguments and set OPTIX_FOUND to TRUE if
|
|
|
|
|
# all listed variables are TRUE
|
2023-08-17 13:15:56 +10:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
|
find_package_handle_standard_args(OptiX
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
REQUIRED_VARS OPTIX_INCLUDE_DIR
|
|
|
|
|
VERSION_VAR OPTIX_VERSION)
|
2019-09-12 14:50:06 +02:00
|
|
|
|
2023-08-17 13:15:56 +10:00
|
|
|
if(OPTIX_FOUND)
|
|
|
|
|
set(OPTIX_INCLUDE_DIRS ${OPTIX_INCLUDE_DIR})
|
|
|
|
|
endif()
|
2019-09-12 14:50:06 +02:00
|
|
|
|
2023-08-17 13:15:56 +10:00
|
|
|
mark_as_advanced(
|
2019-09-12 14:50:06 +02:00
|
|
|
OPTIX_INCLUDE_DIR
|
Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.
Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.
Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles
Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)
For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.
Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-20 17:59:20 +02:00
|
|
|
OPTIX_VERSION
|
2019-09-12 14:50:06 +02:00
|
|
|
)
|
|
|
|
|
|
2023-08-17 13:15:56 +10:00
|
|
|
unset(_optix_SEARCH_DIRS)
|