commit 70f674fdd570ee6ce55118572e7628d8f8ac201b
parent 4dea3b9c2039de99fc854aab44740e7dddc8e806
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Tue, 1 Oct 2019 14:11:41 +0200
Upd how Embree verbosity level is defined.
Right now we always use a verbosity level of 1 if the verbose parameter
is set on device creation. Now, we configure the Embree verbosity with
respect to the effective value of the verbose parameter.
Diffstat:
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/s3d_device.c b/src/s3d_device.c
@@ -88,8 +88,11 @@ s3d_device_create
const int verbose,
struct s3d_device** out_dev)
{
+ char embree_opts[512];
struct s3d_device* dev = NULL;
struct mem_allocator* allocator;
+ const int verbosity = MMAX(MMIN(verbose, 3), 0);
+ int sz;
res_T res = RES_OK;
if(!out_dev) {
@@ -109,7 +112,14 @@ s3d_device_create
flist_name_init(allocator, &dev->names);
ref_init(&dev->ref);
- dev->rtc = rtcNewDevice(verbose ? "verbose=1" : NULL);
+ sz = snprintf(embree_opts, sizeof(embree_opts), "verbose=%d", verbosity);
+ if((size_t)sz >= sizeof(embree_opts)) {
+ log_error(dev, "Could not setup the Embree option string.\n");
+ res = RES_MEM_ERR;
+ goto error;
+ }
+
+ dev->rtc = rtcNewDevice(embree_opts);
if(dev->rtc == NULL) {
const enum RTCError err = rtcGetDeviceError(NULL);
log_error(dev, "Could not create the embree device -- %s.\n",