Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Mours <pmours@nvidia.com>2019-09-12 15:50:06 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-09-13 12:50:11 +0300
commita2b52dc5716a97e5413acbd6eefc9ce3788b6456 (patch)
tree7e6d6c17b73671e67c1f7fbdadd821b4541f820f /intern/cycles/device/device.cpp
parent53932f1f068501bfb095c407a7777a964dc5ec1c (diff)
Cycles: add Optix device backend
This uses hardware-accelerated raytracing on NVIDIA RTX graphics cards. It is still currently experimental. Most features are supported, but a few are still missing like baking, branched path tracing and using CPU memory. https://wiki.blender.org/wiki/Reference/Release_Notes/2.81/Cycles#NVIDIA_RTX For building with Optix support, the Optix SDK must be installed. See here for build instructions: https://wiki.blender.org/wiki/Building_Blender/CUDA Differential Revision: https://developer.blender.org/D5363
Diffstat (limited to 'intern/cycles/device/device.cpp')
-rw-r--r--intern/cycles/device/device.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp
index 47d111802cd..fe8a814cd14 100644
--- a/intern/cycles/device/device.cpp
+++ b/intern/cycles/device/device.cpp
@@ -38,6 +38,7 @@ bool Device::need_devices_update = true;
thread_mutex Device::device_mutex;
vector<DeviceInfo> Device::opencl_devices;
vector<DeviceInfo> Device::cuda_devices;
+vector<DeviceInfo> Device::optix_devices;
vector<DeviceInfo> Device::cpu_devices;
vector<DeviceInfo> Device::network_devices;
uint Device::devices_initialized_mask = 0;
@@ -379,6 +380,14 @@ Device *Device::create(DeviceInfo &info, Stats &stats, Profiler &profiler, bool
device = NULL;
break;
#endif
+#ifdef WITH_OPTIX
+ case DEVICE_OPTIX:
+ if (device_optix_init())
+ device = device_optix_create(info, stats, profiler, background);
+ else
+ device = NULL;
+ break;
+#endif
#ifdef WITH_MULTI
case DEVICE_MULTI:
device = device_multi_create(info, stats, profiler, background);
@@ -410,6 +419,8 @@ DeviceType Device::type_from_string(const char *name)
return DEVICE_CPU;
else if (strcmp(name, "CUDA") == 0)
return DEVICE_CUDA;
+ else if (strcmp(name, "OPTIX") == 0)
+ return DEVICE_OPTIX;
else if (strcmp(name, "OPENCL") == 0)
return DEVICE_OPENCL;
else if (strcmp(name, "NETWORK") == 0)
@@ -426,6 +437,8 @@ string Device::string_from_type(DeviceType type)
return "CPU";
else if (type == DEVICE_CUDA)
return "CUDA";
+ else if (type == DEVICE_OPTIX)
+ return "OPTIX";
else if (type == DEVICE_OPENCL)
return "OPENCL";
else if (type == DEVICE_NETWORK)
@@ -443,6 +456,9 @@ vector<DeviceType> Device::available_types()
#ifdef WITH_CUDA
types.push_back(DEVICE_CUDA);
#endif
+#ifdef WITH_OPTIX
+ types.push_back(DEVICE_OPTIX);
+#endif
#ifdef WITH_OPENCL
types.push_back(DEVICE_OPENCL);
#endif
@@ -488,6 +504,20 @@ vector<DeviceInfo> Device::available_devices(uint mask)
}
#endif
+#ifdef WITH_OPTIX
+ if (mask & DEVICE_MASK_OPTIX) {
+ if (!(devices_initialized_mask & DEVICE_MASK_OPTIX)) {
+ if (device_optix_init()) {
+ device_optix_info(optix_devices);
+ }
+ devices_initialized_mask |= DEVICE_MASK_OPTIX;
+ }
+ foreach (DeviceInfo &info, optix_devices) {
+ devices.push_back(info);
+ }
+ }
+#endif
+
if (mask & DEVICE_MASK_CPU) {
if (!(devices_initialized_mask & DEVICE_MASK_CPU)) {
device_cpu_info(cpu_devices);