Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 9 Aug 2017 07:12:16 +0000 (09:12 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 9 Aug 2017 07:12:16 +0000 (09:12 +0200)
intern/cycles/device/opencl/opencl.h
intern/cycles/device/opencl/opencl_base.cpp
intern/cycles/kernel/kernels/cpu/filter_sse2.cpp
intern/cycles/kernel/kernels/cpu/filter_sse3.cpp
source/blender/nodes/composite/nodes/node_composite_image.c

index 0dae91368701d92b30734fc4d90803d0faa2ce15..71483ca915946b3023819c46cc352f7a6325280d 100644 (file)
@@ -232,8 +232,8 @@ public:
                \
                if(err != CL_SUCCESS) { \
                        string message = string_printf("OpenCL error: %s in %s (%s:%d)", clewErrorString(err), #stmt, __FILE__, __LINE__); \
-                       if((device)->error_msg == "") \
-                               (device)->error_msg = message; \
+                       if((device)->error_message() == "") \
+                               (device)->set_error(message); \
                        fprintf(stderr, "%s\n", message.c_str()); \
                } \
        } (void)0
@@ -556,6 +556,14 @@ private:
        device_memory texture_descriptors_buffer;
 
        struct Texture {
+               Texture() {}
+               Texture(device_memory* mem,
+                        InterpolationType interpolation,
+                        ExtensionType extension)
+                   : mem(mem),
+                         interpolation(interpolation),
+                         extension(extension) {
+               }
                device_memory* mem;
                InterpolationType interpolation;
                ExtensionType extension;
index d3f0172a7b650fb798244dbeb3ed2798dcbe4311..aa22086be29ab2f8ebde22d06efb04f95e0cb13b 100644 (file)
 CCL_NAMESPACE_BEGIN
 
 struct texture_slot_t {
+       texture_slot_t(const string& name, int slot)
+               : name(name),
+                 slot(slot) {
+       }
        string name;
        int slot;
 };
@@ -515,11 +519,7 @@ void OpenCLDeviceBase::tex_alloc(const char *name,
                << string_human_readable_size(mem.memory_size()) << ")";
 
        memory_manager.alloc(name, mem);
-
-       textures[name] = (Texture){.mem = &mem,
-                                  .interpolation = interpolation,
-                                  .extension = extension};
-
+       textures[name] = Texture(&mem, interpolation, extension);
        textures_need_update = true;
 }
 
@@ -618,10 +618,9 @@ void OpenCLDeviceBase::flush_texture_buffers()
 
        vector<texture_slot_t> texture_slots;
 
-#define KERNEL_TEX(type, ttype, slot_name) \
-       if(textures.find(#slot_name) != textures.end()) { \
-               texture_slots.push_back((texture_slot_t){.name = #slot_name, \
-                                                        .slot = num_slots}); \
+#define KERNEL_TEX(type, ttype, name) \
+       if(textures.find(#name) != textures.end()) { \
+               texture_slots.push_back(texture_slot_t(#name, num_slots)); \
        } \
        num_slots++;
 #include "kernel/kernel_textures.h"
@@ -634,11 +633,8 @@ void OpenCLDeviceBase::flush_texture_buffers()
                if(string_startswith(name, "__tex_image")) {
                        int pos = name.rfind("_");
                        int id = atoi(name.data() + pos + 1);
-
-                       texture_slots.push_back((texture_slot_t){
-                                   .name = name,
-                                   .slot = num_data_slots + id});
-
+                       texture_slots.push_back(texture_slot_t(name,
+                                                                  num_data_slots + id));
                        num_slots = max(num_slots, num_data_slots + id + 1);
                }
        }
index a13fb5cd4fb18d6d889fb953859b72817df6e8d5..f7c9935f1d078c518ee7d0c92c452509b7f2bd6f 100644 (file)
@@ -25,7 +25,6 @@
 #else
 /* SSE optimization disabled for now on 32 bit, see bug #36316 */
 #  if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86)))
-#    define __KERNEL_SSE__
 #    define __KERNEL_SSE2__
 #  endif
 #endif  /* WITH_CYCLES_OPTIMIZED_KERNEL_SSE2 */
index 6b690adf0f50a6c2f2f40cba81cfb9d6fc012687..070b95a35053942cffc04a2ca4b3e77386ac549b 100644 (file)
@@ -25,7 +25,6 @@
 #else
 /* SSE optimization disabled for now on 32 bit, see bug #36316 */
 #  if !(defined(__GNUC__) && (defined(i386) || defined(_M_IX86)))
-#    define __KERNEL_SSE__
 #    define __KERNEL_SSE2__
 #    define __KERNEL_SSE3__
 #    define __KERNEL_SSSE3__
index 8139e29bade2c0a64d2c6fa86dd62361f7fd4b04..a95c3233132bcf1524f1aaee551ea8b5dafb6ed2 100644 (file)
@@ -178,6 +178,9 @@ static void cmp_node_image_create_outputs(bNodeTree *ntree, bNode *node, LinkNod
        cmp_node_image_add_pass_output(ntree, node, "Alpha", RE_PASSNAME_COMBINED, -1, SOCK_FLOAT, false, available_sockets, &prev_index);
 
        if (ima) {
+               if (!ima->rr) {
+                       cmp_node_image_add_pass_output(ntree, node, RE_PASSNAME_Z, RE_PASSNAME_Z, -1, SOCK_FLOAT, false, available_sockets, &prev_index);
+               }
                BKE_image_release_ibuf(ima, ibuf, NULL);
        }
 }