diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-03-05 18:24:41 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-03-05 18:24:41 +0300 |
commit | 23af8984bb6be579115a4b0e81b65f8cb5a31e83 (patch) | |
tree | 2a9f33729d1ebd19881f452e1c4366b878209b84 /source/blender/compositor/operations | |
parent | 6e1ea04ada2a4f1bcc2ac2df1b1f411756582643 (diff) |
Compositor: Add sanity check around pass element size and compositor data type
Only happening in the debug builds, avoids issues like recent AO one from happening.
Diffstat (limited to 'source/blender/compositor/operations')
-rw-r--r-- | source/blender/compositor/operations/COM_RenderLayersProg.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/compositor/operations/COM_RenderLayersProg.cpp b/source/blender/compositor/operations/COM_RenderLayersProg.cpp index 27936c21545..121998b5569 100644 --- a/source/blender/compositor/operations/COM_RenderLayersProg.cpp +++ b/source/blender/compositor/operations/COM_RenderLayersProg.cpp @@ -135,6 +135,27 @@ void RenderLayersBaseProg::executePixelSampled(float output[4], float x, float y int iy = y - dy; #endif +#ifndef NDEBUG + { + const DataType data_type = this->getOutputSocket()->getDataType(); + int actual_element_size = this->m_elementsize; + int expected_element_size; + if (data_type == COM_DT_VALUE) { + expected_element_size = 1; + } + else if (data_type == COM_DT_VECTOR) { + expected_element_size = 3; + } + else if (data_type == COM_DT_COLOR) { + expected_element_size = 4; + } + else { + BLI_assert(!"Something horribly wrong just happened"); + } + BLI_assert(expected_element_size == actual_element_size); + } +#endif + if (this->m_inputBuffer == NULL) { int elemsize = this->m_elementsize; if (elemsize == 1) { |