Cycles shared library #1

Open
Alex Fuller wants to merge 1 commits from boberfly/cycles:cycles_shared_lib into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
24 changed files with 371 additions and 60 deletions
Showing only changes of commit be5f561005 - Show all commits

View File

@ -167,6 +167,9 @@ option(WITH_CYCLES_HYDRA_RENDER_DELEGATE "Build Cycles Hydra render delegate" ON
# Error Checking
option(WITH_STRICT_BUILD_OPTIONS "When requirements for a build option are not met, error instead of disabling the option" OFF)
# Cycles Shared Library
option(WITH_CYCLES_SHARED_LIBRARY "Build the Cycles library as a shared library. App and the Hydra delegate will link to this instead of static-linking." ON)
###########################################################################
# Configuration.

View File

@ -194,9 +194,14 @@ add_definitions(
${OPENIMAGEIO_DEFINITIONS}
)
set(CCL_NAMESPACE_BEGIN "namespace\ cycles\ {")
set(CCL_NAMESPACE_END "}")
set(CCL_NS "cycles")
add_definitions(
-DCCL_NAMESPACE_BEGIN=namespace\ ccl\ {
-DCCL_NAMESPACE_BEGIN=namespace\ cycles\ {
-DCCL_NAMESPACE_END=}
-DCCL_NS=cycles
)
include_directories(
@ -365,6 +370,7 @@ if(WITH_CYCLES_PATH_GUIDING)
# 4 = 3 + training the guiding fields
# 5 = 4 + querying the trained guiding for sampling (full path guiding)
add_definitions(-DPATH_GUIDING_LEVEL=5)
set(PATH_GUIDING_LEVEL "5")
include_directories(
SYSTEM
@ -454,3 +460,77 @@ endif()
if(NOT WITH_BLENDER)
delayed_do_install()
endif()
# Cycles API
if(WITH_CYCLES_SHARED_LIBRARY)
set(LIB)
set(SRC_HEADERS
cycles.h
)
set(OBJECT_LIB
$<TARGET_OBJECTS:cycles_device>
$<TARGET_OBJECTS:cycles_kernel>
$<TARGET_OBJECTS:cycles_scene>
$<TARGET_OBJECTS:cycles_session>
$<TARGET_OBJECTS:cycles_bvh>
$<TARGET_OBJECTS:cycles_subd>
$<TARGET_OBJECTS:cycles_graph>
$<TARGET_OBJECTS:cycles_util>
$<TARGET_OBJECTS:cycles_integrator>
)
if(WITH_CYCLES_OSL)
list(APPEND OBJECT_LIB $<TARGET_OBJECTS:cycles_kernel_osl>)
endif()
if(CYCLES_STANDALONE_REPOSITORY)
list(APPEND LIB extern_sky)
else()
list(APPEND LIB bf_intern_sky)
endif()
cycles_external_libraries_append(LIB)
add_library(cycles_library SHARED ${SRC_HEADERS} ${OBJECT_LIB})
set_target_properties(cycles_library PROPERTIES OUTPUT_NAME "cycles")
set_target_properties(cycles_library PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS true)
target_link_libraries(cycles_library PRIVATE ${LIB})
install(TARGETS
cycles_library
DESTINATION ${CMAKE_INSTALL_PREFIX}
)
endif()
if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_SHARED_LIBRARY)
configure_file(cycles_config.h.in cycles_config.h @ONLY)
install(FILES
${CMAKE_BINARY_DIR}/src/cycles_config.h
DESTINATION ${CMAKE_INSTALL_PREFIX}/include
)
install(FILES
cycles.h
DESTINATION ${CMAKE_INSTALL_PREFIX}/include
)
if(CYCLES_STANDALONE_REPOSITORY)
install(FILES
../third_party/atomic/atomic_ops.h
../third_party/sky/include/sky_model.h
DESTINATION ${CMAKE_INSTALL_PREFIX}/include
)
install(FILES
../third_party/atomic/intern/atomic_ops_msvc.h
../third_party/atomic/intern/atomic_ops_utils.h
../third_party/atomic/intern/atomic_ops_unix.h
../third_party/atomic/intern/atomic_ops_ext.h
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/intern
)
endif()
endif()

View File

@ -12,6 +12,9 @@ set(INC_SYS
)
set(LIB
)
set(CYCLES_LIB
cycles_device
cycles_kernel
cycles_scene
@ -22,6 +25,8 @@ set(LIB
cycles_util
)
set(USD_LIB)
if(WITH_ALEMBIC)
add_definitions(-DWITH_ALEMBIC)
list(APPEND INC_SYS
@ -33,7 +38,7 @@ if(WITH_ALEMBIC)
endif()
if(WITH_CYCLES_OSL)
list(APPEND LIB cycles_kernel_osl)
list(APPEND CYCLES_LIB cycles_kernel_osl)
endif()
if(CYCLES_STANDALONE_REPOSITORY)
@ -60,7 +65,7 @@ if(WITH_USD)
list(APPEND INC_SYS
${USD_INCLUDE_DIRS}
)
list(APPEND LIB
list(APPEND USD_LIB
cycles_hydra
${USD_LIBRARIES}
)
@ -98,7 +103,11 @@ if(WITH_CYCLES_STANDALONE)
add_executable(cycles ${SRC} ${INC} ${INC_SYS})
unset(SRC)
target_link_libraries(cycles PRIVATE ${LIB})
if(WITH_CYCLES_SHARED_LIBRARY)
target_link_libraries(cycles PUBLIC cycles_library ${USD_LIB})
else()
target_link_libraries(cycles PRIVATE ${CYCLES_LIB} ${LIB} ${USD_LIB})
endif()
if(APPLE)
if(WITH_CYCLES_STANDALONE_GUI)

View File

@ -528,7 +528,7 @@ static void options_parse(int argc, const char **argv)
CCL_NAMESPACE_END
using namespace ccl;
using namespace cycles;
int main(int argc, const char **argv)
{

View File

@ -64,3 +64,7 @@ if(WITH_CYCLES_EMBREE)
endif()
cycles_add_library(cycles_bvh "${LIB}" ${SRC} ${SRC_HEADERS})
if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_SHARED_LIBRARY)
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_HEADERS}" ${CYCLES_INSTALL_PATH}/include/bvh)
endif()

63
src/cycles.h Normal file
View File

@ -0,0 +1,63 @@
/* SPDX-License-Identifier: Apache-2.0
* Copyright 2011-2023 Blender Foundation */
#ifndef __CYCLES_H__
#define __CYCLES_H__
#include "cycles_config.h"
#include "bvh/params.h"
#include "device/device.h"
#include "graph/node.h"
#include "graph/node_type.h"
#include "kernel/types.h"
#include "scene/background.h"
#include "scene/attribute.h"
#include "scene/camera.h"
#include "scene/curves.h"
#include "scene/film.h"
#include "scene/geometry.h"
#include "scene/shader_graph.h"
#include "scene/hair.h"
#include "scene/image.h"
#include "scene/image_vdb.h"
#include "scene/integrator.h"
#include "scene/light.h"
#include "scene/mesh.h"
#include "scene/pass.h"
#include "scene/pointcloud.h"
#include "scene/shader.h"
#include "scene/shader_graph.h"
#include "scene/shader_nodes.h"
#include "scene/object.h"
#include "scene/osl.h"
#include "scene/scene.h"
#include "scene/shader_nodes.h"
#include "scene/volume.h"
#include "session/buffers.h"
#include "session/display_driver.h"
#include "session/output_driver.h"
#include "session/session.h"
#include "subd/dice.h"
#include "util/args.h"
#include "util/array.h"
#include "util/foreach.h"
#include "util/function.h"
#include "util/half.h"
#include "util/hash.h"
#include "util/image.h"
#include "util/log.h"
#include "util/murmurhash.h"
#include "util/openimagedenoise.h"
#include "util/path.h"
#include "util/param.h"
#include "util/progress.h"
#include "util/string.h"
#include "util/thread.h"
#include "util/time.h"
#include "util/transform.h"
#include "util/unique_ptr.h"
#include "util/vector.h"
#include "util/version.h"
#endif /* __CYCLES_H__ */

109
src/cycles_config.h.in Normal file
View File

@ -0,0 +1,109 @@
/* SPDX-License-Identifier: Apache-2.0
* Copyright 2011-2023 Blender Foundation */
#ifndef __CYCLES_CONFIG_H__
#define __CYCLES_CONFIG_H__
#define CCL_NAMESPACE_BEGIN @CCL_NAMESPACE_BEGIN@
#define CCL_NAMESPACE_END @CCL_NAMESPACE_END@
#define CCL_NS @CCL_NS@
#define CCL_NAMESPACE_USING_DIRECTIVE using namespace CCL_NS;
#cmakedefine WITH_CYCLES_DEBUG
#cmakedefine WITH_CYCLES_STANDALONE_GUI
#cmakedefine WITH_CYCLES_PTEX
#ifdef WITH_CYCLES_PTEX
# define WITH_PTEX
#endif
#cmakedefine WITH_CYCLES_OSL
#ifdef WITH_CYCLES_OSL
# define WITH_OSL
#endif
#cmakedefine WITH_CYCLES_DEVICE_CUDA
#ifdef WITH_CYCLES_DEVICE_CUDA
# define WITH_CUDA
#endif
#cmakedefine WITH_CYCLES_DEVICE_OPTIX
#ifdef WITH_CYCLES_DEVICE_OPTIX
# define WITH_OPTIX
#endif
#cmakedefine WITH_CYCLES_DEVICE_HIP
#ifdef WITH_CYCLES_DEVICE_HIP
# define WITH_HIP
#endif
#cmakedefine WITH_CYCLES_DEVICE_METAL
#ifdef WITH_CYCLES_DEVICE_METAL
# define WITH_METAL
#endif
#cmakedefine WITH_CYCLES_DEVICE_ONEAPI
#ifdef WITH_CYCLES_DEVICE_ONEAPI
# define WITH_ONEAPI
#endif
#cmakedefine WITH_CYCLES_EMBREE
#ifdef WITH_CYCLES_EMBREE
# define WITH_EMBREE
#endif
#cmakedefine WITH_CYCLES_OPENIMAGEDENOISE
#ifdef WITH_CYCLES_OPENIMAGEDENOISE
# define WITH_OPENIMAGEDENOISE
#endif
#cmakedefine WITH_CYCLES_LOGGING
#ifdef WITH_CYCLES_LOGGING
# define CYCLES_GFLAGS_NAMESPACE=@GFLAGS_NAMESPACE@
#endif
#cmakedefine WITH_CYCLES_ALEMBIC
#ifdef WITH_CYCLES_ALEMBIC
# define WITH_ALEMBIC
#endif
#cmakedefine WITH_CYCLES_OPENVDB
#ifdef WITH_CYCLES_OPENVDB
# define WITH_OPENVDB
#endif
#cmakedefine WITH_CYCLES_NANOVDB
#ifdef WITH_CYCLES_NANOVDB
# define WITH_NANOVDB
#endif
#cmakedefine WITH_CYCLES_OPENSUBDIV
#ifdef WITH_CYCLES_OPENSUBDIV
# define WITH_OPENSUBDIV
#endif
#cmakedefine WITH_CYCLES_OPENCOLORIO
#ifdef WITH_CYCLES_OPENCOLORIO
# define WITH_OPENCOLORIO
# define WITH_OCIO
#endif
#cmakedefine WITH_CYCLES_PATH_GUIDING
#ifdef WITH_CYCLES_PATH_GUIDING
# define WITH_PATH_GUIDING
# define PATH_GUIDING_LEVEL=@PATH_GUIDING_LEVEL@
#endif
#cmakedefine WITH_CYCLES_DEBUG_NAN
#cmakedefine WITH_CYCLES_USD
#ifdef WITH_CYCLES_USD
# define WITH_USD
#endif
#cmakedefine WITH_CYCLES_BLENDER
#ifdef WITH_CYCLES_BLENDER
# define WITH_BLENDER_GUARDEDALLOC
#endif
#endif /* __CYCLES_CONFIG_H__ */

View File

@ -216,3 +216,7 @@ source_group("metal" FILES ${SRC_METAL})
source_group("optix" FILES ${SRC_OPTIX})
source_group("oneapi" FILES ${SRC_ONEAPI})
source_group("common" FILES ${SRC_BASE} ${SRC_HEADERS})
if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_SHARED_LIBRARY)
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_HEADERS}" ${CYCLES_INSTALL_PATH}/include/device)
endif()

View File

@ -148,7 +148,7 @@ void OneapiDevice::generic_alloc(device_memory &mem)
string_human_readable_size(max_memory_on_device_) + " is already allocated");
}
mem.device_pointer = reinterpret_cast<ccl::device_ptr>(device_pointer);
mem.device_pointer = reinterpret_cast<CCL_NS::device_ptr>(device_pointer);
mem.device_size = memory_size;
stats.mem_alloc(memory_size);

View File

@ -29,3 +29,7 @@ include_directories(${INC})
include_directories(SYSTEM ${INC_SYS})
cycles_add_library(cycles_graph "${LIB}" ${SRC} ${SRC_HEADERS})
if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_SHARED_LIBRARY)
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_HEADERS}" ${CYCLES_INSTALL_PATH}/include/graph)
endif()

View File

@ -14,10 +14,13 @@ set(INC_SYS
${PYTHON_INCLUDE_DIRS}
)
set(LIB
set(CYCLES_LIB
cycles_scene
cycles_session
cycles_graph
)
set(LIB
${Epoxy_LIBRARIES}
)
cycles_external_libraries_append(LIB)
@ -107,12 +110,23 @@ target_compile_definitions(cycles_hydra
$<$<CXX_COMPILER_ID:MSVC>:NOMINMAX=1>
)
if(WITH_CYCLES_SHARED_LIBRARY)
target_link_libraries(cycles_hydra
PUBLIC
${USD_LIBRARIES}
cycles_library
PRIVATE
${LIB}
)
else()
target_link_libraries(cycles_hydra
PUBLIC
${USD_LIBRARIES}
PRIVATE
${CYCLES_LIB}
${LIB}
)
endif()
if(WITH_CYCLES_HYDRA_RENDER_DELEGATE)
set(HdCyclesPluginName hdCycles)

View File

@ -6,7 +6,7 @@
#include <pxr/pxr.h>
#define CCL_NS ccl
#define CCL_NS cycles
#define CCL_NAMESPACE_USING_DIRECTIVE using namespace CCL_NS;
#define HD_CYCLES_NS HdCycles

View File

@ -36,6 +36,7 @@ set(SRC_HEADERS
denoiser_gpu.h
denoiser_oidn.h
denoiser_optix.h
guiding.h
path_trace.h
tile.h
pass_accessor.h
@ -78,3 +79,7 @@ include_directories(${INC})
include_directories(SYSTEM ${INC_SYS})
cycles_add_library(cycles_integrator "${LIB}" ${SRC} ${SRC_HEADERS})
if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_SHARED_LIBRARY)
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_HEADERS}" ${CYCLES_INSTALL_PATH}/include/integrator)
endif()

