Skip to content

Commit

Permalink
Address compile issue with macro expansion for using optixModuleCreat…
Browse files Browse the repository at this point in the history
…e or optixModuleCreateFromPTX
  • Loading branch information
aclysma committed Apr 3, 2023
1 parent a2bd4c8 commit dfaaa6f
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/pbrt/gpu/aggregate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1069,14 +1069,21 @@ OptixModule OptiXAggregate::createOptiXModule(OptixDeviceContext optixContext,
char log[4096];
size_t logSize = sizeof(log);
OptixModule optixModule;

#if (OPTIX_VERSION >= 70700)
OPTIX_CHECK_WITH_LOG(optixModuleCreate(
#define OPTIX_MODULE_CREATE_FN optixModuleCreate
#else
OPTIX_CHECK_WITH_LOG(optixModuleCreateFromPTX(
#define OPTIX_MODULE_CREATE_FN optixModuleCreateFromPTX
#endif
optixContext, &moduleCompileOptions, &pipelineCompileOptions,
ptx, strlen(ptx), log, &logSize, &optixModule),
log);

OPTIX_CHECK_WITH_LOG(
OPTIX_MODULE_CREATE_FN(
optixContext, &moduleCompileOptions, &pipelineCompileOptions,
ptx, strlen(ptx), log, &logSize, &optixModule
),
log
);

LOG_VERBOSE("%s", log);

return optixModule;
Expand Down

0 comments on commit dfaaa6f

Please sign in to comment.