diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-05 15:40:48 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-05 15:40:48 +0400 |
commit | 3c367f924a0c25b5bdc547af375a9da8667fe302 (patch) | |
tree | 602790e6798c5fa3996ba04bdfef06f3c9eeb46c /source/blender/compositor | |
parent | 2e12919c4b3017e223980d0c209f60d836202214 (diff) | |
parent | 2442bcf80707234afdd9013348793768f4ae03f2 (diff) |
svn merge ^/trunk/blender -r48604:48638
Diffstat (limited to 'source/blender/compositor')
8 files changed, 41 insertions, 26 deletions
diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cpp b/source/blender/compositor/intern/COM_ExecutionGroup.cpp index e437b069e33..90f4ba85c78 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.cpp +++ b/source/blender/compositor/intern/COM_ExecutionGroup.cpp @@ -25,11 +25,6 @@ #include <sstream> #include <stdlib.h> -#include "BLI_math.h" -#include "PIL_time.h" -#include "WM_api.h" -#include "WM_types.h" - #include "COM_ExecutionGroup.h" #include "COM_InputSocket.h" #include "COM_SocketConnection.h" @@ -43,6 +38,11 @@ #include "COM_ChunkOrder.h" #include "COM_ExecutionSystemHelper.h" +#include "BLI_math.h" +#include "PIL_time.h" +#include "WM_api.h" +#include "WM_types.h" + ExecutionGroup::ExecutionGroup() { this->m_isOutput = false; diff --git a/source/blender/compositor/intern/COM_WorkScheduler.cpp b/source/blender/compositor/intern/COM_WorkScheduler.cpp index c49ac24e018..120b4d6d0f2 100644 --- a/source/blender/compositor/intern/COM_WorkScheduler.cpp +++ b/source/blender/compositor/intern/COM_WorkScheduler.cpp @@ -30,6 +30,7 @@ #include "COM_OpenCLDevice.h" #include "COM_OpenCLKernels.cl.h" #include "OCL_opencl.h" +#include "COM_WriteBufferOperation.h" #include "PIL_time.h" #include "BLI_threads.h" @@ -65,6 +66,25 @@ static bool g_openclActive = false; #endif #endif +#define HIGHLIGHT(wp) \ +{ \ + ExecutionGroup* group = wp->getExecutionGroup(); \ + if (group->isComplex()) { \ + NodeOperation* operation = group->getOutputNodeOperation(); \ + if (operation->isWriteBufferOperation()) {\ + WriteBufferOperation *writeOperation = (WriteBufferOperation*)operation;\ + NodeOperation *complexOperation = writeOperation->getInput(); \ + bNode *node = complexOperation->getbNode(); \ + if (node) { \ + if (node->original) { \ + node->original->highlight = 1;\ + } else {\ + node->highlight = 1; \ + }\ + } \ + } \ + } \ +} #if COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE void *WorkScheduler::thread_execute_cpu(void *data) @@ -73,6 +93,7 @@ void *WorkScheduler::thread_execute_cpu(void *data) WorkPackage *work; while ((work = (WorkPackage *)BLI_thread_queue_pop(g_cpuqueue))) { + HIGHLIGHT(work); device->execute(work); delete work; } @@ -86,6 +107,7 @@ void *WorkScheduler::thread_execute_gpu(void *data) WorkPackage *work; while ((work = (WorkPackage *)BLI_thread_queue_pop(g_gpuqueue))) { + HIGHLIGHT(work); device->execute(work); delete work; } diff --git a/source/blender/compositor/nodes/COM_LensDistortionNode.cpp b/source/blender/compositor/nodes/COM_LensDistortionNode.cpp index 4870e252b74..3913b4ac2b6 100644 --- a/source/blender/compositor/nodes/COM_LensDistortionNode.cpp +++ b/source/blender/compositor/nodes/COM_LensDistortionNode.cpp @@ -50,8 +50,7 @@ void LensDistortionNode::convertToOperations(ExecutionSystem *graph, CompositorC ScreenLensDistortionOperation *operation = new ScreenLensDistortionOperation(); operation->setbNode(editorNode); operation->setData(data); - if (!(this->getInputSocket(1)->isConnected() || this->getInputSocket(2)->isConnected())) - { + if (!(this->getInputSocket(1)->isConnected() || this->getInputSocket(2)->isConnected())) { // no nodes connected to the distortion and dispersion. We can precalculate some values float distortion = ((const bNodeSocketValueFloat *)this->getInputSocket(1)->getbNodeSocket()->default_value)->value; float dispersion = ((const bNodeSocketValueFloat *)this->getInputSocket(2)->getbNodeSocket()->default_value)->value; diff --git a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp index 74145c52a5d..12674153bc8 100644 --- a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp +++ b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp @@ -79,10 +79,10 @@ bool ProjectorLensDistortionOperation::determineDependingAreaOfInterest(rcti *in newInput.xmin = input->xmin - this->m_kr2 - 2; newInput.xmax = input->xmax + this->m_kr2 + 2; } else { - newInput.xmin = input->xmin-7; //(0.25f*20*1)+2 == worse case dispersion + newInput.xmin = input->xmin - 7; //(0.25f*20*1)+2 == worse case dispersion newInput.ymin = input->ymin; newInput.ymax = input->ymax; - newInput.xmax = input->xmax+7; //(0.25f*20*1)+2 == worse case dispersion + newInput.xmax = input->xmax + 7; //(0.25f*20*1)+2 == worse case dispersion } return NodeOperation::determineDependingAreaOfInterest(&newInput, readOperation, output); } diff --git a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp index ea8483734d3..e70185f8fba 100644 --- a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp +++ b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp @@ -232,7 +232,7 @@ bool ScreenLensDistortionOperation::determineDependingAreaOfInterest(rcti *input return true; } -#define MARGIN 64 +#define MARGIN 96 #define UPDATE_INPUT \ newInput.xmin = MIN3(newInput.xmin, coords[0], coords[2]); \ @@ -256,7 +256,7 @@ bool ScreenLensDistortionOperation::determineDependingAreaOfInterest(rcti *input UPDATE_INPUT; determineUV(coords, input->xmax, input->ymin); UPDATE_INPUT; - margin = (ABS(this->m_distortion)+this->m_dispersion)*MARGIN; + margin = (ABS(this->m_distortion) + this->m_dispersion) * MARGIN + 2.0f; } else { @@ -283,7 +283,7 @@ bool ScreenLensDistortionOperation::determineDependingAreaOfInterest(rcti *input UPDATE_INPUT; determineUV(coords, input->xmax, input->ymin, 1.0f, 1.0f); UPDATE_INPUT; - margin=MARGIN; + margin = MARGIN; } #undef UPDATE_INPUT diff --git a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp index 46101f6355d..1368476e9b4 100644 --- a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp @@ -74,7 +74,7 @@ void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, Me #ifdef COM_DEFOCUS_SEARCH float search[4]; - this->inputSearchProgram->read(search, x/InverseSearchRadiusOperation::DIVIDER, y/InverseSearchRadiusOperation::DIVIDER, inputBuffers, NULL); + this->inputSearchProgram->read(search, x/InverseSearchRadiusOperation::DIVIDER, y / InverseSearchRadiusOperation::DIVIDER, inputBuffers, NULL); int minx = search[0]; int miny = search[1]; int maxx = search[2]; @@ -168,10 +168,10 @@ bool VariableSizeBokehBlurOperation::determineDependingAreaOfInterest(rcti *inpu } #ifdef COM_DEFOCUS_SEARCH rcti searchInput; - searchInput.xmax = (input->xmax/InverseSearchRadiusOperation::DIVIDER)+1; - searchInput.xmin = (input->xmin/InverseSearchRadiusOperation::DIVIDER)-1; - searchInput.ymax = (input->ymax/InverseSearchRadiusOperation::DIVIDER)+1; - searchInput.ymin = (input->ymin/InverseSearchRadiusOperation::DIVIDER)-1; + searchInput.xmax = (input->xmax / InverseSearchRadiusOperation::DIVIDER) + 1; + searchInput.xmin = (input->xmin / InverseSearchRadiusOperation::DIVIDER) - 1; + searchInput.ymax = (input->ymax / InverseSearchRadiusOperation::DIVIDER) + 1; + searchInput.ymin = (input->ymin / InverseSearchRadiusOperation::DIVIDER) - 1; operation = getInputOperation(4); if (operation->determineDependingAreaOfInterest(&searchInput, readOperation, output) ) { return true; diff --git a/source/blender/compositor/operations/COM_WriteBufferOperation.cpp b/source/blender/compositor/operations/COM_WriteBufferOperation.cpp index b8c7478b2f7..8decb73615b 100644 --- a/source/blender/compositor/operations/COM_WriteBufferOperation.cpp +++ b/source/blender/compositor/operations/COM_WriteBufferOperation.cpp @@ -63,9 +63,6 @@ void WriteBufferOperation::executeRegion(rcti *rect, unsigned int tileNumber, Me MemoryBuffer *memoryBuffer = this->m_memoryProxy->getBuffer(); float *buffer = memoryBuffer->getBuffer(); if (this->m_input->isComplex()) { - bNode* bnode = this->m_input->getbNode(); - if (bnode&& bnode->original) bnode->original->highlight++; - void *data = this->m_input->initializeTileData(rect, memoryBuffers); int x1 = rect->xmin; int y1 = rect->ymin; @@ -90,7 +87,6 @@ void WriteBufferOperation::executeRegion(rcti *rect, unsigned int tileNumber, Me this->m_input->deinitializeTileData(rect, memoryBuffers, data); data = NULL; } - if (bnode&& bnode->original) bnode->original->highlight++; } else { int x1 = rect->xmin; @@ -143,8 +139,6 @@ void WriteBufferOperation::executeOpenCLRegion(OpenCLDevice* device, rcti *rect, list<cl_mem> *clMemToCleanUp = new list<cl_mem>(); clMemToCleanUp->push_back(clOutputBuffer); list<cl_kernel> *clKernelsToCleanUp = new list<cl_kernel>(); - bNode* bnode = this->m_input->getbNode(); - if (bnode&& bnode->original) bnode->original->highlight++; this->m_input->executeOpenCL(device, outputBuffer, clOutputBuffer, inputMemoryBuffers, clMemToCleanUp, clKernelsToCleanUp); @@ -163,10 +157,7 @@ void WriteBufferOperation::executeOpenCLRegion(OpenCLDevice* device, rcti *rect, this->getMemoryProxy()->getBuffer()->copyContentFrom(outputBuffer); - if (bnode&& bnode->original) bnode->original->highlight++; // STEP 4 - - while (clMemToCleanUp->size() > 0) { cl_mem mem = clMemToCleanUp->front(); error = clReleaseMemObject(mem); diff --git a/source/blender/compositor/operations/COM_WriteBufferOperation.h b/source/blender/compositor/operations/COM_WriteBufferOperation.h index 24bfdecd124..d77814a9dc4 100644 --- a/source/blender/compositor/operations/COM_WriteBufferOperation.h +++ b/source/blender/compositor/operations/COM_WriteBufferOperation.h @@ -46,6 +46,9 @@ public: void deinitExecution(); void executeOpenCLRegion(OpenCLDevice* device, rcti *rect, unsigned int chunkNumber, MemoryBuffer **memoryBuffers, MemoryBuffer *outputBuffer); void readResolutionFromInputSocket(); + inline NodeOperation *getInput() { + return m_input; + } }; #endif |