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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-09-12 17:13:56 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-09-12 17:13:56 +0400
commitebc653463ddfd9f8b893b6acbcc6465972e6abc6 (patch)
tree6b3cc2ba3f04994cf9f8d8f5bca6d63cfe2c9d1f /intern/cycles/device/device_multi.cpp
parentc40492205b4369de3babe63b43d127ca622773ec (diff)
Cycles:
* Fix missing update when editing objects with emission materials. * Fix preview pass rendering set to 1 not showing full resolution. * Fix CUDA runtime compiling failing due to missing cache directory. * Use settings from first render layer for visibility and material override. And a bunch of incomplete and still disabled code mostly related to closure sampling.
Diffstat (limited to 'intern/cycles/device/device_multi.cpp')
-rw-r--r--intern/cycles/device/device_multi.cpp34
1 files changed, 28 insertions, 6 deletions
diff --git a/intern/cycles/device/device_multi.cpp b/intern/cycles/device/device_multi.cpp
index cae63596d3b..f2f6251685e 100644
--- a/intern/cycles/device/device_multi.cpp
+++ b/intern/cycles/device/device_multi.cpp
@@ -47,9 +47,6 @@ public:
MultiDevice(bool background_)
: unique_ptr(1)
{
- /* enforce background for now */
- background = true;
-
Device *device;
/* add CPU device */
@@ -125,6 +122,15 @@ public:
return desc.str();
}
+ bool load_kernels()
+ {
+ foreach(SubDevice& sub, devices)
+ if(!sub.device->load_kernels())
+ return false;
+
+ return true;
+ }
+
void mem_alloc(device_memory& mem, MemoryType type)
{
foreach(SubDevice& sub, devices) {
@@ -219,12 +225,26 @@ public:
void pixels_alloc(device_memory& mem)
{
- Device::pixels_alloc(mem);
+ foreach(SubDevice& sub, devices) {
+ mem.device_pointer = 0;
+ sub.device->pixels_alloc(mem);
+ sub.ptr_map[unique_ptr] = mem.device_pointer;
+ }
+
+ mem.device_pointer = unique_ptr++;
}
void pixels_free(device_memory& mem)
{
- Device::pixels_free(mem);
+ device_ptr tmp = mem.device_pointer;
+
+ foreach(SubDevice& sub, devices) {
+ mem.device_pointer = sub.ptr_map[tmp];
+ sub.device->pixels_free(mem);
+ sub.ptr_map.erase(sub.ptr_map.find(tmp));
+ }
+
+ mem.device_pointer = 0;
}
void pixels_copy_from(device_memory& mem, int y, int w, int h)
@@ -248,14 +268,16 @@ public:
{
device_ptr tmp = rgba.device_pointer;
int i = 0, sub_h = h/devices.size();
+ int sub_height = height/devices.size();
foreach(SubDevice& sub, devices) {
int sy = y + i*sub_h;
int sh = (i == (int)devices.size() - 1)? h - sub_h*i: sub_h;
+ int sheight = (i == (int)devices.size() - 1)? height - sub_height*i: sub_height;
/* adjust math for w/width */
rgba.device_pointer = sub.ptr_map[tmp];
- sub.device->draw_pixels(rgba, sy, w, sh, width, height, transparent);
+ sub.device->draw_pixels(rgba, sy, w, sh, width, sheight, transparent);
i++;
}