Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/device/optix/device_impl.cpp
| Show All 14 Lines | |||||
| * limitations under the License. | * limitations under the License. | ||||
| */ | */ | ||||
| #ifdef WITH_OPTIX | #ifdef WITH_OPTIX | ||||
| # include "device/optix/device_impl.h" | # include "device/optix/device_impl.h" | ||||
| # include "bvh/bvh.h" | # include "bvh/bvh.h" | ||||
| # include "bvh/bvh_optix.h" | # include "bvh/optix.h" | ||||
| # include "integrator/pass_accessor_gpu.h" | # include "integrator/pass_accessor_gpu.h" | ||||
| # include "render/buffers.h" | |||||
| # include "render/hair.h" | # include "scene/hair.h" | ||||
| # include "render/mesh.h" | # include "scene/mesh.h" | ||||
| # include "render/object.h" | # include "scene/object.h" | ||||
| # include "render/pass.h" | # include "scene/pass.h" | ||||
| # include "render/scene.h" | # include "scene/scene.h" | ||||
| # include "util/util_debug.h" | # include "util/debug.h" | ||||
| # include "util/util_logging.h" | # include "util/log.h" | ||||
| # include "util/util_md5.h" | # include "util/md5.h" | ||||
| # include "util/util_path.h" | # include "util/path.h" | ||||
| # include "util/util_progress.h" | # include "util/progress.h" | ||||
| # include "util/util_time.h" | # include "util/time.h" | ||||
| # undef __KERNEL_CPU__ | # undef __KERNEL_CPU__ | ||||
| # define __KERNEL_OPTIX__ | # define __KERNEL_OPTIX__ | ||||
| # include "kernel/device/optix/globals.h" | # include "kernel/device/optix/globals.h" | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| OptiXDevice::Denoiser::Denoiser(OptiXDevice *device) | OptiXDevice::Denoiser::Denoiser(OptiXDevice *device) | ||||
| Show All 39 Lines | switch (level) { | ||||
| break; | break; | ||||
| case 4: | case 4: | ||||
| LOG_IF(INFO, VLOG_IS_ON(1)) << message; | LOG_IF(INFO, VLOG_IS_ON(1)) << message; | ||||
| break; | break; | ||||
| } | } | ||||
| }; | }; | ||||
| # endif | # endif | ||||
| if (DebugFlags().optix.use_debug) { | if (DebugFlags().optix.use_debug) { | ||||
| VLOG(1) << "Using OptiX debug mode."; | |||||
| options.validationMode = OPTIX_DEVICE_CONTEXT_VALIDATION_MODE_ALL; | options.validationMode = OPTIX_DEVICE_CONTEXT_VALIDATION_MODE_ALL; | ||||
| } | } | ||||
| optix_assert(optixDeviceContextCreate(cuContext, &options, &context)); | optix_assert(optixDeviceContextCreate(cuContext, &options, &context)); | ||||
| # ifdef WITH_CYCLES_LOGGING | # ifdef WITH_CYCLES_LOGGING | ||||
| optix_assert(optixDeviceContextSetLogCallback( | optix_assert(optixDeviceContextSetLogCallback( | ||||
| context, options.logCallbackFunction, options.logCallbackData, options.logCallbackLevel)); | context, options.logCallbackFunction, options.logCallbackData, options.logCallbackLevel)); | ||||
| # endif | # endif | ||||
| ▲ Show 20 Lines • Show All 1,467 Lines • ▼ Show 20 Lines | void OptiXDevice::const_copy_to(const char *name, void *host, size_t size) | ||||
| /* Update data storage pointers in launch parameters. */ | /* Update data storage pointers in launch parameters. */ | ||||
| # define KERNEL_TEX(data_type, tex_name) \ | # define KERNEL_TEX(data_type, tex_name) \ | ||||
| if (strcmp(name, #tex_name) == 0) { \ | if (strcmp(name, #tex_name) == 0) { \ | ||||
| update_launch_params(offsetof(KernelParamsOptiX, tex_name), host, size); \ | update_launch_params(offsetof(KernelParamsOptiX, tex_name), host, size); \ | ||||
| return; \ | return; \ | ||||
| } | } | ||||
| KERNEL_TEX(IntegratorStateGPU, __integrator_state) | KERNEL_TEX(IntegratorStateGPU, __integrator_state) | ||||
| # include "kernel/kernel_textures.h" | # include "kernel/textures.h" | ||||
| # undef KERNEL_TEX | # undef KERNEL_TEX | ||||
| } | } | ||||
| void OptiXDevice::update_launch_params(size_t offset, void *data, size_t data_size) | void OptiXDevice::update_launch_params(size_t offset, void *data, size_t data_size) | ||||
| { | { | ||||
| const CUDAContextScope scope(this); | const CUDAContextScope scope(this); | ||||
| cuda_assert(cuMemcpyHtoD(launch_params.device_pointer + offset, data, data_size)); | cuda_assert(cuMemcpyHtoD(launch_params.device_pointer + offset, data, data_size)); | ||||
| } | } | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||
| #endif /* WITH_OPTIX */ | #endif /* WITH_OPTIX */ | ||||