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:
Diffstat (limited to 'intern/cycles/device/multi/device.cpp')
-rw-r--r--intern/cycles/device/multi/device.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/intern/cycles/device/multi/device.cpp b/intern/cycles/device/multi/device.cpp
index 6904d2c2dc6..9605c6a7538 100644
--- a/intern/cycles/device/multi/device.cpp
+++ b/intern/cycles/device/multi/device.cpp
@@ -138,6 +138,15 @@ class MultiDevice : public Device {
return true;
}
+ bool load_osl_kernels() override
+ {
+ foreach (SubDevice &sub, devices)
+ if (!sub.device->load_osl_kernels())
+ return false;
+
+ return true;
+ }
+
void build_bvh(BVH *bvh, Progress &progress, bool refit) override
{
/* Try to build and share a single acceleration structure, if possible */
@@ -204,10 +213,12 @@ class MultiDevice : public Device {
virtual void *get_cpu_osl_memory() override
{
- if (devices.size() > 1) {
+ /* Always return the OSL memory of the CPU device (this works since the constructor above
+ * guarantees that CPU devices are always added to the back). */
+ if (devices.size() > 1 && devices.back().device->info.type != DEVICE_CPU) {
return NULL;
}
- return devices.front().device->get_cpu_osl_memory();
+ return devices.back().device->get_cpu_osl_memory();
}
bool is_resident(device_ptr key, Device *sub_device) override