[Bf-blender-cvs] [6eda75beab4] cycles_embree: Cycles: Added runtime checks for Embree build. If Embree is not configured correctly, it will print warnings to the console.

Stefan Werner noreply at git.blender.org
Sun Nov 26 23:11:27 CET 2017


Commit: 6eda75beab4149714f4c526d3783102b34b0a88a
Author: Stefan Werner
Date:   Wed Sep 13 16:38:28 2017 +0200
Branches: cycles_embree
https://developer.blender.org/rB6eda75beab4149714f4c526d3783102b34b0a88a

Cycles: Added runtime checks for Embree build. If Embree is not configured correctly, it will print warnings to the console.

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

M	intern/cycles/bvh/bvh_embree.cpp

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

diff --git a/intern/cycles/bvh/bvh_embree.cpp b/intern/cycles/bvh/bvh_embree.cpp
index 76a3d8ee697..be588fdb9d0 100644
--- a/intern/cycles/bvh/bvh_embree.cpp
+++ b/intern/cycles/bvh/bvh_embree.cpp
@@ -22,6 +22,7 @@
 #include "render/object.h"
 #include "util/util_progress.h"
 #include "util/util_foreach.h"
+#include "util/util_logging.h"
 
 #include "embree2/rtcore_geometry.h"
 
@@ -198,6 +199,33 @@ BVHEmbree::BVHEmbree(const BVHParams& params_, const vector<Object*>& objects_)
 	thread_scoped_lock lock(rtc_shared_mutex);
 	if(rtc_shared_users == 0) {
 		rtc_shared_device = rtcNewDevice("verbose=1");
+
+		/* Check here if Embree was built with the correct flags. */
+		ssize_t ret = rtcDeviceGetParameter1i(rtc_shared_device, RTC_CONFIG_RAY_MASK);
+		if(ret != 1) {
+			assert(0);
+			VLOG(1) << "Embree is compiled without the EMBREE_RAY_MASK flag. Ray visiblity will not work.";
+		}
+		ret = rtcDeviceGetParameter1i(rtc_shared_device, RTC_CONFIG_INTERSECTION_FILTER);
+		if(ret != 1) {
+			assert(0);
+			VLOG(1) << "Embree is compiled without the EMBREE_INTERSECTION_FILTER flag. Renders may not look as expected.";
+		}
+		ret = rtcDeviceGetParameter1i(rtc_shared_device, RTC_CONFIG_LINE_GEOMETRY);
+		if(ret != 1) {
+			assert(0);
+			VLOG(1) << "Embree is compiled without the EMBREE_GEOMETRY_LINES flag. Hair primitives will not be rendered.";
+		}
+		ret = rtcDeviceGetParameter1i(rtc_shared_device, RTC_CONFIG_TRIANGLE_GEOMETRY);
+		if(ret != 1) {
+			assert(0);
+			VLOG(1) << "Embree is compiled without the EMBREE_GEOMETRY_TRIANGLES flag. Triangle primitives will not be rendered.";
+		}
+		ret = rtcDeviceGetParameter1i(rtc_shared_device, RTC_CONFIG_BACKFACE_CULLING);
+		if(ret != 0) {
+			assert(0);
+			VLOG(1) << "Embree is compiled with the EMBREE_BACKFACE_CULLING flag. Renders may not look as expected.";
+		}
 	}
 	rtc_shared_users++;



More information about the Bf-blender-cvs mailing list