Fix memory alignment of outline spans.
Some CPU architectures require all memory accesses to be naturally aligned.
We read polygon outline spans in pairs, so we need two underflow spans.
b/37478805
Change-Id: If74fd59654fb6fa56cbed93122b496b9e86dda06
Reviewed-on: https://swiftshader-review.googlesource.com/9528
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
diff --git a/src/Renderer/Primitive.hpp b/src/Renderer/Primitive.hpp
index 872281d..9f19c4b 100644
--- a/src/Renderer/Primitive.hpp
+++ b/src/Renderer/Primitive.hpp
@@ -69,9 +69,11 @@
unsigned short right;
};
- Span outlineUnderflow;
+ // The rasterizer adds a zero length span to the top and bottom of the polygon to allow
+ // for 2x2 pixel processing. We need an even number of spans to keep accesses aligned.
+ Span outlineUnderflow[2];
Span outline[OUTLINE_RESOLUTION];
- Span outlineOverflow;
+ Span outlineOverflow[2];
};
}