[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48141] branches/soc-2011-tomato: svn merge ^/trunk/blender -r48133:48140

Campbell Barton ideasman42 at gmail.com
Wed Jun 20 23:11:57 CEST 2012


Revision: 48141
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48141
Author:   campbellbarton
Date:     2012-06-20 21:11:57 +0000 (Wed, 20 Jun 2012)
Log Message:
-----------
svn merge ^/trunk/blender -r48133:48140

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

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/blenkernel/intern/armature.c
    branches/soc-2011-tomato/source/blender/compositor/intern/COM_Device.h
    branches/soc-2011-tomato/source/blender/compositor/intern/COM_Node.h
    branches/soc-2011-tomato/source/blender/compositor/intern/COM_NodeOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/intern/COM_NodeOperation.h
    branches/soc-2011-tomato/source/blender/compositor/intern/COM_OpenCLDevice.cpp
    branches/soc-2011-tomato/source/blender/compositor/intern/COM_OpenCLDevice.h
    branches/soc-2011-tomato/source/blender/compositor/intern/COM_WorkPackage.h
    branches/soc-2011-tomato/source/blender/compositor/intern/COM_WorkScheduler.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_BokehBlurOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_BokehBlurOperation.h
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_CalculateMeanOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_DilateErodeOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_DilateErodeOperation.h
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_WriteBufferOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_WriteBufferOperation.h
    branches/soc-2011-tomato/source/blender/editors/interface/view2d.c
    branches/soc-2011-tomato/source/blender/editors/mask/mask_draw.c
    branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_ops.c
    branches/soc-2011-tomato/source/blender/editors/space_view3d/view3d_draw.c

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-48133
   + /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-48140

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/armature.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/armature.c	2012-06-20 21:10:34 UTC (rev 48140)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/armature.c	2012-06-20 21:11:57 UTC (rev 48141)
@@ -1588,7 +1588,11 @@
 	for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
 		pchanp = BKE_pose_channel_find_name(frompose, pchan->name);
 
