[Bf-blender-cvs] [a34cdb08145] cycles_path_guiding: Build: auto disable path guiding if OpenPGL not found

Brecht Van Lommel noreply at git.blender.org
Tue Sep 20 21:00:36 CEST 2022


Commit: a34cdb08145daae64c678ca4fdef081a536e8b8a
Author: Brecht Van Lommel
Date:   Mon Sep 19 19:23:21 2022 +0200
Branches: cycles_path_guiding
https://developer.blender.org/rBa34cdb08145daae64c678ca4fdef081a536e8b8a

Build: auto disable path guiding if OpenPGL not found

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

M	intern/cycles/cmake/external_libs.cmake
M	tests/python/CMakeLists.txt
M	tests/python/cycles_render_tests.py

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

diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake
index 63e58642ddd..9e352972d6b 100644
--- a/intern/cycles/cmake/external_libs.cmake
+++ b/intern/cycles/cmake/external_libs.cmake
@@ -99,6 +99,10 @@ if(CYCLES_STANDALONE_REPOSITORY)
   else()
     unset(_cycles_lib_dir)
   endif()
+else()
+  if(EXISTS ${LIBDIR})
+    set(_cycles_lib_dir ${LIBDIR})
+  endif()
 endif()
 
 ###########################################################################
@@ -269,14 +273,18 @@ endif()
 ###########################################################################
 
 if(WITH_CYCLES_PATH_GUIDING)
-  if(NOT openpgl_DIR)
-    if(LIBDIR)
-      set(openpgl_DIR ${LIBDIR}/openpgl/lib/cmake/openpgl)
-      endif()
+  if(EXISTS ${_cycles_lib_dir})
+    set(openpgl_DIR ${_cycles_lib_dir}/openpgl/lib/cmake/openpgl)
+  endif()
+
+  find_package(openpgl QUIET)
+  if(openpgl_FOUND)
+    get_target_property(OPENPGL_LIBRARIES openpgl::openpgl LOCATION)
+    get_target_property(OPENPGL_INCLUDE_DIR openpgl::openpgl INTERFACE_INCLUDE_DIRECTORIES)
+  else()
+    set(WITH_CYCLES_PATH_GUIDING OFF)
+    message(STATUS "OpenPGL not found, disabling WITH_CYCLES_PATH_GUIDING")
   endif()
-  find_package(openpgl REQUIRED)
-  get_target_property(OPENPGL_LIBRARIES openpgl::openpgl LOCATION)
-  get_target_property(OPENPGL_INCLUDE_DIR openpgl::openpgl INTERFACE_INCLUDE_DIRECTORIES)
 endif()
 
 ###########################################################################
diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt
index 07bc50a7b0a..181a09b81ef 100644
--- a/tests/python/CMakeLists.txt
+++ b/tests/python/CMakeLists.txt
@@ -644,7 +644,6 @@ if(WITH_CYCLES OR WITH_OPENGL_RENDER_TESTS)
       camera
       bsdf
       hair
-      guiding
       image_colorspace
       image_data_types
       image_mapping
@@ -678,6 +677,10 @@ if(WITH_CYCLES OR WITH_OPENGL_RENDER_TESTS)
       list(APPEND render_tests denoise)
     endif()
 
+    if(WITH_CYCLES_PATH_GUIDING)
+      list(APPEND render_tests guiding)
+    endif()
+
     if(WITH_OPENGL_RENDER_TESTS)
       list(APPEND render_tests grease_pencil)
     endif()
diff --git a/tests/python/cycles_render_tests.py b/tests/python/cycles_render_tests.py
index 10ba2ce552a..4f823f854bf 100644
--- a/tests/python/cycles_render_tests.py
+++ b/tests/python/cycles_render_tests.py
@@ -56,6 +56,8 @@ BLACKLIST_GPU = [
     # Inconsistent handling of overlapping objects.
     "T41143.blend",
     "visibility_particles.blend",
+    # No path guiding on GPU.
+    "guiding*.blend",
 ]



More information about the Bf-blender-cvs mailing list