Cycles: Make all #include statements relative to cycles source directory
[blender.git] / intern / cycles / device / device_network.cpp
index d4da3047110f89f358ddf521c12f70800a3bdc60..66758954f44b4c55783241819482593ec98d2b70 100644 (file)
  * limitations under the License.
  */
 
-#include "device.h"
-#include "device_intern.h"
-#include "device_network.h"
+#include "device/device.h"
+#include "device/device_intern.h"
+#include "device/device_network.h"
 
-#include "util_foreach.h"
-#include "util_logging.h"
+#include "util/util_foreach.h"
+#include "util/util_logging.h"
 
 #if defined(WITH_NETWORK)
 
@@ -51,6 +51,11 @@ public:
 
        thread_mutex rpc_lock;
 
+       virtual bool show_samples() const
+       {
+               return false;
+       }
+
        NetworkDevice(DeviceInfo& info, Stats &stats, const char *address)
        : Device(info, stats, true), socket(io_service)
        {
@@ -82,8 +87,14 @@ public:
                snd.write();
        }
 
-       void mem_alloc(device_memory& mem, MemoryType type)
+       void mem_alloc(const char *name, device_memory& mem, MemoryType type)
        {
+               if(name) {
+                       VLOG(1) << "Buffer allocate: " << name << ", "
+                                   << string_human_readable_number(mem.memory_size()) << " bytes. ("
+                                   << string_human_readable_size(mem.memory_size()) << ")";
+               }
+
                thread_scoped_lock lock(rpc_lock);
 
                mem.device_pointer = ++mem_counter;
@@ -168,7 +179,9 @@ public:
                       InterpolationType interpolation,
                       ExtensionType extension)
        {
-               VLOG(1) << "Texture allocate: " << name << ", " << mem.memory_size() << " bytes.";
+               VLOG(1) << "Texture allocate: " << name << ", "
+                       << string_human_readable_number(mem.memory_size()) << " bytes. ("
+                       << string_human_readable_size(mem.memory_size()) << ")";
 
                thread_scoped_lock lock(rpc_lock);
 
@@ -474,7 +487,7 @@ protected:
                                mem.data_pointer = 0;
 
                        /* perform the allocation on the actual device */
-                       device->mem_alloc(mem, type);
+                       device->mem_alloc(NULL, mem, type);
 
                        /* store a mapping to/from client_pointer and real device pointer */
                        pointer_mapping_insert(client_pointer, mem.device_pointer);
@@ -574,13 +587,13 @@ protected:
                        network_device_memory mem;
                        string name;
                        InterpolationType interpolation;
-                       ExtensionType extension_typr;
+                       ExtensionType extension_type;
                        device_ptr client_pointer;
 
                        rcv.read(name);
                        rcv.read(mem);
                        rcv.read(interpolation);
-                       rcv.read(extension_typr);
+                       rcv.read(extension_type);
                        lock.unlock();
 
                        client_pointer = mem.device_pointer;
@@ -596,7 +609,7 @@ protected:
 
                        rcv.read_buffer((uint8_t*)mem.data_pointer, data_size);
 
-                       device->tex_alloc(name.c_str(), mem, interpolation, extension_typr);
+                       device->tex_alloc(name.c_str(), mem, interpolation, extension_type);
 
                        pointer_mapping_insert(client_pointer, mem.device_pointer);
                }
@@ -648,6 +661,9 @@ protected:
                        if(task.shader_output)
                                task.shader_output = device_ptr_from_client_pointer(task.shader_output);
 
+                       if(task.shader_output_luma)
+                               task.shader_output_luma = device_ptr_from_client_pointer(task.shader_output_luma);
+
 
                        task.acquire_tile = function_bind(&DeviceServer::task_acquire_tile, this, _1, _2);
                        task.release_tile = function_bind(&DeviceServer::task_release_tile, this, _1);