From f77a2494ada4b92574ad50425d2408bec752cd23 Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Sun, 30 Aug 2015 15:37:06 +0200 Subject: [PATCH] DrawTriangleSlice lambda: Capture parameters by reference, not copy, to avoid alignment issues. --- GPU/Software/Rasterizer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GPU/Software/Rasterizer.cpp b/GPU/Software/Rasterizer.cpp index 150402bc7d..111530db4d 100644 --- a/GPU/Software/Rasterizer.cpp +++ b/GPU/Software/Rasterizer.cpp @@ -1344,7 +1344,8 @@ void DrawTriangle(const VertexData& v0, const VertexData& v1, const VertexData& if (gstate.isModeClear()) { if (range >= 24 && (maxX - minX) >= 24 * 16) { - auto bound = [=](int a, int b) -> void {DrawTriangleSlice(v0, v1, v2, minX, minY, maxX, maxY, a, b); }; + VertexData v[3] = { v0, v1, v2 }; + auto bound = [&](int a, int b) -> void {DrawTriangleSlice(v0, v1, v2, minX, minY, maxX, maxY, a, b); }; GlobalThreadPool::Loop(bound, 0, range); } else @@ -1354,7 +1355,7 @@ void DrawTriangle(const VertexData& v0, const VertexData& v1, const VertexData& } else { if (range >= 24 && (maxX - minX) >= 24 * 16) { - auto bound = [=](int a, int b) -> void {DrawTriangleSlice(v0, v1, v2, minX, minY, maxX, maxY, a, b); }; + auto bound = [&](int a, int b) -> void {DrawTriangleSlice(v0, v1, v2, minX, minY, maxX, maxY, a, b); }; GlobalThreadPool::Loop(bound, 0, range); } else