diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-09 10:12:16 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-08-09 10:12:16 +0300 |
commit | fdb1c81117a3595044d65aef5e6ecfafe30471e7 (patch) | |
tree | 1640452b17ec0734aa175016b809d54ab2d20110 /intern | |
parent | 8563494823bd3ad9643e0e05c88eee7763196be8 (diff) | |
parent | f2728939df31dba0e243a1657afa5c1682cccc32 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/device/opencl/opencl.h | 12 | ||||
-rw-r--r-- | intern/cycles/device/opencl/opencl_base.cpp | 24 | ||||
-rw-r--r-- | intern/cycles/kernel/kernels/cpu/filter_sse2.cpp | 1 | ||||
-rw-r--r-- | intern/cycles/kernel/kernels/cpu/filter_sse3.cpp | 1 |
4 files changed, 20 insertions, 18 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_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); } } 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__ |