[Bf-blender-cvs] [0e57282999d] master: Cycles: Fix compilation error without C++11

Sergey Sharybin noreply at git.blender.org
Tue Aug 8 17:02:30 CEST 2017


Commit: 0e57282999dc39b665a8119ef3045c3b98f006b0
Author: Sergey Sharybin
Date:   Tue Aug 8 17:02:08 2017 +0200
Branches: master
https://developer.blender.org/rB0e57282999dc39b665a8119ef3045c3b98f006b0

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.

===================================================================

M	intern/cycles/device/opencl/opencl_base.cpp

===================================================================

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);
 		}




More information about the Bf-blender-cvs mailing list