[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50470] branches/soc-2011-tomato: Merging r50457 through r50469 from trunk into soc-2011-tomato

Sergey Sharybin sergey.vfx at gmail.com
Fri Sep 7 14:53:42 CEST 2012


Revision: 50470
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50470
Author:   nazgul
Date:     2012-09-07 12:53:41 +0000 (Fri, 07 Sep 2012)
Log Message:
-----------
Merging r50457 through r50469 from trunk into soc-2011-tomato

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

Modified Paths:
--------------
    branches/soc-2011-tomato/intern/cycles/kernel/CMakeLists.txt
    branches/soc-2011-tomato/intern/cycles/kernel/kernel_triangle.h
    branches/soc-2011-tomato/intern/cycles/kernel/kernel_types.h
    branches/soc-2011-tomato/intern/cycles/render/attribute.h
    branches/soc-2011-tomato/intern/cycles/render/mesh.cpp
    branches/soc-2011-tomato/intern/cycles/render/scene.h
    branches/soc-2011-tomato/intern/cycles/util/CMakeLists.txt
    branches/soc-2011-tomato/intern/cycles/util/util_types.h
    branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_view3d_toolbar.py
    branches/soc-2011-tomato/source/blender/editors/armature/poseobject.c
    branches/soc-2011-tomato/source/blender/editors/include/ED_mesh.h
    branches/soc-2011-tomato/source/blender/editors/include/ED_screen.h
    branches/soc-2011-tomato/source/blender/editors/mesh/editface.c
    branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_bvh.c
    branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_rip.c
    branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_select.c
    branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_slide.c
    branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_tools.c
    branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_utils.c
    branches/soc-2011-tomato/source/blender/editors/mesh/mesh_intern.h
    branches/soc-2011-tomato/source/blender/editors/mesh/meshtools.c
    branches/soc-2011-tomato/source/blender/editors/object/object_constraint.c
    branches/soc-2011-tomato/source/blender/editors/physics/particle_edit.c
    branches/soc-2011-tomato/source/blender/editors/screen/screen_ops.c
    branches/soc-2011-tomato/source/blender/editors/sculpt_paint/paint_utils.c
    branches/soc-2011-tomato/source/blender/editors/sculpt_paint/paint_vertex.c
    branches/soc-2011-tomato/source/blender/editors/sculpt_paint/sculpt.c
    branches/soc-2011-tomato/source/blender/editors/space_view3d/view3d_draw.c
    branches/soc-2011-tomato/source/blender/editors/space_view3d/view3d_edit.c
    branches/soc-2011-tomato/source/blender/editors/space_view3d/view3d_select.c
    branches/soc-2011-tomato/source/blender/editors/space_view3d/view3d_view.c
    branches/soc-2011-tomato/source/blender/editors/transform/transform.c

Added Paths:
-----------
    branches/soc-2011-tomato/intern/cycles/kernel/kernel_attribute.h
    branches/soc-2011-tomato/intern/cycles/util/util_attribute.cpp
    branches/soc-2011-tomato/intern/cycles/util/util_attribute.h

Property Changed:
----------------
    branches/soc-2011-tomato/
    branches/soc-2011-tomato/source/blender/editors/interface/interface.c
    branches/soc-2011-tomato/source/blender/editors/space_outliner/


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/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/vgroup_modifiers:38694-39989
/trunk/blender:36831-50456
   + /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/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/vgroup_modifiers:38694-39989
/trunk/blender:36831-50469

