Commit 97b07694 authored by Sven Langkamp's avatar Sven Langkamp

make sure that we always use a multiple of the register width for the buffer size

parent 7d4b91b5
......@@ -171,11 +171,18 @@ struct SIMDMaskProcessor
int width = rect.width();
float *buffer = Vc::malloc<float, Vc::AlignOnVector>(width);
// We need to calculate with a multiple of the width of the simd register
int alignOffset = 0;
if (width % Vc::float_v::Size != 0) {
alignOffset = Vc::float_v::Size - (width % Vc::float_v::Size);
}
int simdWidth = width + alignOffset;
float *buffer = Vc::malloc<float, Vc::AlignOnVector>(simdWidth);
for (int y = rect.y(); y < rect.y() + rect.height(); y++) {
m_shape->processRowFast(buffer, width, y, m_cosa, m_sina, m_centerX, m_centerY, m_invScaleX, m_invScaleY);
m_shape->processRowFast(buffer, simdWidth, y, m_cosa, m_sina, m_centerX, m_centerY, m_invScaleX, m_invScaleY);
if (m_randomness != 0.0 || m_density != 1.0) {
for (int x = 0; x < width; x++) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment