Skip to content

Commit 8ff38de

Browse files
authored
Merge branch 'master' into patch-1
2 parents e09c68c + 1970895 commit 8ff38de

7 files changed

Lines changed: 32 additions & 44 deletions

File tree

common/tasking/taskschedulerinternal.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
namespace embree
1010
{
11-
RTC_NAMESPACE_BEGIN
12-
1311
static MutexSys g_mutex;
1412
size_t TaskScheduler::g_numThreads = 0;
1513
__thread TaskScheduler* TaskScheduler::g_instance = nullptr;
@@ -399,6 +397,4 @@ namespace embree
399397
dll_export void TaskScheduler::removeScheduler(const Ref<TaskScheduler>& scheduler) {
400398
threadPool->remove(scheduler);
401399
}
402-
403-
RTC_NAMESPACE_END
404400
}

common/tasking/taskschedulerinternal.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818

1919
namespace embree
2020
{
21-
22-
/* The tasking system exports some symbols to be used by the tutorials. Thus we
23-
hide is also in the API namespace when requested. */
24-
RTC_NAMESPACE_BEGIN
25-
2621
struct TaskScheduler : public RefCount
2722
{
2823
ALIGNED_STRUCT_(64);
@@ -375,10 +370,4 @@ namespace embree
375370
static __thread Thread* thread_local_thread;
376371
static ThreadPool* threadPool;
377372
};
378-
379-
RTC_NAMESPACE_END
380-
381-
#if defined(RTC_NAMESPACE)
382-
using RTC_NAMESPACE::TaskScheduler;
383-
#endif
384373
}

kernels/bvh/bvh_builder_morton.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace embree
5252
node->setBounds(i,b);
5353
}
5454

55-
BBox3fx result = (BBox3fx&)res;
55+
BBox3fx result = (BBox3fx)res;
5656
#if ROTATE_TREE
5757
if (N == 4)
5858
{
@@ -343,7 +343,7 @@ namespace embree
343343
new (&accel[i]) Object(geomID_,primID);
344344
}
345345

346-
BBox3fx box_o = (BBox3fx&)bounds;
346+
BBox3fx box_o = (BBox3fx)bounds;
347347
#if ROTATE_TREE
348348
if (N == 4)
349349
box_o.lower.a = current.size();
@@ -387,7 +387,7 @@ namespace embree
387387
new (&accel[i]) InstancePrimitive(instance, geomID_);
388388
}
389389

390-
BBox3fx box_o = (BBox3fx&)bounds;
390+
BBox3fx box_o = (BBox3fx)bounds;
391391
#if ROTATE_TREE
392392
if (N == 4)
393393
box_o.lower.a = current.size();
@@ -431,7 +431,7 @@ namespace embree
431431
new (&accel[i]) InstanceArrayPrimitive(geomID_, primID);
432432
}
433433

434-
BBox3fx box_o = (BBox3fx&)bounds;
434+
BBox3fx box_o = (BBox3fx)bounds;
435435
#if ROTATE_TREE
436436
if (N == 4)
437437
box_o.lower.a = current.size();

kernels/geometry/grid_soa.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ namespace embree
5858
}
5959

6060
/*! returns reference to root */
61-
__forceinline BVH4::NodeRef& root(size_t t = 0) { return (BVH4::NodeRef&)data[rootOffset + t*sizeof(BVH4::NodeRef)]; }
62-
__forceinline const BVH4::NodeRef& root(size_t t = 0) const { return (BVH4::NodeRef&)data[rootOffset + t*sizeof(BVH4::NodeRef)]; }
61+
__forceinline BVH4::NodeRef& root(size_t t = 0) { return *(BVH4::NodeRef*)&data[rootOffset + t*sizeof(BVH4::NodeRef)]; }
62+
__forceinline const BVH4::NodeRef& root(size_t t = 0) const { return *(BVH4::NodeRef*)&data[rootOffset + t*sizeof(BVH4::NodeRef)]; }
6363

6464
/*! returns pointer to BVH array */
6565
__forceinline char* bvhData() { return &data[0]; }

kernels/rtcore_config.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
# define RTC_API_EXTERN_CPP
4040
# undef EMBREE_API_NAMESPACE
4141
#else
42+
# define RTC_NAMESPACE
4243
# define RTC_NAMESPACE_BEGIN
4344
# define RTC_NAMESPACE_END
4445
# define RTC_NAMESPACE_USE

