diff options
Diffstat (limited to 'source/blender/compositor/operations/COM_RenderLayersProg.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_RenderLayersProg.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/source/blender/compositor/operations/COM_RenderLayersProg.cpp b/source/blender/compositor/operations/COM_RenderLayersProg.cpp index e7f33cd2c79..3c0b01874aa 100644 --- a/source/blender/compositor/operations/COM_RenderLayersProg.cpp +++ b/source/blender/compositor/operations/COM_RenderLayersProg.cpp @@ -47,8 +47,9 @@ void RenderLayersProg::initExecution() Render *re = (scene) ? RE_GetSceneRender(scene) : NULL; RenderResult *rr = NULL; - if (re) + if (re) { rr = RE_AcquireResultRead(re); + } if (rr) { ViewLayer *view_layer = (ViewLayer *)BLI_findlink(&scene->view_layers, getLayerId()); @@ -74,12 +75,15 @@ void RenderLayersProg::doInterpolation(float output[4], float x, float y, PixelS int ix = x, iy = y; if (ix < 0 || iy < 0 || ix >= width || iy >= height) { - if (this->m_elementsize == 1) + if (this->m_elementsize == 1) { output[0] = 0.0f; - else if (this->m_elementsize == 3) + } + else if (this->m_elementsize == 3) { zero_v3(output); - else + } + else { zero_v4(output); + } return; } @@ -87,12 +91,15 @@ void RenderLayersProg::doInterpolation(float output[4], float x, float y, PixelS case COM_PS_NEAREST: { offset = (iy * width + ix) * this->m_elementsize; - if (this->m_elementsize == 1) + if (this->m_elementsize == 1) { output[0] = this->m_inputBuffer[offset]; - else if (this->m_elementsize == 3) + } + else if (this->m_elementsize == 3) { copy_v3_v3(output, &this->m_inputBuffer[offset]); - else + } + else { copy_v4_v4(output, &this->m_inputBuffer[offset]); + } break; } @@ -185,8 +192,9 @@ void RenderLayersProg::determineResolution(unsigned int resolution[2], resolution[0] = 0; resolution[1] = 0; - if (re) + if (re) { rr = RE_AcquireResultRead(re); + } if (rr) { ViewLayer *view_layer = (ViewLayer *)BLI_findlink(&sce->view_layers, getLayerId()); @@ -199,8 +207,9 @@ void RenderLayersProg::determineResolution(unsigned int resolution[2], } } - if (re) + if (re) { RE_ReleaseResult(re); + } } /* ******** Render Layers AO Operation ******** */ |