Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frei/device memory support #508

Open
wants to merge 50 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
02997c6
fix wrong assert about maxTimeSegments.
freibold Sep 9, 2024
a503f23
fix missing sign-extension when using device memory for BVH data.
freibold Sep 18, 2024
cd6846e
BVH buffer in explicitly managed host/device memory on systems
freibold Sep 13, 2024
f5a4b9c
triangle geometry is now host/device, scene next
freibold Sep 26, 2024
539d966
All geom types work, spilling bug?
freibold Oct 16, 2024
b7a041f
compile fixes
freibold Oct 24, 2024
5c163b5
geometry data works
freibold Oct 28, 2024
160b9ca
add debug tutorial and restore state of other tutorials
freibold Oct 29, 2024
1b0ac5c
scene is now in device memory, too. USM shared memory is now only
freibold Nov 6, 2024
49ef39f
introduced read only handle RTCTraversable which is accessible on
freibold Nov 11, 2024
ef99300
memory passing interface
freibold Nov 18, 2024
bce7d2a
rework buffer interface
freibold Nov 22, 2024
6290555
test address sanitizer issue
freibold Nov 25, 2024
fe5839c
cleanups
freibold Nov 26, 2024
f6b5bb1
do not use ALIGNED_STRUCT_ macro for Scene and Geometry
freibold Nov 26, 2024
475f7f1
port of multi_instanced_geometry tutorial to RTCTraversable
freibold Nov 26, 2024
9d14cd8
port forest tutorial to new host/device memory support
freibold Nov 27, 2024
094b4b7
change API naming for buffers form 'Ex' to 'HostDevice'
freibold Nov 27, 2024
e65098d
add ISPC API using RTCTraversable
freibold Nov 29, 2024
3cd3f2f
create CPP from ISPC tutorials
freibold Nov 29, 2024
92c5f4d
add padding to tree vertex and color data buffers for safe SIMD
freibold Dec 2, 2024
0611461
small fix for validation API
freibold Dec 2, 2024
8c32f18
less alloc/free when creating device representation of scenen/geometry
freibold Dec 4, 2024
ac3d1c3
add sycl events for sychronization
freibold Dec 5, 2024
a5b7df0
add cmake option for explicit host/device BVH data
freibold Dec 5, 2024
b868759
clear host scratch space for static scenes
freibold Dec 5, 2024
94aa2e6
rename host_device_memory tutorial and add CI tests
freibold Dec 5, 2024
381e713
refactor alloc. remove global (tls) SYCL context and device.
freibold Dec 9, 2024
fd6a57a
add nightly Windows multilevel test.
freibold Dec 9, 2024
6261729
update documentation for RTCBuffer
freibold Dec 9, 2024
365d71a
fix wrong deallocation in multi_instance_geometry tutorial.
freibold Dec 9, 2024
0b0626d
update rtcSet(New|Shared)GeometryBuffer(|HostDevice) documentation
freibold Dec 10, 2024
5064047
update rtcCommitScene(|WithQueue) documentation
freibold Dec 10, 2024
3f6f6b5
rename memory types and account for host unified memory in buffer con…
freibold Dec 11, 2024
f97e8c5
revert accidental changes in ray flag settings
freibold Dec 11, 2024
54157fa
docu fixes
freibold Dec 11, 2024
ae21235
change rtcCommit???WithQueue interface to return sycl::event
freibold Dec 11, 2024
26771b1
make rtcCommitSceneWithQueue work with out-of-order SYCL queues, too
freibold Dec 11, 2024
9219fa3
updating general intro documentation
freibold Dec 11, 2024
6482924
documentation for ray queries using RTCTraversable
freibold Dec 11, 2024
e40bef0
more general documentation
freibold Dec 11, 2024
0e25353
add export filters for commit with queue API functions
freibold Dec 11, 2024
8dac949
add CI test for BVH data in host device memory
freibold Dec 11, 2024
a56ac13
test new ICX version
freibold Dec 11, 2024
cdf70a7
changelog, typos
freibold Dec 11, 2024
0e2e3a5
update internal Linux and Window driver in CI
freibold Dec 11, 2024
9950968
remove timing output from dynamic scene tutorial
freibold Dec 13, 2024
76f8c1f
fix issues with host/device memory API on iGPU
freibold Dec 13, 2024
13c62b6
fix blender segfault with geometry == NULL inside geometries array
dopitz Dec 16, 2024
2b5ddc2
preparations for merge
dopitz Jan 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
create CPP from ISPC tutorials
  • Loading branch information
