diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-10-08 05:32:25 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-10-08 14:17:33 +0300 |
commit | cdb0b3b1dcd4e9962426422868b2f40535670a5c (patch) | |
tree | 1a3d1727d4da92536d6c3615cbe0f9dffc1315b8 /intern/cycles/device | |
parent | 4b3e6cb728cb5d0e603f3b23b32ad1f8bfc68558 (diff) |
Code refactor: use DeviceInfo to enable QBVH and decoupled volume shading.
Diffstat (limited to 'intern/cycles/device')
-rw-r--r-- | intern/cycles/device/device.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/device/device.h | 4 | ||||
-rw-r--r-- | intern/cycles/device/device_cpu.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/device/device_cuda.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/device/device_network.cpp | 6 | ||||
-rw-r--r-- | intern/cycles/device/device_opencl.cpp | 2 |
6 files changed, 19 insertions, 1 deletions
diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp index f64436aec7b..533294407ea 100644 --- a/intern/cycles/device/device.cpp +++ b/intern/cycles/device/device.cpp @@ -379,10 +379,14 @@ DeviceInfo Device::get_multi_device(vector<DeviceInfo> subdevices) info.num = 0; info.has_bindless_textures = true; + info.has_volume_decoupled = true; + info.has_qbvh = true; foreach(DeviceInfo &device, subdevices) { assert(device.type == info.multi_devices[0].type); info.has_bindless_textures &= device.has_bindless_textures; + info.has_volume_decoupled &= device.has_volume_decoupled; + info.has_qbvh &= device.has_qbvh; } return info; diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h index 0e0a0079209..c134fc9411e 100644 --- a/intern/cycles/device/device.h +++ b/intern/cycles/device/device.h @@ -55,6 +55,8 @@ public: bool display_device; bool advanced_shading; bool has_bindless_textures; /* flag for GPU and Multi device */ + bool has_volume_decoupled; + bool has_qbvh; bool use_split_kernel; /* Denotes if the device is going to run cycles using split-kernel */ vector<DeviceInfo> multi_devices; @@ -66,6 +68,8 @@ public: display_device = false; advanced_shading = true; has_bindless_textures = false; + has_volume_decoupled = false; + has_qbvh = false; use_split_kernel = false; } diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp index ac6d3246d38..a17caabc850 100644 --- a/intern/cycles/device/device_cpu.cpp +++ b/intern/cycles/device/device_cpu.cpp @@ -1024,6 +1024,8 @@ void device_cpu_info(vector<DeviceInfo>& devices) info.id = "CPU"; info.num = 0; info.advanced_shading = true; + info.has_qbvh = system_cpu_support_sse2(); + info.has_volume_decoupled = true; devices.insert(devices.begin(), info); } diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index dcbe6033bcc..56a56c5217c 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -2128,6 +2128,8 @@ void device_cuda_info(vector<DeviceInfo>& devices) info.advanced_shading = (major >= 2); info.has_bindless_textures = (major >= 3); + info.has_volume_decoupled = false; + info.has_qbvh = false; int pci_location[3] = {0, 0, 0}; cuDeviceGetAttribute(&pci_location[0], CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID, num); diff --git a/intern/cycles/device/device_network.cpp b/intern/cycles/device/device_network.cpp index deea59f1d23..ced10c98dc9 100644 --- a/intern/cycles/device/device_network.cpp +++ b/intern/cycles/device/device_network.cpp @@ -343,7 +343,11 @@ void device_network_info(vector<DeviceInfo>& devices) info.description = "Network Device"; info.id = "NETWORK"; info.num = 0; - info.advanced_shading = true; /* todo: get this info from device */ + + /* todo: get this info from device */ + info.advanced_shading = true; + info.has_volume_decoupled = false; + info.has_qbvh = false; devices.push_back(info); } diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp index 9d89decaaaf..5808a31e605 100644 --- a/intern/cycles/device/device_opencl.cpp +++ b/intern/cycles/device/device_opencl.cpp @@ -123,6 +123,8 @@ void device_opencl_info(vector<DeviceInfo>& devices) info.advanced_shading = OpenCLInfo::kernel_use_advanced_shading(platform_name); info.use_split_kernel = OpenCLInfo::kernel_use_split(platform_name, device_type); + info.has_volume_decoupled = false; + info.has_qbvh = false; info.id = string("OPENCL_") + platform_name + "_" + device_name + "_" + hardware_id; devices.push_back(info); num_devices++; |