Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-08-08 18:02:08 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-08-08 18:02:26 +0300
commit0e57282999dc39b665a8119ef3045c3b98f006b0 (patch)
tree5968fbea4119a917d89423a9e4a1f2352cf6be5d
parent4fe1bf85afa01a31a703bb47e794c2e9ebc10614 (diff)
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.
-rw-r--r--intern/cycles/device/opencl/opencl_base.cpp25
1 files 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_slot_t> 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);
}