Modified: branches/soc-2011-tomato/intern/cycles/kernel/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/intern/cycles/kernel/CMakeLists.txt	2012-09-07 11:06:45 UTC (rev 50469)
+++ branches/soc-2011-tomato/intern/cycles/kernel/CMakeLists.txt	2012-09-07 12:53:41 UTC (rev 50470)
@@ -16,6 +16,7 @@
 set(SRC_HEADERS
 	kernel.h
 	kernel_accumulate.h
+	kernel_attribute.h
 	kernel_bvh.h
 	kernel_camera.h
 	kernel_compat_cpu.h

Copied: branches/soc-2011-tomato/intern/cycles/kernel/kernel_attribute.h (from rev 50469, trunk/blender/intern/cycles/kernel/kernel_attribute.h)
===================================================================
--- branches/soc-2011-tomato/intern/cycles/kernel/kernel_attribute.h	                        (rev 0)
+++ branches/soc-2011-tomato/intern/cycles/kernel/kernel_attribute.h	2012-09-07 12:53:41 UTC (rev 50470)
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2011, Blender Foundation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __KERNEL_ATTRIBUTE_CL__
+#define __KERNEL_ATTRIBUTE_CL__
+
+#include "util_types.h"
+
+#ifdef __OSL__
+#include <string>
+#include "util_attribute.h"
+#endif
+
+CCL_NAMESPACE_BEGIN
+
+/* note: declared in kernel.h, have to add it here because kernel.h is not available */
+bool kernel_osl_use(KernelGlobals *kg);
+
+__device_inline int find_attribute(KernelGlobals *kg, ShaderData *sd, uint id)
+{
+
+#ifdef __OSL__
+	if (kernel_osl_use(kg)) {
+		/* for OSL, a hash map is used to lookup the attribute by name. */
+		OSLGlobals::AttributeMap &attr_map = kg->osl.attribute_map[sd->object];
+		ustring stdname(std::string("std::") + std::string(attribute_standard_name((AttributeStandard)id)));
+		OSLGlobals::AttributeMap::const_iterator it = attr_map.find(stdname);
+		if (it != attr_map.end()) {
+			const OSLGlobals::Attribute &osl_attr = it->second;
+			/* return result */
+			return (osl_attr.elem == ATTR_ELEMENT_NONE) ? (int)ATTR_STD_NOT_FOUND : osl_attr.offset;
+		}
+		else
+			return (int)ATTR_STD_NOT_FOUND;
+	}
+	else
+#endif
+	{
+		/* for SVM, find attribute by unique id */
+		uint attr_offset = sd->object*kernel_data.bvh.attributes_map_stride;
+		uint4 attr_map = kernel_tex_fetch(__attributes_map, attr_offset);
+		
+		while(attr_map.x != id)
+			attr_map = kernel_tex_fetch(__attributes_map, ++attr_offset);
+		
+		/* return result */
+		return (attr_map.y == ATTR_ELEMENT_NONE) ? (int)ATTR_STD_NOT_FOUND : attr_map.z;
+	}
+}
+
+CCL_NAMESPACE_END
+
+#endif /* __KERNEL_ATTRIBUTE_CL__ */

Modified: branches/soc-2011-tomato/intern/cycles/kernel/kernel_triangle.h
===================================================================
--- branches/soc-2011-tomato/intern/cycles/kernel/kernel_triangle.h	2012-09-07 11:06:45 UTC (rev 50469)
+++ branches/soc-2011-tomato/intern/cycles/kernel/kernel_triangle.h	2012-09-07 12:53:41 UTC (rev 50470)
@@ -16,6 +16,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
+#include "kernel_attribute.h"
 #include "kernel_projection.h"
 
 CCL_NAMESPACE_BEGIN
@@ -183,48 +184,13 @@
 
 /* motion */
 
-/* note: declared in kernel.h, have to add it here because kernel.h is not available */
-bool kernel_osl_use(KernelGlobals *kg);
-
-__device int triangle_find_attribute(KernelGlobals *kg, ShaderData *sd, uint id)
-{
-
-#ifdef __OSL__
-	if (kernel_osl_use(kg)) {
-		/* for OSL, a hash map is used to lookup the attribute by name. */
-		OSLGlobals::AttributeMap &attr_map = kg->osl.attribute_map[sd->object];
-		ustring stdname = ustring(std::string("std::") + attribute_standard_name((AttributeStandard)id).c_str());
-		OSLGlobals::AttributeMap::const_iterator it = attr_map.find(stdname);
-		if (it != attr_map.end()) {
-			const OSLGlobals::Attribute &osl_attr = it->second;
-			/* return result */
-			return (osl_attr.elem == ATTR_ELEMENT_NONE) ? (int)ATTR_STD_NOT_FOUND : osl_attr.offset;
-		}
-		else
-			return (int)ATTR_STD_NOT_FOUND;
-	}
-	else
-#endif
-	{
-		/* for SVM, find attribute by unique id */
-		uint attr_offset = sd->object*kernel_data.bvh.attributes_map_stride;
-		uint4 attr_map = kernel_tex_fetch(__attributes_map, attr_offset);
-		
-		while(attr_map.x != id)
-			attr_map = kernel_tex_fetch(__attributes_map, ++attr_offset);
-		
-		/* return result */
-		return (attr_map.y == ATTR_ELEMENT_NONE) ? (int)ATTR_STD_NOT_FOUND : attr_map.z;
-	}
-}
-
 __device float4 triangle_motion_vector(KernelGlobals *kg, ShaderData *sd)
 {
 	float3 motion_pre = sd->P, motion_post = sd->P;
 
 	/* deformation motion */
-	int offset_pre = triangle_find_attribute(kg, sd, ATTR_STD_MOTION_PRE);
-	int offset_post = triangle_find_attribute(kg, sd, ATTR_STD_MOTION_POST);
+	int offset_pre = find_attribute(kg, sd, ATTR_STD_MOTION_PRE);
+	int offset_post = find_attribute(kg, sd, ATTR_STD_MOTION_POST);
 
 	if(offset_pre != ATTR_STD_NOT_FOUND)
 		motion_pre = triangle_attribute_float3(kg, sd, ATTR_ELEMENT_VERTEX, offset_pre, NULL, NULL);
@@ -283,7 +249,7 @@
 
 __device float3 triangle_uv(KernelGlobals *kg, ShaderData *sd)
 {
-	int offset_uv = triangle_find_attribute(kg, sd, ATTR_STD_UV);
+	int offset_uv = find_attribute(kg, sd, ATTR_STD_UV);
 
 	if(offset_uv == ATTR_STD_NOT_FOUND)
 		return make_float3(0.0f, 0.0f, 0.0f);

Modified: branches/soc-2011-tomato/intern/cycles/kernel/kernel_types.h
===================================================================
--- branches/soc-2011-tomato/intern/cycles/kernel/kernel_types.h	2012-09-07 11:06:45 UTC (rev 50469)
+++ branches/soc-2011-tomato/intern/cycles/kernel/kernel_types.h	2012-09-07 12:53:41 UTC (rev 50470)
@@ -19,8 +19,6 @@
 #ifndef __KERNEL_TYPES_H__
 #define __KERNEL_TYPES_H__
 
-#include <string>
-
 #include "kernel_math.h"
 #include "svm/svm_types.h"
 
@@ -354,46 +352,6 @@
 	ATTR_ELEMENT_NONE
 } AttributeElement;
 
-typedef enum AttributeStandard {
-	ATTR_STD_NONE = 0,
-	ATTR_STD_VERTEX_NORMAL,
-	ATTR_STD_FACE_NORMAL,
-	ATTR_STD_UV,
-	ATTR_STD_GENERATED,
-	ATTR_STD_POSITION_UNDEFORMED,
-	ATTR_STD_POSITION_UNDISPLACED,
-	ATTR_STD_MOTION_PRE,
-	ATTR_STD_MOTION_POST,
-	ATTR_STD_PARTICLE,
-	ATTR_STD_NUM,
-
-	ATTR_STD_NOT_FOUND = ~0
-} AttributeStandard;
-
-__device std::string attribute_standard_name(AttributeStandard std)
-{
-	if(std == ATTR_STD_VERTEX_NORMAL)
-		return std::string("N");
-	else if(std == ATTR_STD_FACE_NORMAL)
-		return std::string("Ng");
-	else if(std == ATTR_STD_UV)
-		return std::string("uv");
-	else if(std == ATTR_STD_GENERATED)
-		return std::string("generated");
-	else if(std == ATTR_STD_POSITION_UNDEFORMED)
-		return std::string("undeformed");
-	else if(std == ATTR_STD_POSITION_UNDISPLACED)
-		return std::string("undisplaced");
-	else if(std == ATTR_STD_MOTION_PRE)
-		return std::string("motion_pre");
-	else if(std == ATTR_STD_MOTION_POST)
-		return std::string("motion_post");
-	else if(std == ATTR_STD_PARTICLE)
-		return std::string("particle");
-	
-	return std::string();
-}
-
 /* Closure data */
 
 #define MAX_CLOSURE 8

Modified: branches/soc-2011-tomato/intern/cycles/render/attribute.h
===================================================================
--- branches/soc-2011-tomato/intern/cycles/render/attribute.h	2012-09-07 11:06:45 UTC (rev 50469)
+++ branches/soc-2011-tomato/intern/cycles/render/attribute.h	2012-09-07 12:53:41 UTC (rev 50470)
@@ -21,6 +21,7 @@
 
 #include "kernel_types.h"
 
+#include "util_attribute.h"
 #include "util_list.h"
 #include "util_param.h"
 #include "util_types.h"

Modified: branches/soc-2011-tomato/intern/cycles/render/mesh.cpp
===================================================================
--- branches/soc-2011-tomato/intern/cycles/render/mesh.cpp	2012-09-07 11:06:45 UTC (rev 50469)
+++ branches/soc-2011-tomato/intern/cycles/render/mesh.cpp	2012-09-07 12:53:41 UTC (rev 50470)
@@ -366,7 +366,7 @@
 
 			if(req.std != ATTR_STD_NONE) {
 				/* if standard attribute, add lookup by std:: name convention */
-				ustring stdname = ustring(string("std::") + attribute_standard_name(req.std).c_str());
+				ustring stdname(std::string("std::") + std::string(attribute_standard_name(req.std)));
 				og->attribute_map[i][stdname] = osl_attr;
 			}
 			else if(req.name != ustring()) {

Modified: branches/soc-2011-tomato/intern/cycles/render/scene.h
===================================================================
--- branches/soc-2011-tomato/intern/cycles/render/scene.h	2012-09-07 11:06:45 UTC (rev 50469)
+++ branches/soc-2011-tomato/intern/cycles/render/scene.h	2012-09-07 12:53:41 UTC (rev 50470)
@@ -25,6 +25,7 @@
 
 #include "kernel_types.h"
 
+#include "util_attribute.h"
 #include "util_param.h"
 #include "util_string.h"
 #include "util_thread.h"

Modified: branches/soc-2011-tomato/intern/cycles/util/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/intern/cycles/util/CMakeLists.txt	2012-09-07 11:06:45 UTC (rev 50469)

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list