[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43753] branches/bmesh/blender: svn merge ^/trunk/blender -r43733:43751

Campbell Barton ideasman42 at gmail.com
Sun Jan 29 22:49:58 CET 2012


Revision: 43753
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43753
Author:   campbellbarton
Date:     2012-01-29 21:49:49 +0000 (Sun, 29 Jan 2012)
Log Message:
-----------
svn merge ^/trunk/blender -r43733:43751

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43733

Modified Paths:
--------------
    branches/bmesh/blender/intern/boolop/intern/BOP_CarveInterface.cpp
    branches/bmesh/blender/intern/cycles/blender/blender_session.cpp
    branches/bmesh/blender/intern/cycles/device/device.cpp
    branches/bmesh/blender/intern/cycles/device/device.h
    branches/bmesh/blender/intern/cycles/device/device_cpu.cpp
    branches/bmesh/blender/intern/cycles/device/device_cuda.cpp
    branches/bmesh/blender/intern/cycles/device/device_multi.cpp
    branches/bmesh/blender/intern/cycles/device/device_network.cpp
    branches/bmesh/blender/intern/cycles/device/device_opencl.cpp
    branches/bmesh/blender/intern/cycles/kernel/kernel_emission.h
    branches/bmesh/blender/intern/cycles/kernel/kernel_light.h
    branches/bmesh/blender/intern/cycles/kernel/kernel_passes.h
    branches/bmesh/blender/intern/cycles/kernel/kernel_shader.h
    branches/bmesh/blender/intern/cycles/kernel/kernel_types.h
    branches/bmesh/blender/intern/cycles/render/buffers.cpp
    branches/bmesh/blender/intern/cycles/render/film.cpp
    branches/bmesh/blender/intern/cycles/render/light.cpp
    branches/bmesh/blender/intern/cycles/render/svm.cpp
    branches/bmesh/blender/intern/cycles/util/util_types.h
    branches/bmesh/blender/release/scripts/startup/bl_ui/properties_object_constraint.py
    branches/bmesh/blender/source/blender/blenkernel/BKE_blender.h
    branches/bmesh/blender/source/blender/blenkernel/BKE_customdata.h
    branches/bmesh/blender/source/blender/blenkernel/intern/displist.c
    branches/bmesh/blender/source/blender/blenkernel/intern/dynamicpaint.c
    branches/bmesh/blender/source/blender/makesrna/intern/rna_constraint.c
    branches/bmesh/blender/source/blender/makesrna/intern/rna_scene.c
    branches/bmesh/blender/source/blender/makesrna/intern/rna_space.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_boolean_util.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_cloth.c
    branches/bmesh/blender/source/blender/windowmanager/intern/wm_operators.c

Property Changed:
----------------
    branches/bmesh/blender/
    branches/bmesh/blender/release/


Property changes on: branches/bmesh/blender
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801
/trunk/blender:39992-43733
   + /branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/soc-2011-tomato:42376,42378-42379,42383,42385,42395,42397-42400,42407,42411,42418,42443-42444,42446,42467,42472,42486,42650-42652,42654-42655,42709-42710,42733-42734,42801
/trunk/blender:39992-43751

Modified: branches/bmesh/blender/intern/boolop/intern/BOP_CarveInterface.cpp
===================================================================
--- branches/bmesh/blender/intern/boolop/intern/BOP_CarveInterface.cpp	2012-01-29 21:28:04 UTC (rev 43752)
+++ branches/bmesh/blender/intern/boolop/intern/BOP_CarveInterface.cpp	2012-01-29 21:49:49 UTC (rev 43753)
@@ -150,12 +150,19 @@
 		MeshSet<3> *right = Carve_getIntersectedOperand(orig_meshes, precomputedAABB, otherAABB);
 
 		try {
-			MeshSet<3> *result = csg.compute(left, right, carve::csg::CSG::UNION, NULL, carve::csg::CSG::CLASSIFY_EDGE);
+			if(left->meshes.size()==0) {
+				delete left;
 
-			delete left;
-			delete right;
+				left = right;
+			}
+			else {
+				MeshSet<3> *result = csg.compute(left, right, carve::csg::CSG::UNION, NULL, carve::csg::CSG::CLASSIFY_EDGE);
 
-			left = result;
+				delete left;
+				delete right;
+
+				left = result;
+			}
 		}
 		catch(carve::exception e) {
 			std::cerr << "CSG failed, exception " << e.str() << std::endl;
@@ -492,7 +499,7 @@
                                         CSG_VertexIteratorDescriptor  obBVertices)
 {
 	carve::csg::CSG::OP op;
-	MeshSet<3> *left, *right, *output;
+	MeshSet<3> *left, *right, *output = NULL;
 	carve::csg::CSG csg;
 	carve::geom3d::Vector min, max;
 	carve::interpolate::FaceAttr<uint> oface_num;
@@ -517,6 +524,17 @@
 
 	Carve_prepareOperands(&left, &right, oface_num);
 
+	if(left->meshes.size() == 0 || right->meshes.size()==0) {
+		// normally sohuldn't happen (zero-faces objects are handled by modifier itself), but
+		// unioning intersecting meshes which doesn't have consistent normals might lead to
+		// empty result which wouldn't work here
+
+		delete left;
+		delete right;
+
+		return BOP_ERROR;
+	}
+
 	min.x = max.x = left->vertex_storage[0].v.x;
 	min.y = max.y = left->vertex_storage[0].v.y;
 	min.z = max.z = left->vertex_storage[0].v.z;

Modified: branches/bmesh/blender/intern/cycles/blender/blender_session.cpp
===================================================================
--- branches/bmesh/blender/intern/cycles/blender/blender_session.cpp	2012-01-29 21:28:04 UTC (rev 43752)
+++ branches/bmesh/blender/intern/cycles/blender/blender_session.cpp	2012-01-29 21:49:49 UTC (rev 43753)
@@ -206,7 +206,7 @@
 		vector<Pass> passes;
 		Pass::add(PASS_COMBINED, passes);
 
-		if(session_params.device.type == DEVICE_CPU) { /* todo */
+		if(session_params.device.advanced_shading) {
 			BL::RenderLayer::passes_iterator b_pass_iter;
 			
 			for(b_rlay.passes.begin(b_pass_iter); b_pass_iter != b_rlay.passes.end(); ++b_pass_iter) {

Modified: branches/bmesh/blender/intern/cycles/device/device.cpp
===================================================================
--- branches/bmesh/blender/intern/cycles/device/device.cpp	2012-01-29 21:28:04 UTC (rev 43752)
+++ branches/bmesh/blender/intern/cycles/device/device.cpp	2012-01-29 21:49:49 UTC (rev 43753)
@@ -183,6 +183,9 @@
 			return NULL;
 	}
 
+	if(device)
+		device->info = info;
+
 	return device;
 }
 

Modified: branches/bmesh/blender/intern/cycles/device/device.h
===================================================================
--- branches/bmesh/blender/intern/cycles/device/device.h	2012-01-29 21:28:04 UTC (rev 43752)
+++ branches/bmesh/blender/intern/cycles/device/device.h	2012-01-29 21:49:49 UTC (rev 43753)
@@ -51,6 +51,7 @@
 	string id;
 	int num;
 	bool display_device;
+	bool advanced_shading;
 	vector<DeviceInfo> multi_devices;
 
 	DeviceInfo()
@@ -59,6 +60,7 @@
 		id = "CPU";
 		num = 0;
 		display_device = false;
+		advanced_shading = true;
 	}
 };
 
@@ -101,10 +103,8 @@
 public:
 	virtual ~Device() {}
 
-	virtual bool support_full_kernel() = 0;
-
 	/* info */
-	virtual string description() = 0;
+	DeviceInfo info;
 	virtual const string& error_message() { return error_msg; }
 
 	/* regular memory */

Modified: branches/bmesh/blender/intern/cycles/device/device_cpu.cpp
===================================================================
--- branches/bmesh/blender/intern/cycles/device/device_cpu.cpp	2012-01-29 21:28:04 UTC (rev 43752)
+++ branches/bmesh/blender/intern/cycles/device/device_cpu.cpp	2012-01-29 21:49:49 UTC (rev 43753)
@@ -72,16 +72,11 @@
 		kernel_globals_free(kg);
 	}
 
-	bool support_full_kernel()
+	bool support_advanced_shading()
 	{
 		return true;
 	}
 
-	string description()
-	{
-		return system_cpu_brand_string();
-	}
-
 	void mem_alloc(device_memory& mem, MemoryType type)
 	{
 		mem.device_pointer = mem.data_pointer;
@@ -271,6 +266,7 @@
 	info.description = system_cpu_brand_string();
 	info.id = "CPU";
 	info.num = 0;
+	info.advanced_shading = true;
 
 	devices.insert(devices.begin(), info);
 }

Modified: branches/bmesh/blender/intern/cycles/device/device_cuda.cpp
===================================================================
--- branches/bmesh/blender/intern/cycles/device/device_cuda.cpp	2012-01-29 21:28:04 UTC (rev 43752)
+++ branches/bmesh/blender/intern/cycles/device/device_cuda.cpp	2012-01-29 21:49:49 UTC (rev 43753)
@@ -106,11 +106,6 @@
 		}
 	}
 
-	static int cuda_align_up(int& offset, int alignment)
-	{
-		return (offset + alignment - 1) & ~(alignment - 1);
-	}
-
 #ifdef NDEBUG
 #define cuda_abort()
 #else
@@ -194,26 +189,6 @@
 		cuda_assert(cuCtxDetach(cuContext))
 	}
 
-	bool support_full_kernel()
-	{
-		int major, minor;
-		cuDeviceComputeCapability(&major, &minor, cuDevId);
-
-		return (major >= 2);
-	}
-
-	string description()
-	{
-		/* print device information */
-		char deviceName[256];
-
-		cuda_push_context();
-		cuDeviceGetName(deviceName, 256, cuDevId);
-		cuda_pop_context();
-
-		return string("CUDA ") + deviceName;
-	}
-
 	bool support_device(bool experimental)
 	{
 		if(!experimental) {
@@ -505,7 +480,7 @@
 		offset += sizeof(d_rng_state);
 
 		int sample = task.sample;
-		offset = cuda_align_up(offset, __alignof(sample));
+		offset = align_up(offset, __alignof(sample));
 
 		cuda_assert(cuParamSeti(cuPathTrace, offset, task.sample))
 		offset += sizeof(task.sample);
@@ -569,7 +544,7 @@
 		offset += sizeof(d_buffer);
 
 		int sample = task.sample;
-		offset = cuda_align_up(offset, __alignof(sample));
+		offset = align_up(offset, __alignof(sample));
 
 		cuda_assert(cuParamSeti(cuFilmConvert, offset, task.sample))
 		offset += sizeof(task.sample);
@@ -638,7 +613,7 @@
 		offset += sizeof(d_offset);
 
 		int shader_eval_type = task.shader_eval_type;
-		offset = cuda_align_up(offset, __alignof(shader_eval_type));
+		offset = align_up(offset, __alignof(shader_eval_type));
 
 		cuda_assert(cuParamSeti(cuDisplace, offset, task.shader_eval_type))
 		offset += sizeof(task.shader_eval_type);
@@ -881,6 +856,10 @@
 		info.id = string_printf("CUDA_%d", num);
 		info.num = num;
 
+		int major, minor;
+		cuDeviceComputeCapability(&major, &minor, num);
+		info.advanced_shading = (major >= 2);
+
 		/* if device has a kernel timeout, assume it is used for display */
 		if(cuDeviceGetAttribute(&attr, CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, num) == CUDA_SUCCESS && attr == 1) {
 			info.display_device = true;

Modified: branches/bmesh/blender/intern/cycles/device/device_multi.cpp
===================================================================
--- branches/bmesh/blender/intern/cycles/device/device_multi.cpp	2012-01-29 21:28:04 UTC (rev 43752)
+++ branches/bmesh/blender/intern/cycles/device/device_multi.cpp	2012-01-29 21:49:49 UTC (rev 43753)
@@ -76,16 +76,6 @@
 			delete sub.device;
 	}
 
-	bool support_full_kernel()
-	{
-		foreach(SubDevice& sub, devices) {
-			if(!sub.device->support_full_kernel())
-				return false;
-		}
-
-		return true;
-	}
-
 	const string& error_message()
 	{
 		foreach(SubDevice& sub, devices) {
@@ -99,38 +89,6 @@
 		return error_msg;
 	}
 
-	string description()
-	{
-		/* create map to find duplicate descriptions */
-		map<string, int> dupli_map;
-		map<string, int>::iterator dt;
-
-		foreach(SubDevice& sub, devices) {
-			string key = sub.device->description();
-
-			if(dupli_map.find(key) == dupli_map.end())
-				dupli_map[key] = 1;
-			else
-				dupli_map[key]++;
-		}
-
-		/* generate string */
-		stringstream desc;
-		bool first = true;
-
-		for(dt = dupli_map.begin(); dt != dupli_map.end(); dt++) {
-			if(!first) desc << ", ";
-			first = false;
-
-			if(dt->second > 1)
-				desc << dt->second << "x " << dt->first;
-			else
-				desc << dt->first;
-		}
-
-		return desc.str();
-	}
-
 	bool load_kernels(bool experimental)
 	{
 		foreach(SubDevice& sub, devices)
@@ -344,6 +302,8 @@
 	map<string, int>::iterator dt;
 	int num_added = 0, num_display = 0;
 
+	info.advanced_shading = true;
+
 	foreach(DeviceInfo& subinfo, devices) {
 		if(subinfo.type == type) {
 			if(subinfo.display_device) {
@@ -363,6 +323,8 @@
 			info.multi_devices.push_back(subinfo);
 			if(subinfo.display_device)
 				info.display_device = true;
+			if(!subinfo.advanced_shading)
+				info.advanced_shading = false;
 			num_added++;
 		}
 	}

Modified: branches/bmesh/blender/intern/cycles/device/device_network.cpp
===================================================================
--- branches/bmesh/blender/intern/cycles/device/device_network.cpp	2012-01-29 21:28:04 UTC (rev 43752)
+++ branches/bmesh/blender/intern/cycles/device/device_network.cpp	2012-01-29 21:49:49 UTC (rev 43753)
@@ -57,24 +57,6 @@
 	{
 	}
 
-	bool support_full_kernel()
-	{
-		return false;
-	}
-
-	string description()
-	{
-		RPCSend snd(socket, "description");
-		snd.write();
-
-		RPCReceive rcv(socket);
-		string desc_string;
-
-		*rcv.archive & desc_string;
-
-		return desc_string + " (remote)";
-	}
-
 	void mem_alloc(device_memory& mem, MemoryType type)
 	{
 #if 0

Modified: branches/bmesh/blender/intern/cycles/device/device_opencl.cpp

@@ Diff output truncated at 10240 characters. @@


More information about the Bf-blender-cvs mailing list