diff options
author | Manuel Castilla <manzanillawork@gmail.com> | 2021-07-07 01:14:11 +0300 |
---|---|---|
committer | Manuel Castilla <manzanillawork@gmail.com> | 2021-07-07 02:09:43 +0300 |
commit | 6ac3a106190c1ebcf943e341d7078333f18bf8cb (patch) | |
tree | 1e6abe2aa1bc7b39ee175de014b3d582b28d3cf2 /source/blender/compositor | |
parent | 1657fa039dcbf969b5e514ab77d72880817a7f9e (diff) |
Compositor: Fix constant folded operations not being rendered
Many operations do not expect single element buffers as output.
Use full buffers with a single pixel instead.
Diffstat (limited to 'source/blender/compositor')
-rw-r--r-- | source/blender/compositor/intern/COM_ConstantFolder.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/compositor/intern/COM_ConstantFolder.cc b/source/blender/compositor/intern/COM_ConstantFolder.cc index 8e25ef03aba..a9427013f87 100644 --- a/source/blender/compositor/intern/COM_ConstantFolder.cc +++ b/source/blender/compositor/intern/COM_ConstantFolder.cc @@ -92,13 +92,15 @@ static ConstantOperation *create_constant_operation(DataType data_type, const fl ConstantOperation *ConstantFolder::fold_operation(NodeOperation *operation) { const DataType data_type = operation->getOutputSocket()->getDataType(); - MemoryBuffer *fold_buf = create_constant_buffer(data_type); + MemoryBuffer fold_buf(data_type, first_elem_area_); Vector<MemoryBuffer *> input_bufs = get_constant_input_buffers(operation); - operation->render(fold_buf, {first_elem_area_}, input_bufs); + operation->render(&fold_buf, {first_elem_area_}, input_bufs); - ConstantOperation *constant_op = create_constant_operation(data_type, fold_buf->getBuffer()); + MemoryBuffer *constant_buf = create_constant_buffer(data_type); + constant_buf->copy_from(&fold_buf, first_elem_area_); + ConstantOperation *constant_op = create_constant_operation(data_type, constant_buf->getBuffer()); operations_builder_.replace_operation_with_constant(operation, constant_op); - constant_buffers_.add_new(constant_op, fold_buf); + constant_buffers_.add_new(constant_op, constant_buf); return constant_op; } |