mirror of
https://github.com/mmp/pbrt-v4
synced 2026-09-26 16:20:07 +03:00
compatibility with optix 8
This commit is contained in:
parent
b5be145843
commit
44a61fad81
2 changed files with 11 additions and 4 deletions
|
|
@ -1053,8 +1053,11 @@ OptixPipelineCompileOptions OptiXAggregate::getPipelineCompileOptions() {
|
|||
pipelineCompileOptions.numAttributeValues = 4;
|
||||
// OPTIX_EXCEPTION_FLAG_NONE;
|
||||
pipelineCompileOptions.exceptionFlags =
|
||||
(OPTIX_EXCEPTION_FLAG_STACK_OVERFLOW | OPTIX_EXCEPTION_FLAG_TRACE_DEPTH |
|
||||
OPTIX_EXCEPTION_FLAG_DEBUG);
|
||||
(OPTIX_EXCEPTION_FLAG_STACK_OVERFLOW | OPTIX_EXCEPTION_FLAG_TRACE_DEPTH);
|
||||
#if (OPTIX_VERSION < 80000)
|
||||
// This flag is remove since OptiX 8.0.0
|
||||
pipelineCompileOptions.exceptionFlags |= OPTIX_EXCEPTION_FLAG_DEBUG;
|
||||
#endif
|
||||
pipelineCompileOptions.pipelineLaunchParamsVariableName = "params";
|
||||
|
||||
return pipelineCompileOptions;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,9 @@ Denoiser::Denoiser(Vector2i resolution, bool haveAlbedoAndNormal)
|
|||
OPTIX_CHECK(optixDeviceContextCreate(cudaContext, 0, &optixContext));
|
||||
|
||||
OptixDenoiserOptions options = {};
|
||||
#if (OPTIX_VERSION >= 70300)
|
||||
#if (OPTIX_VERSION >= 80000)
|
||||
options.denoiseAlpha = OPTIX_DENOISER_ALPHA_MODE_COPY;
|
||||
#elif (OPTIX_VERSION >= 70300)
|
||||
if (haveAlbedoAndNormal)
|
||||
options.guideAlbedo = options.guideNormal = 1;
|
||||
|
||||
|
|
@ -101,7 +103,9 @@ void Denoiser::Denoise(RGB *rgb, Normal3f *n, RGB *albedo, RGB *result) {
|
|||
CUdeviceptr(scratchBuffer), memorySizes.withoutOverlapScratchSizeInBytes));
|
||||
|
||||
OptixDenoiserParams params = {};
|
||||
#if (OPTIX_VERSION >= 70500)
|
||||
#if (OPTIX_VERSION >= 80000)
|
||||
// denoiseAlpha is moved to OptixDenoiserOptions in OptiX 8.0
|
||||
#elif (OPTIX_VERSION >= 70500)
|
||||
params.denoiseAlpha = OPTIX_DENOISER_ALPHA_MODE_COPY;
|
||||
#else
|
||||
params.denoiseAlpha = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue