remove scene from new compositor classes. only needs RenderData
authorCampbell Barton <ideasman42@gmail.com>
Fri, 22 Jun 2012 15:06:52 +0000 (15:06 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 22 Jun 2012 15:06:52 +0000 (15:06 +0000)
21 files changed:
source/blender/compositor/intern/COM_CompositorContext.cpp
source/blender/compositor/intern/COM_CompositorContext.h
source/blender/compositor/intern/COM_ExecutionSystem.cpp
source/blender/compositor/intern/COM_ExecutionSystem.h
source/blender/compositor/intern/COM_compositor.cpp
source/blender/compositor/nodes/COM_CompositorNode.cpp
source/blender/compositor/nodes/COM_IDMaskNode.cpp
source/blender/compositor/nodes/COM_MaskNode.cpp
source/blender/compositor/nodes/COM_OutputFileNode.cpp
source/blender/compositor/nodes/COM_ScaleNode.cpp
source/blender/compositor/nodes/COM_SplitViewerNode.cpp
source/blender/compositor/nodes/COM_TextureNode.cpp
source/blender/compositor/nodes/COM_ViewerNode.cpp
source/blender/compositor/operations/COM_CompositorOperation.cpp
source/blender/compositor/operations/COM_CompositorOperation.h
source/blender/compositor/operations/COM_OutputFileOperation.cpp
source/blender/compositor/operations/COM_OutputFileOperation.h
source/blender/compositor/operations/COM_TextureOperation.cpp
source/blender/compositor/operations/COM_TextureOperation.h
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/intern/source/pipeline.c

index bb8e7d9606d2f1c5632dfd3f21d1eb8dfbfa8e61..c3470f0a16eb8a39c02b25b210d23d1f390641f4 100644 (file)
@@ -26,7 +26,7 @@
 
 CompositorContext::CompositorContext()
 {
-       this->scene = NULL;
+       this->rd = NULL;
        this->quality = COM_QUALITY_HIGH;
        this->hasActiveOpenCLDevices = false;
        this->activegNode = NULL;
@@ -34,8 +34,8 @@ CompositorContext::CompositorContext()
 
 const int CompositorContext::getFramenumber() const
 {
-       if (this->scene) {
-               return this->scene->r.cfra;
+       if (this->rd) {
+               return this->rd->cfra;
        }
        else {
                return -1; /* this should never happen */
@@ -44,8 +44,8 @@ const int CompositorContext::getFramenumber() const
 
 const int CompositorContext::isColorManaged() const
 {
-       if (this->scene) {
-               return this->scene->r.color_mgt_flag & R_COLOR_MANAGEMENT;
+       if (this->rd) {
+               return this->rd->color_mgt_flag & R_COLOR_MANAGEMENT;
        }
        else {
                return 0; /* this should never happen */
index 93872f4839f402e709d7427b5f33a81c5e3f1a89..81fd81b4117a62a43ba5950497051832b0491ce2 100644 (file)
@@ -51,11 +51,11 @@ private:
        CompositorQuality quality;
 
        /**
-        * @brief Reference to the scene that is being composited.
+        * @brief Reference to the render data that is being composited.
         * This field is initialized in ExecutionSystem and must only be read from that point on.
         * @see ExecutionSystem
         */
-       Scene *scene;
+       RenderData *rd;
 
        /**
         * @brief reference to the bNodeTree
@@ -93,7 +93,7 @@ public:
        /**
         * @brief set the scene of the context
         */
-       void setScene(Scene *scene) { this->scene = scene; }
+       void setRenderData(RenderData *rd) { this->rd = rd; }
 
        /**
         * @brief set the bnodetree of the context
@@ -118,7 +118,7 @@ public:
        /**
         * @brief get the scene of the context
         */
-       const Scene *getScene() const { return this->scene; }
+       const RenderData *getRenderData() const { return this->rd; }
 
        /**
         * @brief set the quality
index 806f1db1bdf76f025d4bcca000fabecefe31612e..7e09486fd0bc57cf3eb11246cb2ed1c5ba4b13d2 100644 (file)
@@ -41,7 +41,7 @@
 
 #include "BKE_global.h"
 
-ExecutionSystem::ExecutionSystem(Scene *scene, bNodeTree *editingtree, bool rendering)
+ExecutionSystem::ExecutionSystem(RenderData *rd, bNodeTree *editingtree, bool rendering)
 {
        context.setbNodeTree(editingtree);
        bNode *gnode;
@@ -64,7 +64,7 @@ ExecutionSystem::ExecutionSystem(Scene *scene, bNodeTree *editingtree, bool rend
 
        ExecutionSystemHelper::addbNodeTree(*this, 0, editingtree, NULL);
 
-       context.setScene(scene);
+       context.setRenderData(rd);
        this->convertToOperations();
        this->groupOperations(); /* group operations in ExecutionGroups */
        unsigned int index;
index 0cc9e3e6b4bf7f9c1b75ae3a19614abf65dda87b..48ff2ef6af95624104864e6c73a8e5d078ef87ac 100644 (file)
@@ -156,7 +156,7 @@ public:
         * @param editingtree [bNodeTree*]
         * @param rendering [true false]
         */
-       ExecutionSystem(Scene *scene, bNodeTree *editingtree, bool rendering);
+       ExecutionSystem(RenderData *rd, bNodeTree *editingtree, bool rendering);
 
        /**
         * Destructor
index cfae8f5f481fe506faad008b3b922abc17410aa6..bec9ff95eed209df7a1d6a4400d4e5e7136ee934 100644 (file)
@@ -56,15 +56,9 @@ void COM_execute(RenderData *rd, bNodeTree *editingtree, int rendering)
        editingtree->progress(editingtree->prh, 0.0);
 
        /* initialize execution system */
-       Scene *scene;
-       for (scene = (Scene*)G.main->scene.first; scene != NULL ; scene = (Scene*)scene->id.next) {
-               if (&scene->r == rd) {
-                       ExecutionSystem *system = new ExecutionSystem(scene, editingtree, rendering);
-                       system->execute();
-                       delete system;
-                       break;
-               }
-       }
+       ExecutionSystem *system = new ExecutionSystem(rd, editingtree, rendering);
+       system->execute();
+       delete system;
 
        BLI_mutex_unlock(compositorMutex);
 }
index fccb92ddd8b979dc1c64d1c5a306d190eab50ffd..6a6f2d1b4ffff172f1f512215c611f0edcea8026 100644 (file)
@@ -35,7 +35,7 @@ void CompositorNode::convertToOperations(ExecutionSystem *graph, CompositorConte
        InputSocket *alphaSocket = this->getInputSocket(1);
        if (imageSocket->isConnected()) {
                CompositorOperation *colourAlphaProg = new CompositorOperation();
-               colourAlphaProg->setScene(context->getScene());
+               colourAlphaProg->setRenderData(context->getRenderData());
                colourAlphaProg->setbNodeTree(context->getbNodeTree());
                imageSocket->relinkConnections(colourAlphaProg->getInputSocket(0));
                alphaSocket->relinkConnections(colourAlphaProg->getInputSocket(1));
index 4005e5d2900c9f02bf2c019c4cc8edf13f0294da..31d2ccb391e287d6766782aff86662792a82e25c 100644 (file)
@@ -38,7 +38,7 @@ void IDMaskNode::convertToOperations(ExecutionSystem *graph, CompositorContext *
        operation->setObjectIndex(bnode->custom1);
        
        this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph);
-       if (bnode->custom2 == 0 || context->getScene()->r.scemode & R_FULL_SAMPLE) {
+       if (bnode->custom2 == 0 || context->getRenderData()->scemode & R_FULL_SAMPLE) {
                this->getOutputSocket(0)->relinkConnections(operation->getOutputSocket(0));
        }
        else {
index d745fd85104e2971fef785d7f0785c1b0411e7f8..13037b61a56f004e2170d9b9db6e333d762336a2 100644 (file)
@@ -36,7 +36,7 @@ MaskNode::MaskNode(bNode *editorNode) : Node(editorNode)
 
 void MaskNode::convertToOperations(ExecutionSystem *graph, CompositorContext *context)
 {
-       const RenderData *data = &context->getScene()->r;
+       const RenderData *data = context->getRenderData();
 
        OutputSocket *outputMask = this->getOutputSocket(0);
 
index db7fbffea4f670dcdc1b16f1c112ed07694bbf58..e85f521def0f41d5d8c207667fe8a5bc1c81c6a8 100644 (file)
@@ -47,7 +47,7 @@ void OutputFileNode::convertToOperations(ExecutionSystem *graph, CompositorConte
        if (storage->format.imtype == R_IMF_IMTYPE_MULTILAYER) {
                /* single output operation for the multilayer file */
                OutputOpenExrMultiLayerOperation *outputOperation = new OutputOpenExrMultiLayerOperation(
-                       context->getScene(), context->getbNodeTree(), storage->base_path, storage->format.exr_codec);
+                       context->getRenderData(), context->getbNodeTree(), storage->base_path, storage->format.exr_codec);
                
                int num_inputs = getNumberOfInputSockets();
                bool hasConnections = false;
@@ -80,7 +80,7 @@ void OutputFileNode::convertToOperations(ExecutionSystem *graph, CompositorConte
                                BLI_join_dirfile(path, FILE_MAX, storage->base_path, sockdata->path);
                                
                                OutputSingleLayerOperation *outputOperation = new OutputSingleLayerOperation(
-                                       context->getScene(), context->getbNodeTree(), input->getDataType(), format, path);
+                                       context->getRenderData(), context->getbNodeTree(), input->getDataType(), format, path);
                                input->relinkConnections(outputOperation->getInputSocket(0));
                                graph->addOperation(outputOperation);
                                if (!previewAdded) {
index 17b521c589d60e9e582d39bac79851292d263dfa..95b048b6cad9f9bc9dd32ed1657004adda527eeb 100644 (file)
@@ -52,7 +52,7 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
                break;
                case CMP_SCALE_SCENEPERCENT: {
                        SetValueOperation *scaleFactorOperation = new SetValueOperation();
-                       scaleFactorOperation->setValue(context->getScene()->r.size / 100.0f);
+                       scaleFactorOperation->setValue(context->getRenderData()->size / 100.0f);
                        ScaleOperation *operation = new ScaleOperation();
                        inputSocket->relinkConnections(operation->getInputSocket(0), 0, graph);
                        addLink(graph, scaleFactorOperation->getOutputSocket(), operation->getInputSocket(1));
@@ -64,7 +64,7 @@ void ScaleNode::convertToOperations(ExecutionSystem *graph, CompositorContext *c
                break;
 
                case CMP_SCALE_RENDERPERCENT: {
-                       const RenderData *data = &context->getScene()->r;
+                       const RenderData *data = context->getRenderData();
                        ScaleFixedSizeOperation *operation = new ScaleFixedSizeOperation();
 
                        /* framing options */
index 22a004103840c6b50b53c9bcb4e77198f6fb43d4..388466cee3c6b670a653db57d98b84c1cedbf1f5 100644 (file)
@@ -39,8 +39,8 @@ void SplitViewerNode::convertToOperations(ExecutionSystem *graph, CompositorCont
        ImageUser *imageUser = (ImageUser *) this->getbNode()->storage;
        if (image1Socket->isConnected() && image2Socket->isConnected()) {
                SplitViewerOperation *splitViewerOperation = new SplitViewerOperation();
-               splitViewerOperation->setColorManagement(context->getScene()->r.color_mgt_flag & R_COLOR_MANAGEMENT);
-               splitViewerOperation->setColorPredivide(context->getScene()->r.color_mgt_flag & R_COLOR_MANAGEMENT_PREDIVIDE);
+               splitViewerOperation->setColorManagement(context->getRenderData()->color_mgt_flag & R_COLOR_MANAGEMENT);
+               splitViewerOperation->setColorPredivide(context->getRenderData()->color_mgt_flag & R_COLOR_MANAGEMENT_PREDIVIDE);
                splitViewerOperation->setImage(image);
                splitViewerOperation->setImageUser(imageUser);
                splitViewerOperation->setActive((this->getbNode()->flag & NODE_DO_OUTPUT) && this->isInActiveGroup());
index a3526e3c1a132a257a5fafe56738530f8d9af8b0..b035e0a392c4e3ea8a5ea9de5ebe43e3b3452726 100644 (file)
@@ -38,7 +38,7 @@ void TextureNode::convertToOperations(ExecutionSystem *system, CompositorContext
        this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, system);
        this->getInputSocket(1)->relinkConnections(operation->getInputSocket(1), 1, system);
        operation->setTexture(texture);
-       operation->setScene(context->getScene());
+       operation->setRenderData(context->getRenderData());
        system->addOperation(operation);
        addPreviewOperation(system, operation->getOutputSocket());
 
@@ -48,7 +48,7 @@ void TextureNode::convertToOperations(ExecutionSystem *system, CompositorContext
                addLink(system, operation->getInputSocket(0)->getConnection()->getFromSocket(), alphaOperation->getInputSocket(0));
                addLink(system, operation->getInputSocket(1)->getConnection()->getFromSocket(), alphaOperation->getInputSocket(1));
                alphaOperation->setTexture(texture);
-               alphaOperation->setScene(context->getScene());
+               alphaOperation->setRenderData(context->getRenderData());
                system->addOperation(alphaOperation);
        }
 }
index 9228fdbef8542193f628439c4c5d3d9cc7a36359..1205767cb28e0ffdbb15dce2d1eb6abd14012319 100644 (file)
@@ -40,8 +40,8 @@ void ViewerNode::convertToOperations(ExecutionSystem *graph, CompositorContext *
        bNode *editorNode = this->getbNode();
        if (imageSocket->isConnected()) {
                ViewerOperation *viewerOperation = new ViewerOperation();
-               viewerOperation->setColorManagement(context->getScene()->r.color_mgt_flag & R_COLOR_MANAGEMENT);
-               viewerOperation->setColorPredivide(context->getScene()->r.color_mgt_flag & R_COLOR_MANAGEMENT_PREDIVIDE);
+               viewerOperation->setColorManagement(context->getRenderData()->color_mgt_flag & R_COLOR_MANAGEMENT);
+               viewerOperation->setColorPredivide(context->getRenderData()->color_mgt_flag & R_COLOR_MANAGEMENT_PREDIVIDE);
                viewerOperation->setbNodeTree(context->getbNodeTree());
                viewerOperation->setImage(image);
                viewerOperation->setImageUser(imageUser);
index 2b1a804b4321fbf30e0734955b42afbfa140090c..622cd50f3493f46960458cf6add6d69113a9e7bc 100644 (file)
@@ -41,7 +41,7 @@ CompositorOperation::CompositorOperation() : NodeOperation()
        this->addInputSocket(COM_DT_COLOR);
        this->addInputSocket(COM_DT_VALUE);
 
-       this->setScene(NULL);
+       this->setRenderData(NULL);
        this->outputBuffer = NULL;
        this->imageInput = NULL;
        this->alphaInput = NULL;
@@ -60,8 +60,8 @@ void CompositorOperation::initExecution()
 void CompositorOperation::deinitExecution()
 {
        if (!isBreaked()) {
-               const Scene *scene = this->scene;
-               Render *re = RE_GetRender(scene->id.name);
+               const RenderData *rd = this->rd;
+               Render *re = RE_GetRender_FromData(rd);
                RenderResult *rr = RE_AcquireResultWrite(re);
                if (rr) {
                        if (rr->rectf  != NULL) {
@@ -127,12 +127,12 @@ void CompositorOperation::executeRegion(rcti *rect, unsigned int tileNumber, Mem
 
 void CompositorOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
 {
-       int width = this->scene->r.xsch * this->scene->r.size / 100;
-       int height = this->scene->r.ysch * this->scene->r.size / 100;
+       int width = this->rd->xsch * this->rd->size / 100;
+       int height = this->rd->ysch * this->rd->size / 100;
 
        // check actual render resolution with cropping it may differ with cropped border.rendering
        // FIX for: [31777] Border Crop gives black (easy)
-       Render *re = RE_GetRender(this->scene->id.name);
+       Render *re = RE_GetRender_FromData(this->rd);
        if (re) {
                RenderResult *rr = RE_AcquireResultRead(re);
                if (rr) {
index 0129c953946921e522b47cc2872d3bbb3c685357..280f39b772936c3ba492a2681d6ba09a2ea64c3b 100644 (file)
@@ -34,7 +34,7 @@ private:
        /**
         * @brief local reference to the scene
         */
-       const Scene *scene;
+       const RenderData *rd;
 
        /**
         * @brief reference to the output float buffer
@@ -53,7 +53,7 @@ private:
 public:
        CompositorOperation();
        void executeRegion(rcti *rect, unsigned int tileNumber, MemoryBuffer **memoryBuffers);
-       void setScene(const Scene *scene) { this->scene = scene; }
+       void setRenderData(const RenderData *rd) { this->rd = rd; }
        bool isOutputOperation(bool rendering) const { return true; }
        void initExecution();
        void deinitExecution();
index e71178a811d4b4d9d4464a068ca01266b853958d..c0aa139b0327a1efb619450549fc92746ced7e5b 100644 (file)
@@ -92,9 +92,9 @@ static void write_buffer_rect(rcti *rect, MemoryBuffer **memoryBuffers, const bN
 
 
 OutputSingleLayerOperation::OutputSingleLayerOperation(
-    const Scene *scene, const bNodeTree *tree, DataType datatype, ImageFormatData *format, const char *path)
+    const RenderData *rd, const bNodeTree *tree, DataType datatype, ImageFormatData *format, const char *path)
 {
-       this->scene = scene;
+       this->rd = rd;
        this->tree = tree;
        
        this->addInputSocket(datatype);
@@ -130,13 +130,13 @@ void OutputSingleLayerOperation::deinitExecution()
                ibuf->channels = size;
                ibuf->rect_float = this->outputBuffer;
                ibuf->mall |= IB_rectfloat; 
-               ibuf->dither = scene->r.dither_intensity;
+               ibuf->dither = this->rd->dither_intensity;
                
-               if (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT)
+               if (this->rd->color_mgt_flag & R_COLOR_MANAGEMENT)
                        ibuf->profile = IB_PROFILE_LINEAR_RGB;
                
-               BKE_makepicstring(filename, this->path, bmain->name, this->scene->r.cfra, this->format->imtype,
-                                 (this->scene->r.scemode & R_EXTENSION), true);
+               BKE_makepicstring(filename, this->path, bmain->name, this->rd->cfra, this->format->imtype,
+                                 (this->rd->scemode & R_EXTENSION), true);
                
                if (0 == BKE_imbuf_write(ibuf, filename, this->format))
                        printf("Cannot save Node File Output to %s\n", filename);
@@ -160,9 +160,9 @@ OutputOpenExrLayer::OutputOpenExrLayer(const char *name, DataType datatype)
 }
 
 OutputOpenExrMultiLayerOperation::OutputOpenExrMultiLayerOperation(
-    const Scene *scene, const bNodeTree *tree, const char *path, char exr_codec)
+    const RenderData *rd, const bNodeTree *tree, const char *path, char exr_codec)
 {
-       this->scene = scene;
+       this->rd = rd;
        this->tree = tree;
        
        BLI_strncpy(this->path, path, sizeof(this->path));
@@ -199,8 +199,8 @@ void OutputOpenExrMultiLayerOperation::deinitExecution()
                char filename[FILE_MAX];
                void *exrhandle = IMB_exr_get_handle();
                
-               BKE_makepicstring(filename, this->path, bmain->name, this->scene->r.cfra, R_IMF_IMTYPE_MULTILAYER,
-                                 (this->scene->r.scemode & R_EXTENSION), true);
+               BKE_makepicstring(filename, this->path, bmain->name, this->rd->cfra, R_IMF_IMTYPE_MULTILAYER,
+                                 (this->rd->scemode & R_EXTENSION), true);
                BLI_make_existing_file(filename);
                
                for (unsigned int i = 0; i < layers.size(); ++i) {
index cfc5f7e41f2ebf82af696f2ce3e44c4748cd2ad2..25ee5b31ec0547d8938ba9ff9a3c8beecc614b80 100644 (file)
@@ -32,7 +32,7 @@
 /* Writes the image to a single-layer file. */
 class OutputSingleLayerOperation : public NodeOperation {
 private:
-       const Scene *scene;
+       const RenderData *rd;
        const bNodeTree *tree;
        
        ImageFormatData *format;
@@ -43,7 +43,7 @@ private:
        SocketReader *imageInput;
 
 public:
-       OutputSingleLayerOperation(const Scene *scene, const bNodeTree *tree, DataType datatype, ImageFormatData *format, const char *path);
+       OutputSingleLayerOperation(const RenderData *rd, const bNodeTree *tree, DataType datatype, ImageFormatData *format, const char *path);
        
        void executeRegion(rcti *rect, unsigned int tileNumber, MemoryBuffer **memoryBuffers);
        bool isOutputOperation(bool rendering) const { return true; }
@@ -67,7 +67,7 @@ class OutputOpenExrMultiLayerOperation : public NodeOperation {
 private:
        typedef std::vector<OutputOpenExrLayer> LayerList;
        
-       const Scene *scene;
+       const RenderData *rd;
        const bNodeTree *tree;
        
        char path[FILE_MAX];
@@ -75,7 +75,7 @@ private:
        LayerList layers;
        
 public:
-       OutputOpenExrMultiLayerOperation(const Scene *scene, const bNodeTree *tree, const char *path, char exr_codec);
+       OutputOpenExrMultiLayerOperation(const RenderData *rd, const bNodeTree *tree, const char *path, char exr_codec);
        
        void add_layer(const char *name, DataType datatype);
        
index 072528f3fc6dc0df63bc17d99486faa997b0ad8d..dbdd17adbe4a46bd1ce1e97d9743f249f3ab8242 100644 (file)
@@ -32,7 +32,7 @@ TextureBaseOperation::TextureBaseOperation() : NodeOperation()
        this->texture = NULL;
        this->inputSize = NULL;
        this->inputOffset = NULL;
-       this->scene = NULL;
+       this->rd = NULL;
 }
 TextureOperation::TextureOperation() : TextureBaseOperation()
 {
@@ -57,8 +57,8 @@ void TextureBaseOperation::deinitExecution()
 void TextureBaseOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[])
 {
        if (preferredResolution[0] == 0 || preferredResolution[1] == 0) {
-               int width = this->scene->r.xsch * this->scene->r.size / 100;
-               int height = this->scene->r.ysch * this->scene->r.size / 100;
+               int width = this->rd->xsch * this->rd->size / 100;
+               int height = this->rd->ysch * this->rd->size / 100;
                resolution[0] = width;
                resolution[1] = height;
        }
index e862a1f19102fea2107d8fb1269d988f7f52290b..147142425112ef18686b6f7c52e671fa69ff4b46 100644 (file)
@@ -43,7 +43,7 @@ extern "C" {
 class TextureBaseOperation : public NodeOperation {
 private:
        Tex *texture;
-       const Scene *scene;
+       const RenderData *rd;
        SocketReader *inputSize;
        SocketReader *inputOffset;
 
@@ -65,7 +65,7 @@ public:
        void setTexture(Tex *texture) { this->texture = texture; }
        void initExecution();
        void deinitExecution();
-       void setScene(const Scene *scene) { this->scene = scene; }
+       void setRenderData(const RenderData *rd) { this->rd = rd; }
 };
 
 class TextureOperation : public TextureBaseOperation {
index 2a3c8e60638b220707cd27ff67f8a49bf0728323..4e33e4d7e2d0ef32c59e7ce6f219dd5bcd6d7d7b 100644 (file)
@@ -154,6 +154,7 @@ typedef struct RenderStats {
 /* calling a new render with same name, frees automatic existing render */
 struct Render *RE_NewRender (const char *name);
 struct Render *RE_GetRender(const char *name);
+struct Render *RE_GetRender_FromData(const struct RenderData *rd);
 
 /* returns 1 while render is working (or renders called from within render) */
 int RE_RenderInProgress(struct Render *re);
index eab152262f8cd560f3f89ef2173f8da7943845a6..3de64996311f05aa63b4bfa30553f572730f5bac 100644 (file)
@@ -245,6 +245,18 @@ Render *RE_GetRender(const char *name)
        return re;
 }
 
+Render *RE_GetRender_FromData(const RenderData *rd)
+{
+       Render *re;
+
+       /* search for existing renders */
+       for (re = RenderGlobal.renderlist.first; re; re = re->next)
+               if (&re->r == rd)
+                       break;
+
+       return re;
+}
+
 /* if you want to know exactly what has been done */
 RenderResult *RE_AcquireResultRead(Render *re)
 {