From c961737d0f20fec7a1c241372d367b87fe6e4a1e Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 8 Aug 2017 21:56:32 +0200 Subject: Cycles: Fix compilation error of filter kernels on 32 bit Windows We don't enable global SSE optimizations in regular kernel, and we keep those disabled on Linux 32bit. One possible workaround would be to pass arguments by ccl_ref, but that is quite a few of code which better be done accurately. --- intern/cycles/kernel/kernels/cpu/filter_sse2.cpp | 1 - intern/cycles/kernel/kernels/cpu/filter_sse3.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/intern/cycles/kernel/kernels/cpu/filter_sse2.cpp b/intern/cycles/kernel/kernels/cpu/filter_sse2.cpp index a13fb5cd4fb..f7c9935f1d0 100644 --- a/intern/cycles/kernel/kernels/cpu/filter_sse2.cpp +++ b/intern/cycles/kernel/kernels/cpu/filter_sse2.cpp @@ -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 */ diff --git a/intern/cycles/kernel/kernels/cpu/filter_sse3.cpp b/intern/cycles/kernel/kernels/cpu/filter_sse3.cpp index 6b690adf0f5..070b95a3505 100644 --- a/intern/cycles/kernel/kernels/cpu/filter_sse3.cpp +++ b/intern/cycles/kernel/kernels/cpu/filter_sse3.cpp @@ -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__ -- cgit v1.2.3 From 99c13519a10fb7e2fccfbb17ccc72f772e137343 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 8 Aug 2017 22:32:51 +0200 Subject: Cycles: More fixes for Windows 32 bit - Apparently MSVC does not support compound literals in C++ (at least by the looks of it). - Not sure how opencl_device_assert was managing to set protected property of the Device class. --- intern/cycles/device/opencl/opencl.h | 12 ++++++++++-- intern/cycles/device/opencl/opencl_base.cpp | 24 ++++++++++-------------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/intern/cycles/device/opencl/opencl.h b/intern/cycles/device/opencl/opencl.h index 0dae9136870..71483ca9159 100644 --- a/intern/cycles/device/opencl/opencl.h +++ b/intern/cycles/device/opencl/opencl.h @@ -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; diff --git a/intern/cycles/device/opencl/opencl_base.cpp b/intern/cycles/device/opencl/opencl_base.cpp index d3f0172a7b6..aa22086be29 100644 --- a/intern/cycles/device/opencl/opencl_base.cpp +++ b/intern/cycles/device/opencl/opencl_base.cpp @@ -30,6 +30,10 @@ 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_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); } } -- cgit v1.2.3 From f2728939df31dba0e243a1657afa5c1682cccc32 Mon Sep 17 00:00:00 2001 From: Lukas Stockner Date: Tue, 8 Aug 2017 23:00:02 +0200 Subject: Fix T52280: The Image node in Compositing can't read Z buffer of openEXR in 2.79 As part of the fix for T51587, I removed the Depth output for non-Multilayer images since it seemed weird that PNGs etc. that don't have a Z pass still get a socket for it. However, I forgot about non-multilayer EXRs, which are a special case that can actually have a Z pass. Therefore, this commit brings back the Depth output for non-multilayer images just like it was in 2.78. --- source/blender/nodes/composite/nodes/node_composite_image.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/nodes/composite/nodes/node_composite_image.c b/source/blender/nodes/composite/nodes/node_composite_image.c index 8139e29bade..a95c3233132 100644 --- a/source/blender/nodes/composite/nodes/node_composite_image.c +++ b/source/blender/nodes/composite/nodes/node_composite_image.c @@ -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); } } -- cgit v1.2.3