diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2012-07-05 10:34:31 +0400 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2012-07-05 10:34:31 +0400 |
commit | 4e836ab476decd0b0c0acadd00f5bb078c82b5ed (patch) | |
tree | 3e4655a53aa61d902d5c2f71092be2fbd04967d6 /source/blender/compositor/intern/COM_WorkScheduler.cpp | |
parent | 19011d44cf81cac91dd7e2615e6dd09175ecd7e9 (diff) |
Moved highlight code to the workscheduler.
Diffstat (limited to 'source/blender/compositor/intern/COM_WorkScheduler.cpp')
-rw-r--r-- | source/blender/compositor/intern/COM_WorkScheduler.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
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; } |