Skip to content

Commit

Permalink
switching back to more standard owl api
Browse files Browse the repository at this point in the history
  • Loading branch information
natevm committed Sep 22, 2021
1 parent 74cafed commit 2806fd4
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions src/nvisii/nvisii.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,26 +271,6 @@ int getDeviceCount() {
return owlGetDeviceCount(OptixData.context);
}

OWLMissProg missProgCreate(OWLContext context, OWLModule module, const char *programName, size_t sizeOfVarStruct, OWLVarDecl *vars, size_t numVars)
{
return owlMissProgCreate(context, module, programName, sizeOfVarStruct, vars, numVars);
}

OWLRayGen rayGenCreate(OWLContext context, OWLModule module, const char *programName, size_t sizeOfVarStruct, OWLVarDecl *vars, size_t numVars)
{
return owlRayGenCreate(context, module, programName, sizeOfVarStruct, vars, numVars);
}

OWLGeomType geomTypeCreate(OWLContext context, OWLGeomKind kind, size_t sizeOfVarStruct, OWLVarDecl *vars, size_t numVars)
{
return owlGeomTypeCreate(context, kind, sizeOfVarStruct, vars, numVars);
}

void geomTypeSetClosestHit(OWLGeomType type, int rayType, OWLModule module, const char *progName)
{
owlGeomTypeSetClosestHit(type, rayType, module, progName);
}

OWLGeom geomCreate(OWLContext context, OWLGeomType type)
{
return owlGeomCreate(context, type);
Expand Down Expand Up @@ -703,16 +683,16 @@ void initializeOptix(bool headless)
owlParamsSetRaw(OD.launchParams, "timeSamplingInterval", &OD.LP.timeSamplingInterval);

OWLVarDecl trianglesGeomVars[] = {{/* sentinel to mark end of list */}};
OD.trianglesGeomType = geomTypeCreate(OD.context, OWL_GEOM_TRIANGLES, sizeof(TrianglesGeomData), trianglesGeomVars,-1);
OD.trianglesGeomType = owlGeomTypeCreate(OD.context, OWL_GEOM_TRIANGLES, sizeof(TrianglesGeomData), trianglesGeomVars,-1);
OWLVarDecl volumeGeomVars[] = {
{ "bbmin", OWL_USER_TYPE(glm::vec4), OWL_OFFSETOF(VolumeGeomData, bbmin)},
{ "bbmax", OWL_USER_TYPE(glm::vec4), OWL_OFFSETOF(VolumeGeomData, bbmax)},
{ "volumeID", OWL_USER_TYPE(uint32_t), OWL_OFFSETOF(VolumeGeomData, volumeID)},
{/* sentinel to mark end of list */}
};
OD.volumeGeomType = owlGeomTypeCreate(OD.context, OWL_GEOM_USER, sizeof(VolumeGeomData), volumeGeomVars, -1);
geomTypeSetClosestHit(OD.trianglesGeomType, /*ray type */ 0, OD.module,"TriangleMesh");
geomTypeSetClosestHit(OD.trianglesGeomType, /*ray type */ 1, OD.module,"ShadowRay");
owlGeomTypeSetClosestHit(OD.trianglesGeomType, /*ray type */ 0, OD.module,"TriangleMesh");
owlGeomTypeSetClosestHit(OD.trianglesGeomType, /*ray type */ 1, OD.module,"ShadowRay");
owlGeomTypeSetClosestHit(OD.volumeGeomType, /*ray type */ 0, OD.module,"VolumeMesh");
owlGeomTypeSetClosestHit(OD.volumeGeomType, /*ray type */ 1, OD.module,"VolumeShadowRay");
owlGeomTypeSetIntersectProg(OD.volumeGeomType, /*ray type */ 0, OD.module,"VolumeIntersection");
Expand All @@ -721,14 +701,14 @@ void initializeOptix(bool headless)

// Setup miss prog
OWLVarDecl missProgVars[] = {{ /* sentinel to mark end of list */ }};
OD.missProg = missProgCreate(OD.context,OD.module,"miss",sizeof(MissProgData),missProgVars,-1);
OD.missProg = owlMissProgCreate(OD.context,OD.module,"miss",sizeof(MissProgData),missProgVars,-1);

// Setup ray gen program
OWLVarDecl rayGenVars[] = {
{ "deviceIndex", OWL_DEVICE, OWL_OFFSETOF(RayGenData, deviceIndex)}, // this var is automatically set
{ "deviceCount", OWL_INT, OWL_OFFSETOF(RayGenData, deviceCount)},
{ /* sentinel to mark end of list */ }};
OD.rayGen = rayGenCreate(OD.context,OD.module,"rayGen", sizeof(RayGenData), rayGenVars,-1);
OD.rayGen = owlRayGenCreate(OD.context,OD.module,"rayGen", sizeof(RayGenData), rayGenVars,-1);
owlRayGenSet1i(OD.rayGen, "deviceCount", numGPUsFound);

owlBuildPrograms(OD.context);
Expand Down

0 comments on commit 2806fd4

Please sign in to comment.