From 0e57282999dc39b665a8119ef3045c3b98f006b0 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 8 Aug 2017 17:02:08 +0200 Subject: Cycles: Fix compilation error without C++11 Common folks, nobody considered master a C++11 only branch. Such decision is to be done officially and will involve changes in quite a few infrastructure related areas. --- intern/cycles/device/opencl/opencl_base.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/intern/cycles/device/opencl/opencl_base.cpp b/intern/cycles/device/opencl/opencl_base.cpp index 63b5e004b7d..d3f0172a7b6 100644 --- a/intern/cycles/device/opencl/opencl_base.cpp +++ b/intern/cycles/device/opencl/opencl_base.cpp @@ -29,6 +29,11 @@ CCL_NAMESPACE_BEGIN +struct texture_slot_t { + string name; + int slot; +}; + bool OpenCLDeviceBase::opencl_error(cl_int err) { if(err != CL_SUCCESS) { @@ -511,7 +516,9 @@ void OpenCLDeviceBase::tex_alloc(const char *name, memory_manager.alloc(name, mem); - textures[name] = {&mem, interpolation, extension}; + textures[name] = (Texture){.mem = &mem, + .interpolation = interpolation, + .extension = extension}; textures_need_update = true; } @@ -609,16 +616,12 @@ void OpenCLDeviceBase::flush_texture_buffers() /* Setup slots for textures. */ int num_slots = 0; - struct texture_slot_t { - string name; - int slot; - }; - vector texture_slots; -#define KERNEL_TEX(type, ttype, name) \ - if(textures.find(#name) != textures.end()) { \ - texture_slots.push_back({#name, num_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}); \ } \ num_slots++; #include "kernel/kernel_textures.h" @@ -632,7 +635,9 @@ void OpenCLDeviceBase::flush_texture_buffers() int pos = name.rfind("_"); int id = atoi(name.data() + pos + 1); - texture_slots.push_back({name, num_data_slots + id}); + texture_slots.push_back((texture_slot_t){ + .name = name, + .slot = num_data_slots + id}); num_slots = max(num_slots, num_data_slots + id + 1); } -- cgit v1.2.3