star-3d

Surface structuring for efficient 3D geometric queries
git clone git://git.meso-star.fr/star-3d.git
Log | Files | Refs | README | LICENSE

commit 6376fe025e824fe511f15d14ce6af56fab4aa396
parent 1f7742d672f85e2f446d199e35cbfd7019c294dc
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 11 Jan 2019 15:37:41 +0100

Update the Embree3 error callback

Use it in debug to "fatalize" an Embree error

Diffstat:
Msrc/s3d_device.c | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/s3d_device.c b/src/s3d_device.c @@ -45,10 +45,12 @@ static void rtc_error_func(void* context, enum RTCError err, const char* str) { + char msg[128]; struct s3d_device* dev = (struct s3d_device*)context; ASSERT(dev); - (void)str; - log_error(dev, "Embree:error: %s\n", rtc_error_string(err)); + (void)str, (void)err, (void)context; + snprintf(msg, sizeof(msg), "Embree:error: %s\n", rtc_error_string(err)); + FATAL(msg); } static INLINE void @@ -118,7 +120,9 @@ s3d_device_create goto error; } +#ifndef NDEBUG rtcSetDeviceErrorFunction(dev->rtc, rtc_error_func, dev); +#endif exit: if(out_dev) *out_dev = dev;