Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/device/optix/device_impl.cpp
| Show First 20 Lines • Show All 885 Lines • ▼ Show 20 Lines | bool OptiXDevice::denoise_configure_if_needed(DenoiseContext &context) | ||||
| denoiser_.scratch_size = sizes.withOverlapScratchSizeInBytes; | denoiser_.scratch_size = sizes.withOverlapScratchSizeInBytes; | ||||
| denoiser_.scratch_offset = sizes.stateSizeInBytes; | denoiser_.scratch_offset = sizes.stateSizeInBytes; | ||||
| /* Allocate denoiser state if tile size has changed since last setup. */ | /* Allocate denoiser state if tile size has changed since last setup. */ | ||||
| denoiser_.state.alloc_to_device(denoiser_.scratch_offset + denoiser_.scratch_size); | denoiser_.state.alloc_to_device(denoiser_.scratch_offset + denoiser_.scratch_size); | ||||
| /* Initialize denoiser state for the current tile size. */ | /* Initialize denoiser state for the current tile size. */ | ||||
| const OptixResult result = optixDenoiserSetup(denoiser_.optix_denoiser, | const OptixResult result = optixDenoiserSetup( | ||||
| denoiser_.queue.stream(), | denoiser_.optix_denoiser, | ||||
| 0, /* Work around bug in r495 drivers that causes artifacts when denoiser setup is called | |||||
| on a stream that is not the default stream */ | |||||
| buffer_params.width, | buffer_params.width, | ||||
| buffer_params.height, | buffer_params.height, | ||||
| denoiser_.state.device_pointer, | denoiser_.state.device_pointer, | ||||
| denoiser_.scratch_offset, | denoiser_.scratch_offset, | ||||
| denoiser_.state.device_pointer + | denoiser_.state.device_pointer + denoiser_.scratch_offset, | ||||
| denoiser_.scratch_offset, | |||||
| denoiser_.scratch_size); | denoiser_.scratch_size); | ||||
| if (result != OPTIX_SUCCESS) { | if (result != OPTIX_SUCCESS) { | ||||
| set_error("Failed to set up OptiX denoiser"); | set_error("Failed to set up OptiX denoiser"); | ||||
| return false; | return false; | ||||
| } | } | ||||
| cuda_assert(cuCtxSynchronize()); | |||||
| denoiser_.is_configured = true; | denoiser_.is_configured = true; | ||||
| denoiser_.configured_size.x = buffer_params.width; | denoiser_.configured_size.x = buffer_params.width; | ||||
| denoiser_.configured_size.y = buffer_params.height; | denoiser_.configured_size.y = buffer_params.height; | ||||
| return true; | return true; | ||||
| } | } | ||||
| bool OptiXDevice::denoise_run(DenoiseContext &context, const DenoisePass &pass) | bool OptiXDevice::denoise_run(DenoiseContext &context, const DenoisePass &pass) | ||||
| ▲ Show 20 Lines • Show All 676 Lines • Show Last 20 Lines | |||||