View File

@ -104,7 +104,7 @@ static OptixResult optixUtilDenoiserInvokeTiled(OptixDenoiser denoiser,
std::vector<std::vector<OptixUtilDenoiserImageTile>> tiles(numLayers);
std::vector<std::vector<OptixUtilDenoiserImageTile>> prevTiles(numLayers);
for (unsigned int l = 0; l < numLayers; l++) {
if (const OptixResult res = ccl::optixUtilDenoiserSplitImage(layers[l].input,
if (const OptixResult res = CCL_NS::optixUtilDenoiserSplitImage(layers[l].input,
layers[l].output,
overlapWindowSizeInPixels,
tileWidth,
@ -114,7 +114,7 @@ static OptixResult optixUtilDenoiserInvokeTiled(OptixDenoiser denoiser,
if (layers[l].previousOutput.data) {
OptixImage2D dummyOutput = layers[l].previousOutput;
if (const OptixResult res = ccl::optixUtilDenoiserSplitImage(layers[l].previousOutput,
if (const OptixResult res = CCL_NS::optixUtilDenoiserSplitImage(layers[l].previousOutput,
dummyOutput,
overlapWindowSizeInPixels,
tileWidth,
@ -127,7 +127,7 @@ static OptixResult optixUtilDenoiserInvokeTiled(OptixDenoiser denoiser,
std::vector<OptixUtilDenoiserImageTile> albedoTiles;
if (guideLayer->albedo.data) {
OptixImage2D dummyOutput = guideLayer->albedo;
if (const OptixResult res = ccl::optixUtilDenoiserSplitImage(guideLayer->albedo,
if (const OptixResult res = CCL_NS::optixUtilDenoiserSplitImage(guideLayer->albedo,
dummyOutput,
overlapWindowSizeInPixels,
tileWidth,
@ -139,7 +139,7 @@ static OptixResult optixUtilDenoiserInvokeTiled(OptixDenoiser denoiser,
std::vector<OptixUtilDenoiserImageTile> normalTiles;
if (guideLayer->normal.data) {
OptixImage2D dummyOutput = guideLayer->normal;
if (const OptixResult res = ccl::optixUtilDenoiserSplitImage(guideLayer->normal,
if (const OptixResult res = CCL_NS::optixUtilDenoiserSplitImage(guideLayer->normal,
dummyOutput,
overlapWindowSizeInPixels,
tileWidth,
@ -150,7 +150,7 @@ static OptixResult optixUtilDenoiserInvokeTiled(OptixDenoiser denoiser,
std::vector<OptixUtilDenoiserImageTile> flowTiles;
if (guideLayer->flow.data) {
OptixImage2D dummyOutput = guideLayer->flow;
if (const OptixResult res = ccl::optixUtilDenoiserSplitImage(guideLayer->flow,
if (const OptixResult res = CCL_NS::optixUtilDenoiserSplitImage(guideLayer->flow,
dummyOutput,
overlapWindowSizeInPixels,
tileWidth,
@ -763,7 +763,7 @@ bool OptiXDenoiser::denoise_run(const DenoiseContext &context, const DenoisePass
OptixDenoiserParams params = {}; /* All parameters are disabled/zero. */
optix_device_assert(denoiser_device_,
ccl::optixUtilDenoiserInvokeTiled(
CCL_NS::optixUtilDenoiserInvokeTiled(
optix_denoiser_,
static_cast<OptiXDeviceQueue *>(denoiser_queue_.get())->stream(),
&params,

View File

@ -149,3 +149,7 @@ include_directories(${INC})
include_directories(SYSTEM ${INC_SYS})
cycles_add_library(cycles_scene "${LIB}" ${SRC} ${SRC_HEADERS})
if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_SHARED_LIBRARY)
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_HEADERS}" ${CYCLES_INSTALL_PATH}/include/scene)
endif()

View File

@ -703,7 +703,7 @@ static void update_attributes(AttributeSet &attributes, CachedData &cached_data,
continue;
}
const ccl::array<char> &attr_data = result.get_data();
const CCL_NS::array<char> &attr_data = result.get_data();
/* weak way of detecting if the topology has changed
* todo: reuse code from device_update patch */
@ -757,9 +757,9 @@ AlembicProcedural::AlembicProcedural() : Procedural(get_node_type())
AlembicProcedural::~AlembicProcedural()
{
ccl::set<Geometry *> geometries_set;
ccl::set<Object *> objects_set;
ccl::set<AlembicObject *> abc_objects_set;
CCL_NS::set<Geometry *> geometries_set;
CCL_NS::set<Object *> objects_set;
CCL_NS::set<AlembicObject *> abc_objects_set;
foreach (Node *node, objects) {
AlembicObject *abc_object = static_cast<AlembicObject *>(node);

View File

@ -30,7 +30,7 @@ struct MatrixSamplesData {
Alembic::AbcCoreAbstract::TimeSamplingPtr time_sampling;
};
/* Helpers to detect if some type is a `ccl::array`. */
/* Helpers to detect if some type is a `CCL_NS::array`. */
template<typename> struct is_array : public std::false_type {
};

View File

@ -24,14 +24,14 @@ CCL_NAMESPACE_END
# include <opensubdiv/far/primvarRefiner.h>
# include <opensubdiv/far/topologyRefinerFactory.h>
/* specializations of TopologyRefinerFactory for ccl::Mesh */
/* specializations of TopologyRefinerFactory for CCL_NS::Mesh */
namespace OpenSubdiv {
namespace OPENSUBDIV_VERSION {
namespace Far {
template<>
bool TopologyRefinerFactory<ccl::Mesh>::resizeComponentTopology(TopologyRefiner &refiner,
ccl::Mesh const &mesh)
bool TopologyRefinerFactory<CCL_NS::Mesh>::resizeComponentTopology(TopologyRefiner &refiner,
CCL_NS::Mesh const &mesh)
{
setNumBaseVertices(refiner, mesh.get_verts().size());
setNumBaseFaces(refiner, mesh.get_num_subd_faces());
@ -44,12 +44,12 @@ bool TopologyRefinerFactory<ccl::Mesh>::resizeComponentTopology(TopologyRefiner
}
template<>
bool TopologyRefinerFactory<ccl::Mesh>::assignComponentTopology(TopologyRefiner &refiner,
ccl::Mesh const &mesh)
bool TopologyRefinerFactory<CCL_NS::Mesh>::assignComponentTopology(TopologyRefiner &refiner,
CCL_NS::Mesh const &mesh)
{
const ccl::array<int> &subd_face_corners = mesh.get_subd_face_corners();
const ccl::array<int> &subd_start_corner = mesh.get_subd_start_corner();
const ccl::array<int> &subd_num_corners = mesh.get_subd_num_corners();
const CCL_NS::array<int> &subd_face_corners = mesh.get_subd_face_corners();
const CCL_NS::array<int> &subd_start_corner = mesh.get_subd_start_corner();
const CCL_NS::array<int> &subd_num_corners = mesh.get_subd_num_corners();
for (int i = 0; i < mesh.get_num_subd_faces(); i++) {
IndexArray face_verts = getBaseFaceVertices(refiner, i);
@ -66,8 +66,8 @@ bool TopologyRefinerFactory<ccl::Mesh>::assignComponentTopology(TopologyRefiner
}
template<>
bool TopologyRefinerFactory<ccl::Mesh>::assignComponentTags(TopologyRefiner &refiner,
ccl::Mesh const &mesh)
bool TopologyRefinerFactory<CCL_NS::Mesh>::assignComponentTags(TopologyRefiner &refiner,
CCL_NS::Mesh const &mesh)
{
/* Historical maximum crease weight used at Pixar, influencing the maximum in OpenSubDiv. */
static constexpr float CREASE_SCALE = 10.0f;
@ -81,7 +81,7 @@ bool TopologyRefinerFactory<ccl::Mesh>::assignComponentTags(TopologyRefiner &ref
}
for (int i = 0; i < num_creases; i++) {
ccl::Mesh::SubdEdgeCrease crease = mesh.get_subd_crease(i);
CCL_NS::Mesh::SubdEdgeCrease crease = mesh.get_subd_crease(i);
Index edge = findBaseEdge(refiner, crease.v[0], crease.v[1]);
if (edge != INDEX_INVALID) {
@ -112,8 +112,8 @@ bool TopologyRefinerFactory<ccl::Mesh>::assignComponentTags(TopologyRefiner &ref
const float sharpness0 = refiner.getLevel(0).getEdgeSharpness(vert_edges[0]);
const float sharpness1 = refiner.getLevel(0).getEdgeSharpness(vert_edges[1]);
sharpness += ccl::min(sharpness0, sharpness1);
sharpness = ccl::min(sharpness, CREASE_SCALE);
sharpness += CCL_NS::min(sharpness0, sharpness1);
sharpness = CCL_NS::min(sharpness, CREASE_SCALE);
}
if (sharpness != 0.0f) {
@ -125,16 +125,16 @@ bool TopologyRefinerFactory<ccl::Mesh>::assignComponentTags(TopologyRefiner &ref
}
template<>
bool TopologyRefinerFactory<ccl::Mesh>::assignFaceVaryingTopology(TopologyRefiner & /*refiner*/,
ccl::Mesh const & /*mesh*/)
bool TopologyRefinerFactory<CCL_NS::Mesh>::assignFaceVaryingTopology(TopologyRefiner & /*refiner*/,
CCL_NS::Mesh const & /*mesh*/)
{
return true;
}
template<>
void TopologyRefinerFactory<ccl::Mesh>::reportInvalidTopology(TopologyError /*err_code*/,
void TopologyRefinerFactory<CCL_NS::Mesh>::reportInvalidTopology(TopologyError /*err_code*/,
char const * /*msg*/,
ccl::Mesh const & /*mesh*/)
CCL_NS::Mesh const & /*mesh*/)
{
}
} /* namespace Far */
@ -334,7 +334,7 @@ class OsdData {
friend class Mesh;
};
/* ccl::Patch implementation that uses OpenSubdiv for eval */
/* CCL_NS::Patch implementation that uses OpenSubdiv for eval */
struct OsdPatch : Patch {
OsdData *osd_data;

View File

@ -254,8 +254,8 @@ void Scene::device_update(Device *device_, Progress &progress)
*/
if (film->update_lightgroups(this)) {
light_manager->tag_update(this, ccl::LightManager::LIGHT_MODIFIED);
object_manager->tag_update(this, ccl::ObjectManager::OBJECT_MODIFIED);
light_manager->tag_update(this, CCL_NS::LightManager::LIGHT_MODIFIED);
object_manager->tag_update(this, CCL_NS::ObjectManager::OBJECT_MODIFIED);
}
if (film->exposure_is_modified()) {
integrator->tag_modified();

View File

@ -302,7 +302,7 @@ static bool is_non_empty_leaf(const openvdb::MaskGrid::TreeType &tree, const ope
}
#endif
void VolumeMeshBuilder::generate_vertices_and_quads(vector<ccl::int3> &vertices_is,
void VolumeMeshBuilder::generate_vertices_and_quads(vector<CCL_NS::int3> &vertices_is,
vector<QuadData> &quads)
{
#ifdef WITH_OPENVDB

View File

@ -36,3 +36,7 @@ include_directories(${INC})
include_directories(SYSTEM ${INC_SYS})
cycles_add_library(cycles_session "${LIB}" ${SRC} ${SRC_HEADERS})
if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_SHARED_LIBRARY)
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_HEADERS}" ${CYCLES_INSTALL_PATH}/include/session)
endif()

View File

@ -32,3 +32,7 @@ include_directories(${INC})
include_directories(SYSTEM ${INC_SYS})
cycles_add_library(cycles_subd "${LIB}" ${SRC} ${SRC_HEADERS})
if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_SHARED_LIBRARY)
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_HEADERS}" ${CYCLES_INSTALL_PATH}/include/subd)
endif()

View File

@ -146,3 +146,7 @@ include_directories(${INC})
include_directories(SYSTEM ${INC_SYS})
cycles_add_library(cycles_util "${LIB}" ${SRC} ${SRC_HEADERS})
if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_SHARED_LIBRARY)
delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_HEADERS}" ${CYCLES_INSTALL_PATH}/include/util)
endif()

View File

@ -43,15 +43,15 @@ class BoundBox {
{
/* the order of arguments to min is such that if pt is nan, it will not
* influence the resulting bounding box */
min = ccl::min(pt, min);
max = ccl::max(pt, max);
min = CCL_NS::min(pt, min);
max = CCL_NS::max(pt, max);
}
__forceinline void grow(const float3 &pt, float border)
{
float3 shift = make_float3(border, border, border);
min = ccl::min(pt - shift, min);
max = ccl::max(pt + shift, max);
min = CCL_NS::min(pt - shift, min);
max = CCL_NS::max(pt + shift, max);
}
__forceinline void grow(const BoundBox &bbox)
@ -65,8 +65,8 @@ class BoundBox {
/* the order of arguments to min is such that if pt is nan, it will not
* influence the resulting bounding box */
if (isfinite(pt.x) && isfinite(pt.y) && isfinite(pt.z)) {
min = ccl::min(pt, min);
max = ccl::max(pt, max);
min = CCL_NS::min(pt, min);
max = CCL_NS::max(pt, max);
}
}
@ -74,8 +74,8 @@ class BoundBox {
{
if (isfinite(pt.x) && isfinite(pt.y) && isfinite(pt.z) && isfinite(border)) {
float3 shift = make_float3(border, border, border);
min = ccl::min(pt - shift, min);
max = ccl::max(pt + shift, max);
min = CCL_NS::min(pt - shift, min);
max = CCL_NS::max(pt + shift, max);
}
}
@ -87,8 +87,8 @@ class BoundBox {
__forceinline void intersect(const BoundBox &bbox)
{
min = ccl::max(min, bbox.min);
max = ccl::min(max, bbox.max);
min = CCL_NS::max(min, bbox.min);
max = CCL_NS::min(max, bbox.max);
}
/* todo: avoid using this */
@ -255,10 +255,10 @@ class BoundBox2D {
{
BoundBox2D result;
result.left = ccl::clamp(left, mn, mx);
result.right = ccl::clamp(right, mn, mx);
result.bottom = ccl::clamp(bottom, mn, mx);
result.top = ccl::clamp(top, mn, mx);
result.left = CCL_NS::clamp(left, mn, mx);
result.right = CCL_NS::clamp(right, mn, mx);
result.bottom = CCL_NS::clamp(bottom, mn, mx);
result.top = CCL_NS::clamp(top, mn, mx);
return result;
}