Skip to content

Commit daf8480

Browse files
author
devsh
committed
1. stop it with the lambdas
2. std::move on return values is bad
1 parent 1913ae7 commit daf8480

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/nbl/ext/ImGui/ImGui.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,15 +1041,10 @@ bool UI::render(IGPUCommandBuffer* const commandBuffer, ISemaphore::SWaitInfo wa
10411041
return in * scale + translate;
10421042
}
10431043
};
1044-
const TRS trs = [&]()
1045-
{
1046-
TRS retV;
1047-
1048-
retV.scale = vector2df_SIMD{ 2.0f / drawData->DisplaySize.x , 2.0f / drawData->DisplaySize.y };
1049-
retV.translate = vector2df_SIMD { -1.0f, -1.0f } - vector2df_SIMD{ drawData->DisplayPos.x, drawData->DisplayPos.y } * trs.scale;
1050-
1051-
return std::move(retV);
1052-
}();
1044+
const TRS trs = {
1045+
.scale = vector2df_SIMD{ 2.0f / drawData->DisplaySize.x , 2.0f / drawData->DisplaySize.y },
1046+
.translate = vector2df_SIMD { -1.0f, -1.0f } - vector2df_SIMD{ drawData->DisplayPos.x, drawData->DisplayPos.y }*trs.scale,
1047+
};
10531048

10541049
// everything binds the buffer once at base and works via local offsets
10551050
const SBufferBinding<const IGPUBuffer> binding =

0 commit comments

Comments
 (0)