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

Newer Optix version support #10

Open
wants to merge 3 commits into
base: release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions lib/rendering/rt/gpu/GPUAcceleratorImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1005,11 +1005,11 @@ GPUAcceleratorImpl::GPUAcceleratorImpl(const scene_rdl2::rdl2::Layer *layer,
}

scene_rdl2::logging::Logger::info("GPU: Creating pipeline");


OptixPipelineLinkOptions pipelineLinkOptions = {};
if (!createOptixPipeline(mContext,
pipelineCompileOptions,
{ 1, // maxTraceDepth
OPTIX_COMPILE_DEBUG_LEVEL_NONE },
pipelineLinkOptions,
mProgramGroups,
&mPipeline,
errorMsg)) {
Expand Down
6 changes: 0 additions & 6 deletions lib/rendering/rt/gpu/GPUPrimitiveGroup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ GPUPrimitiveGroup::build(CUstream cudaStream,
oinstance.instanceId = 0;
oinstance.visibilityMask = 255;
oinstance.sbtOffset = mSBTOffset;
oinstance.flags = OPTIX_INSTANCE_FLAG_DISABLE_TRANSFORM;
oinstance.traversableHandle = mTrianglesGAS;
instances.push_back(oinstance);
}
Expand All @@ -87,7 +86,6 @@ GPUPrimitiveGroup::build(CUstream cudaStream,
oinstance.instanceId = 0;
oinstance.visibilityMask = 255;
oinstance.sbtOffset = mSBTOffset + mTriMeshes.size();
oinstance.flags = OPTIX_INSTANCE_FLAG_DISABLE_TRANSFORM;
oinstance.traversableHandle = mTrianglesMBGAS;
instances.push_back(oinstance);
}
Expand All @@ -108,7 +106,6 @@ GPUPrimitiveGroup::build(CUstream cudaStream,
oinstance.instanceId = 0;
oinstance.visibilityMask = 255;
oinstance.sbtOffset = mSBTOffset + mTriMeshes.size() + mTriMeshesMB.size();
oinstance.flags = OPTIX_INSTANCE_FLAG_DISABLE_TRANSFORM;
oinstance.traversableHandle = mRoundCurvesGAS;
instances.push_back(oinstance);
}
Expand All @@ -129,7 +126,6 @@ GPUPrimitiveGroup::build(CUstream cudaStream,
oinstance.instanceId = 0;
oinstance.visibilityMask = 255;
oinstance.sbtOffset = mSBTOffset + mTriMeshes.size() + mTriMeshesMB.size() + mRoundCurves.size();
oinstance.flags = OPTIX_INSTANCE_FLAG_DISABLE_TRANSFORM;
oinstance.traversableHandle = mRoundCurvesMBGAS;
instances.push_back(oinstance);
}
Expand All @@ -151,7 +147,6 @@ GPUPrimitiveGroup::build(CUstream cudaStream,
oinstance.visibilityMask = 255;
oinstance.sbtOffset = mSBTOffset + mTriMeshes.size() + mTriMeshesMB.size() +
mRoundCurves.size() + mRoundCurvesMB.size();
oinstance.flags = OPTIX_INSTANCE_FLAG_DISABLE_TRANSFORM;
oinstance.traversableHandle = mCustomPrimitivesGAS;
instances.push_back(oinstance);

Expand Down Expand Up @@ -185,7 +180,6 @@ GPUPrimitiveGroup::build(CUstream cudaStream,
// The xform is specified in the mMMTTraversable instead. The child
// node is the MatrixMotionTransform of the instance, which itself
// has the group's top level IAS node as its child.
oinstance.flags = OPTIX_INSTANCE_FLAG_DISABLE_TRANSFORM;
GPUXform::identityXform().toOptixTransform(oinstance.transform);
oinstance.traversableHandle = mInstances[i]->mMMTTraversable;
}
Expand Down
18 changes: 9 additions & 9 deletions lib/rendering/rt/gpu/GPUUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ createOptixModule(OptixDeviceContext context,

char logString[MAX_LOGSTRING_SIZE];
size_t logStringSize = sizeof(logString);
if (optixModuleCreateFromPTX(context,
&moduleCompileOptions,
&pipelineCompileOptions,
ptx.c_str(),
ptx.length(),
logString,
&logStringSize,
module) != OPTIX_SUCCESS) {
if (optixModuleCreate(context,
&moduleCompileOptions,
&pipelineCompileOptions,
ptx.c_str(),
ptx.length(),
logString,
&logStringSize,
module) != OPTIX_SUCCESS) {
*errorMsg = "Unable to create Optix module. Log: " + std::string(logString);
return false;
}
Expand Down Expand Up @@ -293,7 +293,7 @@ createOptixPipeline(OptixDeviceContext context,

OptixStackSizes stackSizes = {};
for (auto pg : pgs) {
if (optixUtilAccumulateStackSizes(pg, &stackSizes) != OPTIX_SUCCESS) {
if (optixUtilAccumulateStackSizes(pg, &stackSizes, *pipeline) != OPTIX_SUCCESS) {
optixPipelineDestroy(*pipeline);
*errorMsg = "Unable to accumulate Optix stack sizes.";
return false;
Expand Down