kernels/sycl/rthwif_embree.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,12 +731,14 @@ SYCL_EXTERNAL __attribute__((always_inline)) void rtcIntersectRTHW(sycl::global_
731731
if (valid)
732732
{
733733
float t = intel_get_hit_distance(query, intel_hit_type_committed_hit);
734-
float2 uv = intel_get_hit_barycentrics (query, intel_hit_type_committed_hit);
734+
float2 uv(ray.u, ray.v);
735735
unsigned int geomID = intel_get_hit_geometry_id(query, intel_hit_type_committed_hit);
736736

737737
unsigned int primID = ray.primID;
738-
if (intel_get_hit_candidate(query, intel_hit_type_committed_hit) == intel_candidate_type_triangle)
738+
if (intel_get_hit_candidate(query, intel_hit_type_committed_hit) == intel_candidate_type_triangle) {
739739
primID = intel_get_hit_triangle_primitive_id(query, intel_hit_type_committed_hit);
740+
uv = intel_get_hit_barycentrics (query, intel_hit_type_committed_hit);
741+
}
740742

741743
rayhit_i->ray.tfar = t;
742744
rayhit_i->hit.geomID = geomID;

tutorials/common/tutorial/tutorial.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -431,28 +431,28 @@ namespace embree
431431

432432
registerOption("ambientlight", [this] (Ref<ParseStream> cin, const FileName& path) {
433433
const Vec3f L = cin->getVec3f();
434-
futures.push_back([=, this]() { scene->add(new SceneGraph::LightNodeImpl<SceneGraph::AmbientLight>(SceneGraph::AmbientLight(L))); });
434+
futures.push_back([this, L]() { scene->add(new SceneGraph::LightNodeImpl<SceneGraph::AmbientLight>(SceneGraph::AmbientLight(L))); });
435435
}, "--ambientlight r g b: adds an ambient light with intensity rgb");
436436
registerOptionAlias("ambientlight","ambient");
437437

438438
registerOption("pointlight", [this] (Ref<ParseStream> cin, const FileName& path) {
439439
const Vec3f P = cin->getVec3f();
440440
const Vec3f I = cin->getVec3f();
441-
futures.push_back([=, this]() { scene->add(new SceneGraph::LightNodeImpl<SceneGraph::PointLight>(SceneGraph::PointLight(P,I))); });
441+
futures.push_back([this, P, I]() { scene->add(new SceneGraph::LightNodeImpl<SceneGraph::PointLight>(SceneGraph::PointLight(P,I))); });
442442
}, "--pointlight x y z r g b: adds a point light at position xyz with intensity rgb");
443443

444444
registerOption("directionallight", [this] (Ref<ParseStream> cin, const FileName& path) {
445445
const Vec3f D = cin->getVec3f();
446446
const Vec3f E = cin->getVec3f();
447-
futures.push_back([=, this]() { scene->add(new SceneGraph::LightNodeImpl<SceneGraph::DirectionalLight>(SceneGraph::DirectionalLight(D,E))); });
447+
futures.push_back([this, D, E]() { scene->add(new SceneGraph::LightNodeImpl<SceneGraph::DirectionalLight>(SceneGraph::DirectionalLight(D,E))); });
448448
}, "--directionallight x y z r g b: adds a directional light with direction xyz and intensity rgb");
449449
registerOptionAlias("directionallight","dirlight");
450450

451451
registerOption("distantlight", [this] (Ref<ParseStream> cin, const FileName& path) {
452452
const Vec3f D = cin->getVec3f();
453453
const Vec3f L = cin->getVec3f();
454454
const float halfAngle = cin->getFloat();
455-
futures.push_back([=, this]() { scene->add(new SceneGraph::LightNodeImpl<SceneGraph::DistantLight>(SceneGraph::DistantLight(D,L,halfAngle))); });
455+
futures.push_back([this, D, L, halfAngle]() { scene->add(new SceneGraph::LightNodeImpl<SceneGraph::DistantLight>(SceneGraph::DistantLight(D,L,halfAngle))); });
456456
}, "--distantlight x y z r g b a: adds a distant light with direction xyz, intensity rgb, and opening angle a");
457457

458458
registerOption("triangle-plane", [this] (Ref<ParseStream> cin, const FileName& path) {
@@ -461,7 +461,7 @@ namespace embree
461461
const Vec3f dy = cin->getVec3f();
462462
const size_t width = cin->getInt();
463463
const size_t height = cin->getInt();
464-
futures.push_back([=, this]() { scene->add(SceneGraph::createTrianglePlane(p0,dx,dy,width,height,new OBJMaterial)); });
464+
futures.push_back([this, p0, dx, dy, width, height]() { scene->add(SceneGraph::createTrianglePlane(p0,dx,dy,width,height,new OBJMaterial)); });
465465
}, "--triangle-plane p.x p.y p.z dx.x dx.y dx.z dy.x dy.y dy.z width height: adds a plane build of triangles originated at p0 and spanned by the vectors dx and dy with a tessellation width/height.");
466466

467467
registerOption("quad-plane", [this] (Ref<ParseStream> cin, const FileName& path) {
@@ -470,7 +470,7 @@ namespace embree
470470
const Vec3f dy = cin->getVec3f();
471471
const size_t width = cin->getInt();
472472
const size_t height = cin->getInt();
473-
futures.push_back([=, this]() { scene->add(SceneGraph::createQuadPlane(p0,dx,dy,width,height,new OBJMaterial)); });
473+
futures.push_back([this, p0, dx, dy, width, height]() { scene->add(SceneGraph::createQuadPlane(p0,dx,dy,width,height,new OBJMaterial)); });
474474
}, "--quad-plane p.x p.y p.z dx.x dx.y dx.z dy.x dy.y dy.z width height: adds a plane build of quadrilaterals originated at p0 and spanned by the vectors dx and dy with a tessellation width/height.");
475475

476476
registerOption("grid-plane", [this] (Ref<ParseStream> cin, const FileName& path) {
@@ -479,7 +479,7 @@ namespace embree
479479
const Vec3f dy = cin->getVec3f();
480480
const size_t width = cin->getInt();
481481
const size_t height = cin->getInt();
482-
futures.push_back([=, this]() { scene->add(SceneGraph::createGridPlane(p0,dx,dy,width,height,new OBJMaterial)); });
482+
futures.push_back([this, p0, dx, dy, width, height]() { scene->add(SceneGraph::createGridPlane(p0,dx,dy,width,height,new OBJMaterial)); });
483483
}, "--grid-plane p.x p.y p.z dx.x dx.y dx.z dy.x dy.y dy.z width height: adds a plane using a grid mesh build. The plane is originated at p0 and spanned by the vectors dx and dy with a tessellation width/height.");
484484

485485
registerOption("subdiv-plane", [this] (Ref<ParseStream> cin, const FileName& path) {
@@ -489,7 +489,7 @@ namespace embree
489489
const size_t width = cin->getInt();
490490
const size_t height = cin->getInt();
491491
const float tessellationRate = cin->getFloat();
492-
futures.push_back([=, this]() { scene->add(SceneGraph::createSubdivPlane(p0,dx,dy,width,height,tessellationRate,new OBJMaterial)); });
492+
futures.push_back([this, p0, dx, dy, width, height, tessellationRate]() { scene->add(SceneGraph::createSubdivPlane(p0,dx,dy,width,height,tessellationRate,new OBJMaterial)); });
493493
}, "--subdiv-plane p.x p.y p.z dx.x dx.y dx.z dy.x dy.y dy.z width height tessellationRate: adds a plane build as a Catmull Clark subdivision surface originated at p0 and spanned by the vectors dx and dy. The plane consists of widt x height many patches, and each patch has the specified tessellation rate.");
494494

495495
registerOption("hair-plane", [this] (Ref<ParseStream> cin, const FileName& path) {
@@ -499,7 +499,7 @@ namespace embree
499499
const float len = cin->getFloat();
500500
const float r = cin->getFloat();
501501
const size_t N = cin->getInt();
502-
futures.push_back([=, this]() { scene->add(SceneGraph::createHairyPlane(0,p0,dx,dy,len,r,N,SceneGraph::FLAT_CURVE,new OBJMaterial)); });
502+
futures.push_back([this, p0, dx, dy, len, r, N]() { scene->add(SceneGraph::createHairyPlane(0,p0,dx,dy,len,r,N,SceneGraph::FLAT_CURVE,new OBJMaterial)); });
503503
}, "--hair-plane p.x p.y p.z dx.x dx.y dx.z dy.x dy.y dy.z length radius num: adds a hair plane originated at p0 and spanned by the vectors dx and dy. num hairs are generated with specified length and radius.");
504504

505505
registerOption("curve-plane", [this] (Ref<ParseStream> cin, const FileName& path) {
@@ -509,42 +509,42 @@ namespace embree
509509
const float len = cin->getFloat();
510510
const float r = cin->getFloat();
511511
const size_t N = cin->getInt();
512-
futures.push_back([=, this]() { scene->add(SceneGraph::createHairyPlane(0,p0,dx,dy,len,r,N,SceneGraph::ROUND_CURVE,new OBJMaterial)); });
512+
futures.push_back([this, p0, dx, dy, len, r, N]() { scene->add(SceneGraph::createHairyPlane(0,p0,dx,dy,len,r,N,SceneGraph::ROUND_CURVE,new OBJMaterial)); });
513513
}, "--curve-plane p.x p.y p.z dx.x dx.y dx.z dy.x dy.y dy.z length radius: adds a plane build of bezier curves originated at p0 and spanned by the vectors dx and dy. num curves are generated with specified length and radius.");
514514

515515
registerOption("sphere", [this] (Ref<ParseStream> cin, const FileName& path) {
516516
const Vec3f p = cin->getVec3f();
517517
const float r = cin->getFloat();
518-
futures.push_back([=, this]() { scene->add(SceneGraph::createSphere(p, r, new OBJMaterial)); });
518+
futures.push_back([this, p, r]() { scene->add(SceneGraph::createSphere(p, r, new OBJMaterial)); });
519519
}, "--sphere p.x p.y p.z r: adds a sphere at position p with radius r");
520520

521521
registerOption("triangle-sphere", [this] (Ref<ParseStream> cin, const FileName& path) {
522522
const Vec3f p = cin->getVec3f();
523523
const float r = cin->getFloat();
524524
const size_t numPhi = cin->getInt();
525-
futures.push_back([=, this]() { scene->add(SceneGraph::createTriangleSphere(p,r,numPhi,new OBJMaterial)); });
525+
futures.push_back([this, p, r, numPhi]() { scene->add(SceneGraph::createTriangleSphere(p,r,numPhi,new OBJMaterial)); });
526526
}, "--triangle-sphere p.x p.y p.z r numPhi: adds a sphere at position p with radius r and tessellation numPhi build of triangles.");
527527

528528
registerOption("quad-sphere", [this] (Ref<ParseStream> cin, const FileName& path) {
529529
const Vec3f p = cin->getVec3f();
530530
const float r = cin->getFloat();
531531
const size_t numPhi = cin->getInt();
532-
futures.push_back([=, this]() { scene->add(SceneGraph::createQuadSphere(p,r,numPhi,new OBJMaterial)); });
532+
futures.push_back([this, p, r, numPhi]() { scene->add(SceneGraph::createQuadSphere(p,r,numPhi,new OBJMaterial)); });
533533
}, "--quad-sphere p.x p.y p.z r numPhi: adds a sphere at position p with radius r and tessellation numPhi build of quadrilaterals.");
534534

535535
registerOption("grid-sphere", [this] (Ref<ParseStream> cin, const FileName& path) {
536536
const Vec3f p = cin->getVec3f();
537537
const float r = cin->getFloat();
538538
const size_t N = cin->getInt();
539-
futures.push_back([=, this]() { scene->add(SceneGraph::createGridSphere(p,r,N,new OBJMaterial)); });
539+
futures.push_back([this, p, r, N]() { scene->add(SceneGraph::createGridSphere(p,r,N,new OBJMaterial)); });
540540
}, "--grid-sphere p.x p.y p.z r N: adds a grid sphere at position p with radius r using a cube topology and N*N quads at each face.");
541541

542542
registerOption("triangle-sphere-mblur", [this] (Ref<ParseStream> cin, const FileName& path) {
543543
const Vec3f p = cin->getVec3f();
544544
const Vec3f dp = cin->getVec3f();
545545
const float r = cin->getFloat();
546546
const size_t numPhi = cin->getInt();
547-
futures.push_back([=, this]() {
547+
futures.push_back([this, p, dp, r, numPhi]() {
548548
Ref<SceneGraph::Node> mesh = SceneGraph::createTriangleSphere(p,r,numPhi,new OBJMaterial);
549549
mesh->set_motion_vector(dp);
550550
scene->add(mesh);
@@ -556,7 +556,7 @@ namespace embree
556556
const Vec3f dp = cin->getVec3f();
557557
const float r = cin->getFloat();
558558
const size_t numPhi = cin->getInt();
559-
futures.push_back([=, this]() {
559+
futures.push_back([this, p, dp, r, numPhi]() {
560560
Ref<SceneGraph::Node> mesh = SceneGraph::createQuadSphere(p,r,numPhi,new OBJMaterial);
561561
mesh->set_motion_vector(dp);
562562
scene->add(mesh);
@@ -568,15 +568,15 @@ namespace embree
568568
const float r = cin->getFloat();
569569
const size_t numPhi = cin->getInt();
570570
const float tessellationRate = cin->getFloat();
571-
futures.push_back([=, this]() { scene->add(SceneGraph::createSubdivSphere(p,r,numPhi,tessellationRate,new OBJMaterial)); });
571+
futures.push_back([this, p, r, numPhi, tessellationRate]() { scene->add(SceneGraph::createSubdivSphere(p,r,numPhi,tessellationRate,new OBJMaterial)); });
572572
}, "--subdiv-sphere p.x p.y p.z r numPhi: adds a sphere at position p with radius r build of Catmull Clark subdivision surfaces. The sphere consists of numPhi x numPhi many patches and each path has the specified tessellation rate.");
573573

574574
registerOption("point-sphere", [this] (Ref<ParseStream> cin, const FileName& path) {
575575
const Vec3f p = cin->getVec3f();
576576
const float r = cin->getFloat();
577577
const float pointR = cin->getFloat();
578578
const size_t numPhi = cin->getInt();
579-
futures.push_back([=, this]() { scene->add(SceneGraph::createPointSphere(p, r, pointR, numPhi, SceneGraph::SPHERE, new OBJMaterial)); });
579+
futures.push_back([this, p, r, pointR, numPhi]() { scene->add(SceneGraph::createPointSphere(p, r, pointR, numPhi, SceneGraph::SPHERE, new OBJMaterial)); });
580580
}, "--point-sphere p.x p.y p.z r pointR numPhi: adds a sphere at position p with radius r and tessellation numPhi build of spheres.");
581581

582582
registerOption("point-sphere-mblur", [this] (Ref<ParseStream> cin, const FileName& path) {
@@ -585,23 +585,23 @@ namespace embree
585585
const float r = cin->getFloat();
586586
const float pointR = cin->getFloat();
587587
const size_t numPhi = cin->getInt();
588-
futures.push_back([=, this]() { scene->add(SceneGraph::createPointSphere(p, r, pointR, numPhi, SceneGraph::SPHERE, new OBJMaterial)->set_motion_vector(dp)); });
588+
futures.push_back([this, p, dp, r, pointR, numPhi]() { scene->add(SceneGraph::createPointSphere(p, r, pointR, numPhi, SceneGraph::SPHERE, new OBJMaterial)->set_motion_vector(dp)); });
589589
}, "--point-sphere p.x p.y p.z d.x d.y d.z r pointR numPhi: adds a sphere at position p, motion vector d, with radius r and tessellation numPhi build of spheres.");
590590

591591
registerOption("disc-sphere", [this] (Ref<ParseStream> cin, const FileName& path) {
592592
const Vec3f p = cin->getVec3f();
593593
const float r = cin->getFloat();
594594
const float pointR = cin->getFloat();
595595
const size_t numPhi = cin->getInt();
596-
futures.push_back([=, this]() { scene->add(SceneGraph::createPointSphere(p, r, pointR, numPhi, SceneGraph::DISC, new OBJMaterial)); });
596+
futures.push_back([this, p, r, pointR, numPhi]() { scene->add(SceneGraph::createPointSphere(p, r, pointR, numPhi, SceneGraph::DISC, new OBJMaterial)); });
597597
}, "--disc-sphere p.x p.y p.z r pointR numPhi: adds a sphere at position p with radius r and tessellation numPhi build of discs.");
598598

599599
registerOption("oriented-disc-sphere", [this] (Ref<ParseStream> cin, const FileName& path) {
600600
const Vec3f p = cin->getVec3f();
601601
const float r = cin->getFloat();
602602
const float pointR = cin->getFloat();
603603
const size_t numPhi = cin->getInt();
604-
futures.push_back([=, this]() { scene->add(SceneGraph::createPointSphere(p, r, pointR, numPhi, SceneGraph::ORIENTED_DISC, new OBJMaterial)); });
604+
futures.push_back([this, p, r, pointR, numPhi]() { scene->add(SceneGraph::createPointSphere(p, r, pointR, numPhi, SceneGraph::ORIENTED_DISC, new OBJMaterial)); });
605605
}, "--oriented-disc-sphere p.x p.y p.z r pointR numPhi: adds a sphere at position p with radius r and tessellation numPhi build of oriented discs.");
606606

607607
registerOption("print-cameras", [this] (Ref<ParseStream> cin, const FileName& path) {

0 commit comments

Comments
 (0)