freibold committed Dec 11, 2024
commit 3cd3f2fb53c23106953ea51448a584b3c3a4ce7c
6 changes: 3 additions & 3 deletions tutorials/curve_geometry/curve_geometry_device.ispc
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export void device_init (uniform int8* uniform cfg)

/* commit changes to scene */
rtcCommitScene (data.g_scene);
data.g_traversable = rtcGetSceneTraversable(data.g_scene);
}

/* task that renders a single screen tile */
Expand All @@ -156,7 +157,7 @@ void renderPixelStandard(const uniform TutorialData& data,
uniform RTCIntersectArguments iargs;
rtcInitIntersectArguments(&iargs);
iargs.feature_mask = (uniform RTCFeatureFlags) (FEATURE_MASK);
rtcIntersectV(data.g_scene,RTCRayHit_(ray),&iargs);
rtcTraversableIntersectV(data.g_traversable,RTCRayHit_(ray),&iargs);
RayStats_addRay(stats);

/* shade pixels */
Expand Down Expand Up @@ -188,7 +189,7 @@ void renderPixelStandard(const uniform TutorialData& data,
uniform RTCOccludedArguments sargs;
rtcInitOccludedArguments(&sargs);
sargs.feature_mask = (uniform RTCFeatureFlags) (FEATURE_MASK);
rtcOccludedV(data.g_scene,RTCRay_(shadow),&sargs);
rtcTraversableOccludedV(data.g_traversable,RTCRay_(shadow),&sargs);
RayStats_addShadowRay(stats);

/* add light contribution */
Expand Down Expand Up @@ -286,6 +287,5 @@ export void device_render (uniform int* uniform pixels,
/* called by the C++ code for cleanup */
export void device_cleanup ()
{
rtcReleaseScene (data.g_scene); data.g_scene = NULL;
TutorialData_Destructor(&data);
}
2 changes: 2 additions & 0 deletions tutorials/curve_geometry/curve_geometry_device.isph
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ uniform int8 static_hair_flags_linear[NUM_CURVES] = {
struct TutorialData
{
RTCScene g_scene;
RTCTraversable g_traversable;
Vec4f* hair_vertices;
Vec3fa* hair_normals;
Vec3fa* hair_vertex_colors;
Expand All @@ -79,6 +80,7 @@ struct TutorialData
inline void TutorialData_Constructor(uniform TutorialData* uniform This)
{
This->g_scene = NULL;
This->g_traversable = NULL;
This->hair_vertices = uniform new uniform Vec4f[NUM_VERTICES];
This->hair_normals = uniform new uniform Vec3fa[NUM_VERTICES];
This->hair_vertex_colors = uniform new uniform Vec3fa[NUM_VERTICES];
Expand Down
5 changes: 3 additions & 2 deletions tutorials/dynamic_scene/dynamic_scene_device.ispc
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void renderPixelStandard(const uniform TutorialData& data,
rtcInitIntersectArguments(&iargs);
iargs.feature_mask = (uniform RTCFeatureFlags) (FEATURE_MASK);

rtcIntersectV(data.g_scene,RTCRayHit_(ray),&iargs);
rtcTraversableIntersectV(data.g_traversable,RTCRayHit_(ray),&iargs);
RayStats_addRay(stats);

/* shade pixels */
Expand All @@ -181,7 +181,7 @@ void renderPixelStandard(const uniform TutorialData& data,
uniform RTCOccludedArguments sargs;
rtcInitOccludedArguments(&sargs);
sargs.feature_mask = (uniform RTCFeatureFlags) (FEATURE_MASK);
rtcOccludedV(data.g_scene,RTCRay_(shadow),&sargs);
rtcTraversableOccludedV(data.g_traversable,RTCRay_(shadow),&sargs);
RayStats_addShadowRay(stats);

/* add light contribution */
Expand Down Expand Up @@ -309,6 +309,7 @@ export void device_render (uniform int* uniform pixels,

/* commit changes to scene */
rtcCommitScene (data.g_scene);
data.g_traversable = rtcGetSceneTraversable(data.g_scene);
}

/* called by the C++ code for cleanup */
Expand Down
2 changes: 2 additions & 0 deletions tutorials/dynamic_scene/dynamic_scene_device.isph
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct TutorialData

/* scene data */
RTCScene g_scene;
RTCTraversable g_traversable;

uniform Vec3fa* uniform position;
uniform Vec3fa* uniform colors;
Expand All @@ -28,6 +29,7 @@ void TutorialData_Constructor(uniform TutorialData* uniform This)
This->numPhi = NUM_PHI;
This->numTheta = NUM_THETA;
This->g_scene = NULL;
This->g_traversable = NULL;
This->position = uniform new uniform Vec3fa[NUM_SPHERES];
This->colors = uniform new uniform Vec3fa[NUM_SPHERES+1];
This->radius = uniform new uniform float[NUM_SPHERES];
Expand Down
2 changes: 2 additions & 0 deletions tutorials/grid_geometry/grid_geometry_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ void createGridGeometry (GridMesh& gmesh)
}

/* create normal debug geometry */
#if 0
gmesh.geomNormals = rtcNewGeometry (g_device, RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE);
Vec3ff *nvertices = (Vec3ff *) rtcSetNewGeometryBuffer(gmesh.geomNormals,RTC_BUFFER_TYPE_VERTEX,0,RTC_FORMAT_FLOAT4,sizeof(Vec3ff),4*numVertices);
int* curves = (int *) rtcSetNewGeometryBuffer(gmesh.geomNormals,RTC_BUFFER_TYPE_INDEX,0,RTC_FORMAT_UINT ,sizeof(int) ,numVertices);
Expand Down Expand Up @@ -497,6 +498,7 @@ void createGridGeometry (GridMesh& gmesh)
}
h+=sphere_faces[f];
}
#endif

/* we do not need this temporary data anymore */
rtcReleaseGeometry(geomSubdiv);
Expand Down
4 changes: 2 additions & 2 deletions tutorials/grid_geometry/grid_geometry_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ struct TutorialData

void TutorialData_Constructor(TutorialData* This)
{
This->g_scene = nullptr;
This->g_traversable = nullptr;
This->g_scene = nullptr;
This->g_traversable = nullptr;
This->gmesh.geom = nullptr;
This->gmesh.geomNormals = nullptr;
This->gmesh.egrids = nullptr;
Expand Down
5 changes: 3 additions & 2 deletions tutorials/grid_geometry/grid_geometry_device.ispc
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ export void device_init (uniform int8* uniform cfg)

/* commit changes to scene */
rtcCommitScene (data.g_scene);
data.g_traversable = rtcGetSceneTraversable(data.g_scene);
}

Vec3f mylerp(float f, const Vec3f& a, const Vec3f& b) { // FIXME: use lerp, need to make ISPC lerp and C++ lerp compatible first
Expand All @@ -567,7 +568,7 @@ void renderPixelStandard(const uniform TutorialData& data,
uniform RTCIntersectArguments iargs;
rtcInitIntersectArguments(&iargs);
iargs.feature_mask = (uniform RTCFeatureFlags) (FEATURE_MASK);
rtcIntersectV(data.g_scene,RTCRayHit_(ray),&iargs);
rtcTraversableIntersectV(data.g_traversable,RTCRayHit_(ray),&iargs);
RayStats_addRay(stats);

/* shade pixels */
Expand Down Expand Up @@ -608,7 +609,7 @@ void renderPixelStandard(const uniform TutorialData& data,
uniform RTCOccludedArguments sargs;
rtcInitOccludedArguments(&sargs);
sargs.feature_mask = (uniform RTCFeatureFlags) (FEATURE_MASK);
rtcOccludedV(data.g_scene,RTCRay_(shadow),&sargs);
rtcTraversableOccludedV(data.g_traversable,RTCRay_(shadow),&sargs);
RayStats_addShadowRay(stats);

/* add light contribution */
Expand Down
4 changes: 3 additions & 1 deletion tutorials/grid_geometry/grid_geometry_device.isph
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ struct TutorialData
{
/* scene data */
RTCScene g_scene;
RTCTraversable g_traversable;

uniform GridMesh gmesh;
};

void TutorialData_Constructor(uniform TutorialData* uniform This)
{
This->g_scene = NULL;
This->g_scene = NULL;
This->g_traversable = NULL;
This->gmesh.geom = NULL;
This->gmesh.geomNormals = NULL;
This->gmesh.egrids = NULL;
Expand Down
2 changes: 1 addition & 1 deletion tutorials/hair_geometry/hair_geometry_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ Vec3fa occluded(RTCTraversable traversable, RayQueryContext* context, Ray& ray)
args.filter = occlusionFilter;

rtcTraversableOccluded1(traversable,RTCRay_(ray),&args);
context->userRayExt = NULL;
context->userRayExt = nullptr;

if (ray.tfar < 0) return Vec3fa(0.0f);
else return transparency;
Expand Down
9 changes: 5 additions & 4 deletions tutorials/hair_geometry/hair_geometry_device.ispc
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ RTC_SYCL_INDIRECTLY_CALLABLE unmasked void occlusionFilter(const RTCFilterFuncti
valid_i[programIndex] = 0;
}

Vec3f occluded(RTCScene scene, uniform RayQueryContext* uniform context, Ray& ray)
Vec3f occluded(RTCTraversable traversable, uniform RayQueryContext* uniform context, Ray& ray)
{
Vec3f transparency = make_Vec3f(1.0f);
context->userRayExt = &transparency;
Expand All @@ -247,7 +247,7 @@ Vec3f occluded(RTCScene scene, uniform RayQueryContext* uniform context, Ray& ra
args.feature_mask = (uniform RTCFeatureFlags) (FEATURE_MASK);
args.filter = occlusionFilter;

rtcOccludedV(scene,RTCRay_(ray),&args);
rtcTraversableOccludedV(traversable,RTCRay_(ray),&args);
context->userRayExt = NULL;

if (ray.tfar < 0) return make_Vec3f(0.0f);
Expand Down Expand Up @@ -286,7 +286,7 @@ Vec3f renderPixel(const uniform TutorialData& data, float x, float y, const unif
return color;

/* intersect ray with scene and gather all hits */
rtcIntersectV(data.scene,RTCRayHit_(ray),&args);
rtcTraversableIntersectV(data.traversable,RTCRayHit_(ray),&args);
RayStats_addRay(stats);

/* exit if we hit environment */
Expand Down Expand Up @@ -326,7 +326,7 @@ Vec3f renderPixel(const uniform TutorialData& data, float x, float y, const unif

/* sample directional light */
Ray shadow = make_Ray(ray.org + ray.tfar*ray.dir, neg(make_Vec3f(data.dirlight_direction)), eps, inf, time);
Vec3f T = occluded(data.scene,&context,shadow);
Vec3f T = occluded(data.traversable,&context,shadow);
RayStats_addShadowRay(stats);
Vec3f c = AnisotropicBlinn__eval(&brdf,neg(ray.dir),neg(make_Vec3f(data.dirlight_direction)));
color = color + weight*c*T*make_Vec3f(data.dirlight_intensity);
Expand Down Expand Up @@ -416,6 +416,7 @@ export void device_init (uniform int8* uniform cfg)

/* create scene */
g_scene = data.scene = convertScene(data.ispc_scene);
data.traversable = rtcGetSceneTraversable(data.scene);
}

export void renderFrameStandard (uniform int* uniform pixels,
Expand Down
2 changes: 2 additions & 0 deletions tutorials/hair_geometry/hair_geometry_device.isph
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ extern uniform Vec3fa g_ambient_intensity;
struct TutorialData
{
RTCScene scene;
RTCTraversable traversable;
uniform ISPCScene* uniform ispc_scene;
uniform Vec3f dirlight_direction;
uniform Vec3f dirlight_intensity;
Expand Down Expand Up @@ -47,6 +48,7 @@ namespace embree {
void TutorialData_Constructor(uniform TutorialData* uniform This)
{
This->scene = NULL;
This->traversable = NULL;
This->ispc_scene = g_ispc_scene;
This->dirlight_direction = make_Vec3f(g_dirlight_direction);
This->dirlight_intensity = make_Vec3f(g_dirlight_intensity);
Expand Down
7 changes: 4 additions & 3 deletions tutorials/instanced_geometry/instanced_geometry_device.ispc
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Vec3f renderPixel(const uniform TutorialData& data, float x, float y, const unif
rtcInitIntersectArguments(&iargs);
iargs.feature_mask = (uniform RTCFeatureFlags) (FEATURE_MASK);

rtcIntersectV(data.g_scene,RTCRayHit_(ray),&iargs);
rtcTraversableIntersectV(data.g_traversable,RTCRayHit_(ray),&iargs);
RayStats_addRay(stats);

/* shade pixels */
Expand All @@ -186,7 +186,7 @@ Vec3f renderPixel(const uniform TutorialData& data, float x, float y, const unif
if (ray.instID[0] != RTC_INVALID_GEOMETRY_ID)
{
AffineSpace3f xfm;
rtcGetGeometryTransformFromScene(data.g_scene,ray.instID[0],0.0f,RTC_FORMAT_FLOAT3X4_COLUMN_MAJOR,&xfm);
rtcGetGeometryTransformFromTraversable(data.g_traversable,ray.instID[0],0.0f,RTC_FORMAT_FLOAT3X4_COLUMN_MAJOR,&xfm);
Ns = xfmNormal(xfm,Ns);
//Ns = xfmVector(data.normal_xfm[ray.instID[0]],Ns);
}
Expand All @@ -207,7 +207,7 @@ Vec3f renderPixel(const uniform TutorialData& data, float x, float y, const unif
rtcInitOccludedArguments(&sargs);
sargs.feature_mask = (uniform RTCFeatureFlags) (FEATURE_MASK);

rtcOccludedV(data.g_scene,RTCRay_(shadow),&sargs);
rtcTraversableOccludedV(data.g_traversable,RTCRay_(shadow),&sargs);
RayStats_addShadowRay(stats);

/* add light contribution */
Expand Down Expand Up @@ -341,6 +341,7 @@ export void device_render (uniform int* uniform pixels,
rtcCommitGeometry(g_instance2);
rtcCommitGeometry(g_instance3);
rtcCommitScene (data.g_scene);
data.g_traversable = rtcGetSceneTraversable(data.g_scene);
}

/* called by the C++ code for cleanup */
Expand Down
2 changes: 2 additions & 0 deletions tutorials/instanced_geometry/instanced_geometry_device.isph
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ struct TutorialData
/* scene data */
RTCScene g_scene;
RTCScene g_scene1;
RTCTraversable g_traversable;

uniform AffineSpace3f* uniform instance_xfm;
uniform LinearSpace3f* uniform normal_xfm;
Expand All @@ -31,6 +32,7 @@ void TutorialData_Constructor(uniform TutorialData* uniform This)
{
This->g_scene = NULL;
This->g_scene1 = NULL;
This->g_traversable = NULL;
This->instance_xfm = uniform new uniform AffineSpace3f[4];
This->normal_xfm = uniform new uniform LinearSpace3f[4];
This->colors = uniform new uniform Vec3f[4*4];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ extern "C" void device_init (char* cfg)

/* commit changes to scene */
rtcCommitScene (data.g_scene);

data.g_traversable = rtcGetSceneTraversable(data.g_scene);
}

Expand Down
5 changes: 3 additions & 2 deletions tutorials/intersection_filter/intersection_filter_device.ispc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void renderPixelStandard(const uniform TutorialData& data,
#if USE_ARGUMENT_CALLBACKS
iargs.filter = intersectionFilter;
#endif
rtcIntersectV(data.g_scene,RTCRayHit_(primary),&iargs);
rtcTraversableIntersectV(data.g_traversable,RTCRayHit_(primary),&iargs);
RayStats_addRay(stats);

/* shade pixels */
Expand All @@ -101,7 +101,7 @@ void renderPixelStandard(const uniform TutorialData& data,
#if USE_ARGUMENT_CALLBACKS
sargs.filter = occlusionFilter;
#endif
rtcOccludedV(data.g_scene,RTCRay_(shadow),&sargs);
rtcTraversableOccludedV(data.g_traversable,RTCRay_(shadow),&sargs);
RayStats_addShadowRay(stats);

/* add light contribution */
Expand Down Expand Up @@ -378,6 +378,7 @@ export void device_init (uniform int8* uniform cfg)

/* commit changes to scene */
rtcCommitScene (data.g_scene);
data.g_traversable = rtcGetSceneTraversable(data.g_scene);
}

/* task that renders a single screen tile */
Expand Down
2 changes: 2 additions & 0 deletions tutorials/intersection_filter/intersection_filter_device.isph
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
struct TutorialData
{
RTCScene g_scene;
RTCTraversable g_traversable;
uniform Vec3f* uniform colors;

RTCFilterFunctionN intersectionFilter;
Expand All @@ -15,6 +16,7 @@ struct TutorialData
inline void TutorialData_Constructor(uniform TutorialData* uniform This)
{
This->g_scene = NULL;
This->g_traversable = NULL;
This->colors = NULL;
This->intersectionFilter = NULL;
This->occlusionFilter = NULL;
Expand Down
6 changes: 6 additions & 0 deletions tutorials/ispc2cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,15 @@ sed -i.backup 's/RTCRay1/RTCRay/g' $2
sed -i.backup 's/rtcIntersectV/rtcIntersect1/g' $2
sed -i.backup 's/rtcOccludedV/rtcOccluded1/g' $2

sed -i.backup 's/rtcTraversableIntersectV/rtcTraversableIntersect1/g' $2
sed -i.backup 's/rtcTraversableOccludedV/rtcTraversableOccluded1/g' $2

sed -i.backup 's/rtcForwardIntersectV/rtcForwardIntersect1/g' $2
sed -i.backup 's/rtcForwardOccludedV/rtcForwardOccluded1/g' $2

sed -i.backup 's/rtcTraversableForwardIntersectV/rtcTraversableForwardIntersect1/g' $2
sed -i.backup 's/rtcTraversableForwardOccludedV/rtcTraversableForwardOccluded1/g' $2

sed -i.backup 's/rtcInterpolateV/rtcInterpolate/g' $2

sed -i.backup 's/Texture_FLOAT32/Texture::FLOAT32/g' $2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ export void device_init (uniform int8* uniform cfg)

/* commit changes to scene */
rtcCommitScene (g_scene);
data.g_traversable = rtcGetSceneTraversable(data.g_scene);
}

/* task that renders a single screen tile */
Expand All @@ -625,7 +626,7 @@ Vec3f renderPixel(const uniform TutorialData& data, float x, float y, const unif
iargs.intersect = sphereIntersectFuncN;
#endif

rtcIntersectV(data.g_scene,RTCRayHit_(ray),&iargs);
rtcTraversableIntersectV(data.g_traversable,RTCRayHit_(ray),&iargs);
RayStats_addRay(stats);

/* shade pixels */
Expand Down Expand Up @@ -662,7 +663,7 @@ Vec3f renderPixel(const uniform TutorialData& data, float x, float y, const unif
#if USE_ARGUMENT_CALLBACKS
sargs.occluded = sphereOccludedFuncN;
#endif
rtcOccludedV(data.g_scene,RTCRay_(shadow),&sargs);
rtcTraversableOccludedV(data.g_traversable,RTCRay_(shadow),&sargs);
RayStats_addShadowRay(stats);

/* add light contribution */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ struct TutorialData
uniform int frameID;

RTCScene g_scene;
RTCTraversable g_traversable;
uniform Vec3f* uniform face_colors;
uniform float g_time;

Expand Down Expand Up @@ -59,6 +60,7 @@ inline void TutorialData_Constructor(uniform TutorialData* uniform This)
{
This->frameID = 50;
This->g_scene = NULL;
This->g_traversable = NULL;
This->face_colors = uniform new uniform Vec3f[12];
This->g_time = 0;
This->g_accu = NULL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace embree {
#define FEATURE_MASK \
RTC_FEATURE_FLAG_TRIANGLE | \
RTC_FEATURE_FLAG_INSTANCE

RTCScene g_scene = nullptr;
TutorialData g_data;
extern "C" bool g_changed;
Expand Down
Loading