From 0de0950ad5d1de5172cbd2b6b0e67fe319a420c1 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 6 Apr 2022 22:25:40 +0200 Subject: Cycles: various Linux build fixes related to Hydra render delegate * Add missing GLEW and hgiGL libraries for Hydra * Fix wrong case sensitive include * Fix link errors by adding external libs to static Hydra lib * Work around weird Hydra link error with MAX_SAMPLES * Use Embree by default for Hydra * Sync external libs code with standalone * Update version number to match Blender * Remove unneeded CLEW/GLEW from test executable None of this should affect Cycles in Blender. Ref T96731 --- intern/cycles/hydra/CMakeLists.txt | 18 ++++++++++-------- intern/cycles/hydra/plugin.cpp | 2 +- intern/cycles/hydra/render_delegate.cpp | 3 ++- 3 files changed, 13 insertions(+), 10 deletions(-) (limited to 'intern/cycles/hydra') diff --git a/intern/cycles/hydra/CMakeLists.txt b/intern/cycles/hydra/CMakeLists.txt index d632cd01a02..72d5d0e3bf7 100644 --- a/intern/cycles/hydra/CMakeLists.txt +++ b/intern/cycles/hydra/CMakeLists.txt @@ -13,6 +13,14 @@ set(INC_SYS ${GLEW_INCLUDE_DIR} ) +set(LIB + cycles_scene + cycles_session + cycles_graph + ${CYCLES_GLEW_LIBRARIES} +) +cycles_external_libraries_append(LIB) + set(INC_HD_CYCLES attribute.h camera.h @@ -63,9 +71,6 @@ if(WITH_OPENVDB) list(APPEND INC_SYS ${OPENVDB_INCLUDE_DIRS} ) - list(APPEND LIB - ${OPENVDB_LIBRARIES} - ) endif() include_directories(${INC}) @@ -94,10 +99,9 @@ target_link_libraries(hdCyclesStatic PUBLIC hd hgi + hgiGL PRIVATE - cycles_scene - cycles_session - cycles_graph + ${LIB} ) set(HdCyclesPluginName hdCycles) @@ -124,8 +128,6 @@ target_link_libraries(${HdCyclesPluginName} hdCyclesStatic ) -cycles_target_link_libraries(${HdCyclesPluginName}) - if(WITH_CYCLES_BLENDER) set(CYCLES_HYDRA_INSTALL_PATH "../") else() diff --git a/intern/cycles/hydra/plugin.cpp b/intern/cycles/hydra/plugin.cpp index 8caca3068df..2cbe232334a 100644 --- a/intern/cycles/hydra/plugin.cpp +++ b/intern/cycles/hydra/plugin.cpp @@ -7,7 +7,7 @@ #include "util/log.h" #include "util/path.h" -#include +#include #include #include #include diff --git a/intern/cycles/hydra/render_delegate.cpp b/intern/cycles/hydra/render_delegate.cpp index 748b6a66e1e..a954c3e4d72 100644 --- a/intern/cycles/hydra/render_delegate.cpp +++ b/intern/cycles/hydra/render_delegate.cpp @@ -457,8 +457,9 @@ void HdCyclesDelegate::SetRenderSetting(const PXR_NS::TfToken &key, const PXR_NS VtValue::Cast(value).GetWithDefault(session->params.time_limit)); } else if (key == HdCyclesRenderSettingsTokens->samples) { + static const int max_samples = Integrator::MAX_SAMPLES; int samples = VtValue::Cast(value).GetWithDefault(session->params.samples); - samples = std::min(std::max(1, samples), Integrator::MAX_SAMPLES); + samples = std::min(std::max(1, samples), max_samples); session->set_samples(samples); } else if (key == HdCyclesRenderSettingsTokens->sample_offset) { -- cgit v1.2.3