[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42499] branches/tile/source/blender/ compositor: Tile branch:

Jeroen Bakker j.bakker at atmind.nl
Wed Dec 7 21:27:55 CET 2011


Revision: 42499
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42499
Author:   jbakker
Date:     2011-12-07 20:27:50 +0000 (Wed, 07 Dec 2011)
Log Message:
-----------
Tile branch:
cleaned up some debugging information

Modified Paths:
--------------
    branches/tile/source/blender/compositor/intern/COM_ExecutionGroup.cpp
    branches/tile/source/blender/compositor/intern/COM_ExecutionSystem.cpp
    branches/tile/source/blender/compositor/intern/COM_ExecutionSystem.h
    branches/tile/source/blender/compositor/intern/COM_Node.cpp
    branches/tile/source/blender/compositor/intern/COM_compositor.cpp
    branches/tile/source/blender/compositor/operations/COM_PreviewOperation.cpp

Modified: branches/tile/source/blender/compositor/intern/COM_ExecutionGroup.cpp
===================================================================
--- branches/tile/source/blender/compositor/intern/COM_ExecutionGroup.cpp	2011-12-07 20:13:15 UTC (rev 42498)
+++ branches/tile/source/blender/compositor/intern/COM_ExecutionGroup.cpp	2011-12-07 20:27:50 UTC (rev 42499)
@@ -196,10 +196,9 @@
 void ExecutionGroup::execute(ExecutionSystem* graph) {
 	CompositorContext& context = graph->getContext();
 	const bNodeTree* bTree = context.getbNodeTree();
-	printf("schedule: %s x:%d y:%d #chunks:%d\n", this->getId().c_str(), this->width, this->height, this->numberOfChunks);
 	if (this->width == 0 || this->height == 0) {return;} /// @note: break out... no pixels to calculate.
 	if (bTree->test_break && bTree->test_break(bTree->tbh)) {return;} /// @note: early break out for blur and preview nodes
-
+	if (this->numberOfChunks == 0) {return;} /// @note: early break out
 	unsigned int chunkNumber;
 
 	this->chunksFinished = 0;

Modified: branches/tile/source/blender/compositor/intern/COM_ExecutionSystem.cpp
===================================================================
--- branches/tile/source/blender/compositor/intern/COM_ExecutionSystem.cpp	2011-12-07 20:13:15 UTC (rev 42498)
+++ branches/tile/source/blender/compositor/intern/COM_ExecutionSystem.cpp	2011-12-07 20:27:50 UTC (rev 42499)
@@ -39,9 +39,7 @@
 #include "COM_ExecutionSystemHelper.h"
 
 ExecutionSystem::ExecutionSystem(bNodeTree* editingtree, bool rendering) {
-	this->starttime = PIL_check_seconds_timer();
 	this->context.setbNodeTree(editingtree);
-	printf("starttime %f\n", starttime);
 
 	/* initialize the CompositorContext */
 	if (rendering) {
@@ -53,23 +51,14 @@
 	context.setHasActiveOpenCLDevices(WorkScheduler::hasGPUDevices() && (editingtree->flag & NTREE_COM_OPENCL));
 
 	Node* mainOutputNode=NULL;
-	printf(" - %f convert to editor tree\n", PIL_check_seconds_timer()-starttime);
 
 	mainOutputNode = ExecutionSystemHelper::addbNodeTree(this->getNodes(), this->getConnections(), editingtree);
 
 	if (mainOutputNode) {
 		context.setScene((Scene*)mainOutputNode->getbNode()->id);
-
-		printf(" - %f ungroup\n", PIL_check_seconds_timer()-starttime);
 		ExecutionSystemHelper::ungroup(*this); /* copy subtrees of GroupNode in main tree, so only the main tree needs to be evaluated (reduces complexity) */
-		printf(" - %f convert to operations\n", PIL_check_seconds_timer()-starttime);
 		this->convertToOperations();
-
-		printf(" - %f group operations to execution groups\n", PIL_check_seconds_timer()-starttime);
 		this->groupOperations(); /* group operations in ExecutionGroups */
-
-
-		printf(" - %f determine resolutions\n", PIL_check_seconds_timer()-starttime);
 		vector<ExecutionGroup*> executionGroups;
 		this->findOutputExecutionGroup(&executionGroups);
 		unsigned int index;
@@ -140,8 +129,6 @@
 
 	/* start execution of the ExecutionGroups based on priority of their output node */
 	for (int priority = 9 ; priority>=0 ; priority--) {
-		printf(" - %f executing priority %d groups\n", PIL_check_seconds_timer()-starttime, priority);
-
 		for (index = 0 ; index < executionGroups.size(); index ++) {
 			ExecutionGroup* group = executionGroups[index];
 			NodeOperation* output = group->getOutputNodeOperation();
@@ -150,9 +137,7 @@
 			}
 		}
 	}
-	printf(" - %f clean up execution \n", PIL_check_seconds_timer()-starttime);
 
-
 	WorkScheduler::finish();
 	WorkScheduler::stop();
 

Modified: branches/tile/source/blender/compositor/intern/COM_ExecutionSystem.h
===================================================================
--- branches/tile/source/blender/compositor/intern/COM_ExecutionSystem.h	2011-12-07 20:13:15 UTC (rev 42498)
+++ branches/tile/source/blender/compositor/intern/COM_ExecutionSystem.h	2011-12-07 20:27:50 UTC (rev 42499)
@@ -111,11 +111,6 @@
 	CompositorContext context;
 
 	/**
-	  * @brief starttime of the execution, used for logging
-	  */
-	double starttime;
-
-	/**
 	  * @brief vector of nodes
 	  */
 	vector<Node*> nodes;

Modified: branches/tile/source/blender/compositor/intern/COM_Node.cpp
===================================================================
--- branches/tile/source/blender/compositor/intern/COM_Node.cpp	2011-12-07 20:13:15 UTC (rev 42498)
+++ branches/tile/source/blender/compositor/intern/COM_Node.cpp	2011-12-07 20:27:50 UTC (rev 42499)
@@ -68,13 +68,8 @@
     bNodeSocket *bSock = (bNodeSocket*)this->getEditorInputSocket(editorNodeInputSocketIndex);
     SetValueOperation *operation = new SetValueOperation();
     operation->setValue(bSock->ns.vec[0]);
-    SocketConnection *connection = new SocketConnection();
-    connection->setFromSocket(operation->getOutputSocket(0));
-    operation->getOutputSocket(0)->addConnection(connection);
-    connection->setToSocket(inputsocket);
-    inputsocket->setConnection(connection);
+	this->addLink(graph, operation->getOutputSocket(), inputsocket);
     graph->addOperation(operation);
-    graph->addSocketConnection(connection);
 }
 
 void Node::addPreviewOperation(ExecutionSystem *system, OutputSocket *outputSocket, int priority) {
@@ -95,7 +90,6 @@
 
 SocketConnection* Node::addLink(ExecutionSystem *graph, OutputSocket* outputSocket, InputSocket* inputsocket) {
 	if (inputsocket->isConnected()) {
-//        printf("ERROR, inputsocket is already connected to something\n");
 		return NULL;
 	}
 	SocketConnection *connection = new SocketConnection();
@@ -108,35 +102,25 @@
 }
 
 void Node::addSetColorOperation(ExecutionSystem *graph, InputSocket* inputsocket, int editorNodeInputSocketIndex) {
-    bNodeSocket *bSock = (bNodeSocket*)this->getEditorInputSocket(editorNodeInputSocketIndex);
-    SetColorOperation *operation = new SetColorOperation();
-    operation->setChannel1(bSock->ns.vec[0]);
-    operation->setChannel2(bSock->ns.vec[1]);
-    operation->setChannel3(bSock->ns.vec[2]);
-    operation->setChannel4(bSock->ns.vec[3]);
-    SocketConnection *connection = new SocketConnection();
-    connection->setFromSocket(operation->getOutputSocket(0));
-    operation->getOutputSocket(0)->addConnection(connection);
-    connection->setToSocket(inputsocket);
-    inputsocket->setConnection(connection);
-    graph->addOperation(operation);
-    graph->addSocketConnection(connection);
+	bNodeSocket *bSock = (bNodeSocket*)this->getEditorInputSocket(editorNodeInputSocketIndex);
+	SetColorOperation *operation = new SetColorOperation();
+	operation->setChannel1(bSock->ns.vec[0]);
+	operation->setChannel2(bSock->ns.vec[1]);
+	operation->setChannel3(bSock->ns.vec[2]);
+	operation->setChannel4(bSock->ns.vec[3]);
+	this->addLink(graph, operation->getOutputSocket(), inputsocket);
+	graph->addOperation(operation);
 }
 
 void Node::addSetVectorOperation(ExecutionSystem *graph, InputSocket* inputsocket, int editorNodeInputSocketIndex) {
-    bNodeSocket *bSock = (bNodeSocket*)this->getEditorInputSocket(editorNodeInputSocketIndex);
-    SetVectorOperation *operation = new SetVectorOperation();
-    operation->setX(bSock->ns.vec[0]);
-    operation->setY(bSock->ns.vec[1]);
-    operation->setZ(bSock->ns.vec[2]);
-    operation->setW(bSock->ns.vec[3]);
-    SocketConnection *connection = new SocketConnection();
-    connection->setFromSocket(operation->getOutputSocket(0));
-    operation->getOutputSocket(0)->addConnection(connection);
-    connection->setToSocket(inputsocket);
-    inputsocket->setConnection(connection);
-    graph->addOperation(operation);
-    graph->addSocketConnection(connection);
+	bNodeSocket *bSock = (bNodeSocket*)this->getEditorInputSocket(editorNodeInputSocketIndex);
+	SetVectorOperation *operation = new SetVectorOperation();
+	operation->setX(bSock->ns.vec[0]);
+	operation->setY(bSock->ns.vec[1]);
+	operation->setZ(bSock->ns.vec[2]);
+	operation->setW(bSock->ns.vec[3]);
+	this->addLink(graph, operation->getOutputSocket(), inputsocket);
+	graph->addOperation(operation);
 }
 
 bNodeSocket* Node::getEditorInputSocket(int editorNodeInputSocketIndex) {

Modified: branches/tile/source/blender/compositor/intern/COM_compositor.cpp
===================================================================
--- branches/tile/source/blender/compositor/intern/COM_compositor.cpp	2011-12-07 20:13:15 UTC (rev 42498)
+++ branches/tile/source/blender/compositor/intern/COM_compositor.cpp	2011-12-07 20:27:50 UTC (rev 42499)
@@ -35,16 +35,16 @@
 	if (mutex == NULL) { /// TODO: move to blender startup phase
 		mutex = new ThreadMutex();
 		BLI_mutex_init(mutex);
-                WorkScheduler::initialize(); ///TODO: call workscheduler.deinitialize somewhere
+		WorkScheduler::initialize(); ///TODO: call workscheduler.deinitialize somewhere
 	}
 	BLI_mutex_lock(mutex);
-	if (editingtree->test_break && editingtree->test_break(editingtree->tbh)) {
-		// during editing multiple calls to this method can be triggered.
-		// make sure one the last one will be doing the work.
-		BLI_mutex_unlock(mutex);
-		return;
+//	if (editingtree->test_break && editingtree->test_break(editingtree->tbh)) {
+//		// during editing multiple calls to this method can be triggered.
+//		// make sure one the last one will be doing the work.
+//		BLI_mutex_unlock(mutex);
+//		return;
 
-	}
+//	}
 
 	/* set progress bar to 0% and status to init compositing*/
 	editingtree->progress(editingtree->prh, 0.0);

Modified: branches/tile/source/blender/compositor/operations/COM_PreviewOperation.cpp
===================================================================
--- branches/tile/source/blender/compositor/operations/COM_PreviewOperation.cpp	2011-12-07 20:13:15 UTC (rev 42498)
+++ branches/tile/source/blender/compositor/operations/COM_PreviewOperation.cpp	2011-12-07 20:27:50 UTC (rev 42499)
@@ -52,23 +52,21 @@
 	this->input = getInputSocketReader(0);
 	if (!this->node->preview) {
 		this->node->preview = (bNodePreview*)MEM_callocN(sizeof(bNodePreview), "node preview");
-
-    } else {
-                if (this->getWidth() == (unsigned int)this->node->preview->xsize && this->getHeight() == (unsigned int)this->node->preview->ysize) {
+	} else {
+		if (this->getWidth() == (unsigned int)this->node->preview->xsize && this->getHeight() == (unsigned int)this->node->preview->ysize) {
 			this->outputBuffer = this->node->preview->rect;
-        } else {
-        }
-    }
+		}
+	}
 
-    if (this->outputBuffer == NULL) {

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list