-		if (pchan->bone->layer & layer_protected) {
+		if (UNLIKELY(pchanp == NULL)) {
+			/* happens for proxies that become invalid because of a missing link
+			 * for regulat cases it shouldn't happen at all */
+		}
+		else if (pchan->bone->layer & layer_protected) {
 			ListBase proxylocal_constraints = {NULL, NULL};
 
 			/* copy posechannel to temp, but restore important pointers */

Modified: branches/soc-2011-tomato/source/blender/compositor/intern/COM_Device.h
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/intern/COM_Device.h	2012-06-20 21:10:34 UTC (rev 48140)
+++ branches/soc-2011-tomato/source/blender/compositor/intern/COM_Device.h	2012-06-20 21:11:57 UTC (rev 48141)
@@ -23,11 +23,7 @@
 #ifndef _COM_Device_h
 #define _COM_Device_h
 
-#include "COM_ExecutionSystem.h"
 #include "COM_WorkPackage.h"
-#include "COM_NodeOperation.h"
-#include "BLI_rect.h"
-#include "COM_MemoryBuffer.h"
 
 /**
  * @brief Abstract class for device implementations to be used by the Compositor.

Modified: branches/soc-2011-tomato/source/blender/compositor/intern/COM_Node.h
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/intern/COM_Node.h	2012-06-20 21:10:34 UTC (rev 48140)
+++ branches/soc-2011-tomato/source/blender/compositor/intern/COM_Node.h	2012-06-20 21:11:57 UTC (rev 48141)
@@ -29,6 +29,7 @@
 #include "COM_CompositorContext.h"
 #include "DNA_node_types.h"
 #include "BKE_text.h"
+#include "COM_ExecutionSystem.h"
 #include <vector>
 #include <string>
 

Modified: branches/soc-2011-tomato/source/blender/compositor/intern/COM_NodeOperation.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/intern/COM_NodeOperation.cpp	2012-06-20 21:10:34 UTC (rev 48140)
+++ branches/soc-2011-tomato/source/blender/compositor/intern/COM_NodeOperation.cpp	2012-06-20 21:11:57 UTC (rev 48141)
@@ -140,118 +140,3 @@
 		return false;
 	}
 }
-
-cl_mem NodeOperation::COM_clAttachMemoryBufferToKernelParameter(cl_context context, cl_kernel kernel, int parameterIndex, int offsetIndex, list<cl_mem> *cleanup, MemoryBuffer **inputMemoryBuffers, SocketReader *reader)
-{
-	cl_int error;
-	MemoryBuffer *result = (MemoryBuffer *)reader->initializeTileData(NULL, inputMemoryBuffers);
-
-	const cl_image_format imageFormat = {
-		CL_RGBA,
-		CL_FLOAT
-	};
-
-	cl_mem clBuffer = clCreateImage2D(context, CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR, &imageFormat, result->getWidth(),
-	                                  result->getHeight(), 0, result->getBuffer(), &error);
-	
-	if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error));  }
-	if (error == CL_SUCCESS) cleanup->push_back(clBuffer);
-
-	error = clSetKernelArg(kernel, parameterIndex, sizeof(cl_mem), &clBuffer);
-	if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error));  }
-	
-	COM_clAttachMemoryBufferOffsetToKernelParameter(kernel, offsetIndex, result);
-	return clBuffer;
-}
-	
-void NodeOperation::COM_clAttachMemoryBufferOffsetToKernelParameter(cl_kernel kernel, int offsetIndex, MemoryBuffer *memoryBuffer) 
-{
-	if (offsetIndex != -1) {
-		cl_int error;
-		rcti *rect = memoryBuffer->getRect();
-		cl_int2 offset = {rect->xmin, rect->ymin};
-
-		error = clSetKernelArg(kernel, offsetIndex, sizeof(cl_int2), &offset);
-		if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error));  }
-	}
-}
-
-void NodeOperation::COM_clAttachSizeToKernelParameter(cl_kernel kernel, int offsetIndex) 
-{
-	if (offsetIndex != -1) {
-		cl_int error;
-		cl_int2 offset = {this->getWidth(), this->getHeight()};
-
-		error = clSetKernelArg(kernel, offsetIndex, sizeof(cl_int2), &offset);
-		if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error));  }
-	}
-}
-
-void NodeOperation::COM_clAttachOutputMemoryBufferToKernelParameter(cl_kernel kernel, int parameterIndex, cl_mem clOutputMemoryBuffer) 
-{
-	cl_int error;
-	error = clSetKernelArg(kernel, parameterIndex, sizeof(cl_mem), &clOutputMemoryBuffer);
-	if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); }
-}
-
-void NodeOperation::COM_clEnqueueRange(cl_command_queue queue, cl_kernel kernel, MemoryBuffer *outputMemoryBuffer)
-{
-	cl_int error;
-	const size_t size[] = {outputMemoryBuffer->getWidth(), outputMemoryBuffer->getHeight()};
-	
-	error = clEnqueueNDRangeKernel(queue, kernel, 2, NULL, size, 0, 0, 0, NULL);
-	if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error));  }
-}
-
-void NodeOperation::COM_clEnqueueRange(cl_command_queue queue, cl_kernel kernel, MemoryBuffer *outputMemoryBuffer, int offsetIndex)
-{
-	cl_int error;
-	const int width = outputMemoryBuffer->getWidth();
-	const int height = outputMemoryBuffer->getHeight();
-	int offsetx;
-	int offsety;
-	const int localSize = 32;
-	size_t size[2];
-	cl_int2 offset;
-	
-	bool breaked = false;
-	for (offsety = 0; offsety < height && (!breaked); offsety += localSize) {
-		offset[1] = offsety;
-		if (offsety + localSize < height) {
-			size[1] = localSize;
-		}
-		else {
-			size[1] = height - offsety;
-		}
-		for (offsetx = 0; offsetx < width && (!breaked); offsetx += localSize) {
-			if (offsetx + localSize < width) {
-				size[0] = localSize;
-			}
-			else {
-				size[0] = width - offsetx;
-			}
-			offset[0] = offsetx;
-
-			error = clSetKernelArg(kernel, offsetIndex, sizeof(cl_int2), &offset);
-			if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); }
-			error = clEnqueueNDRangeKernel(queue, kernel, 2, NULL, size, 0, 0, 0, NULL);
-			if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error));  }
-			clFlush(queue);
-			if (isBreaked()) {
-				breaked = false;
-			}
-		}
-	}
-}
-
-cl_kernel NodeOperation::COM_clCreateKernel(cl_program program, const char *kernelname, list<cl_kernel> *clKernelsToCleanUp) 
-{
-	cl_int error;
-	cl_kernel kernel = clCreateKernel(program, kernelname, &error);
-	if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); }
-	else {
-		if (clKernelsToCleanUp) clKernelsToCleanUp->push_back(kernel);
-	}
-	return kernel;
-	
-}

Modified: branches/soc-2011-tomato/source/blender/compositor/intern/COM_NodeOperation.h
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/intern/COM_NodeOperation.h	2012-06-20 21:10:34 UTC (rev 48140)
+++ branches/soc-2011-tomato/source/blender/compositor/intern/COM_NodeOperation.h	2012-06-20 21:11:57 UTC (rev 48141)
@@ -22,9 +22,7 @@
 
 #ifndef _COM_NodeOperation_h
 #define _COM_NodeOperation_h
-
-class NodeOperation;
-
+class OpenCLDevice;
 #include "COM_Node.h"
 #include <string>
 #include <sstream>
@@ -150,7 +148,7 @@
 	 * @param memoryBuffers all input MemoryBuffer's needed
 	 * @param outputBuffer the outputbuffer to write to
 	 */
-	virtual void executeOpenCLRegion(cl_context context, cl_program program, cl_command_queue queue, rcti *rect, 
+	virtual void executeOpenCLRegion(OpenCLDevice* device, rcti *rect,
 	                                 unsigned int chunkNumber, MemoryBuffer **memoryBuffers, MemoryBuffer *outputBuffer) {}
 
 	/**
@@ -165,7 +163,7 @@
 	 * @param clMemToCleanUp all created cl_mem references must be added to this list. Framework will clean this after execution
 	 * @param clKernelsToCleanUp all created cl_kernel references must be added to this list. Framework will clean this after execution
 	 */
-	virtual void executeOpenCL(cl_context context, cl_program program, cl_command_queue queue, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, list<cl_kernel> *clKernelsToCleanUp) {}
+	virtual void executeOpenCL(OpenCLDevice* device, MemoryBuffer *outputMemoryBuffer, cl_mem clOutputBuffer, MemoryBuffer **inputMemoryBuffers, list<cl_mem> *clMemToCleanUp, list<cl_kernel> *clKernelsToCleanUp) {}
 	virtual void deinitExecution();
 
 	bool isResolutionSet() {
@@ -272,15 +270,6 @@
 	 * @brief set if this NodeOperation can be scheduled on a OpenCLDevice
 	 */
 	void setOpenCL(bool openCL) { this->openCL = openCL; }
-
-	static cl_mem COM_clAttachMemoryBufferToKernelParameter(cl_context context, cl_kernel kernel, int parameterIndex, int offsetIndex, list<cl_mem> *cleanup, MemoryBuffer **inputMemoryBuffers, SocketReader *reader);
-	static void COM_clAttachMemoryBufferOffsetToKernelParameter(cl_kernel kernel, int offsetIndex, MemoryBuffer *memoryBuffers);
-	static void COM_clAttachOutputMemoryBufferToKernelParameter(cl_kernel kernel, int parameterIndex, cl_mem clOutputMemoryBuffer);
-	void COM_clAttachSizeToKernelParameter(cl_kernel kernel, int offsetIndex);
-	static void COM_clEnqueueRange(cl_command_queue queue, cl_kernel kernel, MemoryBuffer *outputMemoryBuffer);

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list