[Bf-blender-cvs] [039798bbf4c] cycles_embree: Cycles: Code style cleanup
Stefan Werner
noreply at git.blender.org
Sun Nov 26 23:11:37 CET 2017
Commit: 039798bbf4cdc53ed31beffb123c7b26e17a5192
Author: Stefan Werner
Date: Sun Oct 29 08:12:29 2017 +0100
Branches: cycles_embree
https://developer.blender.org/rB039798bbf4cdc53ed31beffb123c7b26e17a5192
Cycles: Code style cleanup
===================================================================
M CMakeLists.txt
M intern/cycles/blender/addon/properties.py
M intern/cycles/blender/blender_sync.cpp
M intern/cycles/bvh/bvh_embree.cpp
M intern/cycles/device/device.cpp
M intern/cycles/device/device.h
M intern/cycles/device/device_cpu.cpp
M intern/cycles/render/mesh.cpp
M intern/cycles/render/scene.h
===================================================================
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a21568d38d1..c09230aaf5d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -407,7 +407,7 @@ option(WITH_CYCLES "Enable Cycles Render Engine" ON)
option(WITH_CYCLES_STANDALONE "Build Cycles standalone application" OFF)
option(WITH_CYCLES_STANDALONE_GUI "Build Cycles standalone with GUI" OFF)
option(WITH_CYCLES_OSL "Build Cycles with OSL support" ${_init_CYCLES_OSL})
-option(WITH_CYCLES_EMBREE "Build Cycles with embree support" ON)
+option(WITH_CYCLES_EMBREE "Build Cycles with Embree support" ON)
option(WITH_CYCLES_OPENSUBDIV "Build Cycles with OpenSubdiv support" ${_init_CYCLES_OPENSUBDIV})
option(WITH_CYCLES_CUDA_BINARIES "Build Cycles CUDA binaries" OFF)
set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 CACHE STRING "CUDA architectures to build binaries for")
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index af825b573d8..f841070681a 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -513,8 +513,8 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
min=0, max=16,
)
cls.use_bvh_embree = BoolProperty(
- name="Use embree",
- description="Use embree as ray accelerator",
+ name="Use Embree",
+ description="Use Embree as ray accelerator",
default=True,
)
cls.tile_order = EnumProperty(
diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp
index 7ac8bf80278..9f286d3a1c4 100644
--- a/intern/cycles/blender/blender_sync.cpp
+++ b/intern/cycles/blender/blender_sync.cpp
@@ -646,12 +646,11 @@ SceneParams BlenderSync::get_scene_params(BL::Scene& b_scene,
params.use_bvh_spatial_split = RNA_boolean_get(&cscene, "debug_use_spatial_splits");
params.use_bvh_unaligned_nodes = RNA_boolean_get(&cscene, "debug_use_hair_bvh");
params.num_bvh_time_steps = RNA_int_get(&cscene, "debug_bvh_time_steps");
- if(is_cpu) {
- params.use_bvh_embree = RNA_int_get(&cscene, "use_bvh_embree");
- }
- else {
- params.use_bvh_embree = false;
- }
+#ifdef WITH_EMBREE
+ params.use_bvh_embree = RNA_boolean_get(&cscene, "use_bvh_embree");
+#else
+ params.use_bvh_embree = false;
+#endif
if(background && params.shadingsystem != SHADINGSYSTEM_OSL)
params.persistent_data = r.use_persistent_data();
diff --git a/intern/cycles/bvh/bvh_embree.cpp b/intern/cycles/bvh/bvh_embree.cpp
index 23e68b3190e..c60d6a2bdc3 100644
--- a/intern/cycles/bvh/bvh_embree.cpp
+++ b/intern/cycles/bvh/bvh_embree.cpp
@@ -26,7 +26,7 @@
#include "embree2/rtcore_geometry.h"
-/* kernel includes are necessary so that the filter function for embree can access the packed BVH */
+/* Kernel includes are necessary so that the filter function for Embree can access the packed BVH. */
#include "kernel/kernel_compat_cpu.h"
#include "kernel/split/kernel_split_data_types.h"
#include "kernel/kernel_globals.h"
@@ -42,7 +42,7 @@
CCL_NAMESPACE_BEGIN
-/* This gets called by embree at every valid ray/object intersection.
+/* This gets called by Embree at every valid ray/object intersection.
* Things like recording subsurface or shadow hits for later evaluation
* as well as filtering for volume objects happen here.
* Cycles' own BVH does that directly inside the traversal calls.
@@ -69,7 +69,7 @@ void rtc_filter_func(void*, RTCRay& ray_)
return;
}
else if(ray.type == CCLRay::RAY_SHADOW_ALL) {
- // append the intersection to the end of the array
+ /* Append the intersection to the end of the array. */
if(ray.num_hits < ray.max_hits) {
Intersection *isect = &ray.isect_s[ray.num_hits];
ray.num_hits++;
@@ -85,9 +85,9 @@ void rtc_filter_func(void*, RTCRay& ray_)
shader = __float_as_int(str.z);
}
int flag = kernel_tex_fetch(__shader_flag, (shader & SHADER_MASK)*SHADER_SIZE);
- /* if no transparent shadows, all light is blocked */
- if(flag & SD_HAS_TRANSPARENT_SHADOW) {
- /* this tells embree to continue tracing */
+ /* If no transparent shadows, all light is blocked. */
+ if(flag & (SD_HAS_TRANSPARENT_SHADOW)) {
+ /* This tells Embree to continue tracing. */
ray.geomID = RTC_INVALID_GEOMETRY_ID;
}
else {
@@ -102,17 +102,17 @@ void rtc_filter_func(void*, RTCRay& ray_)
return;
}
else if(ray.type == CCLRay::RAY_SSS) {
- /* only accept hits from the same object and triangles */
+ /* Only accept hits from the same object and triangles. */
if(ray.instID/2 != ray.sss_object_id || ray.geomID & 1) {
- /* this tells embree to continue tracing */
+ /* This tells Embree to continue tracing. */
ray.geomID = RTC_INVALID_GEOMETRY_ID;
return;
}
- /* see triangle_intersect_subsurface() for the native equivalent */
+ /* See triangle_intersect_subsurface() for the native equivalent. */
for(int i = min(ray.max_hits, ray.ss_isect->num_hits) - 1; i >= 0; --i) {
if(ray.ss_isect->hits[i].t == ray.tfar) {
- /* this tells embree to continue tracing */
+ /* This tells Embree to continue tracing. */
ray.geomID = RTC_INVALID_GEOMETRY_ID;
return;
}
@@ -130,7 +130,7 @@ void rtc_filter_func(void*, RTCRay& ray_)
hit = lcg_step_uint(ray.lcg_state) % ray.ss_isect->num_hits;
if(hit >= ray.max_hits) {
- /* this tells embree to continue tracing */
+ /* This tells Embree to continue tracing. */
ray.geomID = RTC_INVALID_GEOMETRY_ID;
return;
}
@@ -141,22 +141,22 @@ void rtc_filter_func(void*, RTCRay& ray_)
ray.ss_isect->Ng[hit].y = -ray.Ng[1];
ray.ss_isect->Ng[hit].z = -ray.Ng[2];
ray.ss_isect->Ng[hit] = normalize(ray.ss_isect->Ng[hit]);
- /* this tells embree to continue tracing */
+ /* this tells Embree to continue tracing */
ray.geomID = RTC_INVALID_GEOMETRY_ID;
return;
} else if(ray.type == CCLRay::RAY_VOLUME_ALL) {
- // append the intersection to the end of the array
+ /* Append the intersection to the end of the array. */
if(ray.num_hits < ray.max_hits) {
Intersection *isect = &ray.isect_s[ray.num_hits];
ray.num_hits++;
ray.isect_to_ccl(isect);
- /* only primitives from volume object */
+ /* Only primitives from volume object. */
uint tri_object = kernel_tex_fetch(__prim_object, isect->prim);
int object_flag = kernel_tex_fetch(__object_flag, tri_object);
if((object_flag & SD_OBJECT_HAS_VOLUME) == 0) {
ray.num_hits--;
}
- /* this tells embree to continue tracing */
+ /* This tells Embree to continue tracing. */
ray.geomID = RTC_INVALID_GEOMETRY_ID;
return;
}
@@ -200,8 +200,8 @@ thread_mutex BVHEmbree::rtc_shared_mutex;
BVHEmbree::BVHEmbree(const BVHParams& params_, const vector<Object*>& objects_)
: BVH(params_, objects_), scene(NULL), mem_used(0), top_level(NULL), stats(NULL),
- use_curves(params_.curve_flags & CURVE_KN_INTERPOLATE), use_ribbons(params.curve_flags & CURVE_KN_RIBBONS),
- curve_subdivisions(params.curve_subdivisions)
+ curve_subdivisions(params.curve_subdivisions), use_curves(params_.curve_flags & CURVE_KN_INTERPOLATE),
+ use_ribbons(params.curve_flags & CURVE_KN_RIBBONS), dynamic_scene(true)
{
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
_MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON);
@@ -245,7 +245,7 @@ BVHEmbree::BVHEmbree(const BVHParams& params_, const vector<Object*>& objects_)
rtcDeviceSetMemoryMonitorFunction2(rtc_shared_device, rtc_memory_monitor_func, this);
- /* BVH_CUSTOM as root index signals to the rest of the code that this is not Cycle's own BVH */
+ /* BVH_CUSTOM as root index signals to the rest of the code that this is not Cycle's own BVH. */
pack.root_index = BVH_CUSTOM;
}
@@ -274,7 +274,7 @@ void BVHEmbree::delete_rtcScene()
{
if(scene) {
/* When this BVH is used as an instance in a top level BVH, don't delete now
- * Let the top_level BVH know that it should delete it later */
+ * Let the top_level BVH know that it should delete it later. */
if(top_level) {
top_level->add_delayed_delete_scene(scene);
}
@@ -446,7 +446,7 @@ unsigned BVHEmbree::add_triangles(Mesh *mesh, int i)
i*2);
#ifdef EMBREE_SHARED_MEM
- /* embree and Cycles use the same memory layout, so we can conveniently use the rtcSetBuffer2 calls */
+ /* Embree and Cycles use the same memory layout, so we can conveniently use the rtcSetBuffer2 calls. */
rtcSetBuffer2(scene, geom_id, RTC_INDEX_BUFFER, &mesh->triangles[0], 0, sizeof(int) * 3);
#else
void* raw_buffer = rtcMapBuffer(scene, geom_id, RTC_INDEX_BUFFER);
@@ -537,7 +537,7 @@ void BVHEmbree::update_curve_vertex_buffer(unsigned geom_id, const Mesh* mesh)
const size_t num_keys = mesh->curve_keys.size();
- /* Copy the CV data to embree */
+ /* Copy the CV data to Embree */
int t_mid = (num_motion_steps - 1) / 2;
const float *curve_radius = &mesh->curve_radius[0];
for(int t = 0; t < num_motion_steps; t++) {
@@ -653,7 +653,7 @@ unsigned BVHEmbree::add_curves(Mesh *mesh, int i)
}
rtcSetTessellationRate(scene, geom_id, curve_subdivisions);
- /* Split the Cycles curves into embree hair segments, each with 4 CVs */
+ /* Split the Cycles curves into Embree hair segments, each with 4 CVs */
void* raw_buffer = rtcMapBuffer(scene, geom_id, RTC_INDEX_BUFFER);
unsigned *rtc_indices = (unsigned*) raw_buffer;
size_t rtc_index = 0;
@@ -684,7 +684,7 @@ unsigned BVHEmbree::add_curves(Mesh *mesh, int i)
i*2+1);
- /* Split the Cycles curves into embree line segments, each with 2 CVs */
+ /* Split the Cycles curves into Embree line segments, each with 2 CVs */
void* raw_buffer = rtcMapBuffer(scene, geom_id, RTC_INDEX_BUFFER);
unsigned *rtc_indices = (unsigned*) raw_buffer;
size_t rtc_index = 0;
diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp
index a3ff5481cef..4ba7eb50978 100644
--- a/intern/cycles/device/device.cpp
+++ b/intern/cycles/device/device.cpp
@@ -364,6 +364,7 @@ DeviceInfo Device::get_multi_device(const vector<DeviceInfo>& subdevices, int th
info.has_half_images = true;
info.has_volume_decoupled = true;
info.has_qbvh = true;
+ info.has_e
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list