Commit 5287422f authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

Add unroll hint to inner loop in WindowQuads::makeInterleavedArrays

The inner loop here has a fixed size and unrolling it allows better
vectorization. Both GCC and clang recognise the `#pragma GCC unroll`
directive.
parent a95b5568
......@@ -1053,6 +1053,7 @@ void WindowQuadList::makeInterleavedArrays(unsigned int type, GLVertex2D *vertic
switch (type) {
case GL_QUADS: {
for (const WindowQuad &quad : *this) {
#pragma GCC unroll 4
for (int j = 0; j < 4; j++) {
const WindowVertex &wv = quad[j];
......@@ -1068,6 +1069,7 @@ void WindowQuadList::makeInterleavedArrays(unsigned int type, GLVertex2D *vertic
for (const WindowQuad &quad : *this) {
GLVertex2D v[4]; // Four unique vertices / quad
#pragma GCC unroll 4
for (int j = 0; j < 4; j++) {
const WindowVertex &wv = quad[j];
......
Supports Markdown
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