From 35d3b6316b21ad9ae7eb96a7a541c4051eae3441 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Mon, 19 Jan 2015 18:13:26 +0100 Subject: D627: Memory usage optimization for the compositor. The compostor used a fixed size of 4 floats to hold pixel data. this patch will select size of a pixel based on its type. It uses 1 float for Value, 3 float for vector and 4 floats for color data types. When benchmarking on shots (opening shot of caminandes) we get a reduction of memory of 30% and a tiny speedup as less data transformations needs to take place (but these are negligable. More information of the patch can be found on https://developer.blender.org/D627 and http://wiki.blender.org/index.php/Dev:Ref/Proposals/Compositor2014_p1.1_TD Developers: jbakker & mdewanchand Thanks for Sergey for his indept review. --- source/blender/compositor/operations/COM_MapUVOperation.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/compositor/operations/COM_MapUVOperation.cpp') diff --git a/source/blender/compositor/operations/COM_MapUVOperation.cpp b/source/blender/compositor/operations/COM_MapUVOperation.cpp index 6bf730253e7..bb8fe825c68 100644 --- a/source/blender/compositor/operations/COM_MapUVOperation.cpp +++ b/source/blender/compositor/operations/COM_MapUVOperation.cpp @@ -83,11 +83,11 @@ bool MapUVOperation::read_uv(float x, float y, float &r_u, float &r_v, float &r_ return false; } else { - float col[4]; - m_inputUVProgram->readSampled(col, x, y, COM_PS_BILINEAR); - r_u = col[0] * m_inputColorProgram->getWidth(); - r_v = col[1] * m_inputColorProgram->getHeight(); - r_alpha = col[2]; + float vector[3]; + m_inputUVProgram->readSampled(vector, x, y, COM_PS_BILINEAR); + r_u = vector[0] * m_inputColorProgram->getWidth(); + r_v = vector[1] * m_inputColorProgram->getHeight(); + r_alpha = vector[2]; return true; } } -- cgit v1.2.3