From e9e05ecf6ca498cfbc19bcab7dec85315afcedd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 7 Mar 2023 12:07:13 +0100 Subject: [PATCH] Shaders: use same index order as MeshTools::compileLines() has. To avoid pointless differences and impossible-to-reproduce bugs. --- src/Magnum/Shaders/Test/LineGLTest.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Magnum/Shaders/Test/LineGLTest.cpp b/src/Magnum/Shaders/Test/LineGLTest.cpp index 9ff55ceb0..0ee4163d8 100644 --- a/src/Magnum/Shaders/Test/LineGLTest.cpp +++ b/src/Magnum/Shaders/Test/LineGLTest.cpp @@ -1013,6 +1013,8 @@ template Containers::Array> generateL return vertices; } +/* Order consistent with what MeshTools::compileLines() does to avoid pointless + differences */ Containers::Array generateLineMeshIndices(Containers::StridedArrayView1D vertexAnnotations) { Containers::Array indices; for(UnsignedInt i = 0; i != vertexAnnotations.size()/4; ++i) { @@ -1022,12 +1024,12 @@ Containers::Array generateLineMeshIndices(Containers::StridedArrayV |/ / | 1 1---3 */ arrayAppend(indices, { + i*4 + 2, i*4 + 0, i*4 + 1, - i*4 + 2, - i*4 + 2, i*4 + 1, - i*4 + 3 + i*4 + 3, + i*4 + 2 }); /* Add also indices for the bevel in both orientations (one will always