From 2ddc8a30e05236a8b36a3ef0f93701baaa5acc79 Mon Sep 17 00:00:00 2001 From: Ian Curtis Date: Sun, 20 Nov 2016 17:02:59 +0000 Subject: [PATCH] Clear queued texture uploads after processing them. Saves re-uploading the same textures whilst paused --- Src/Model3/Real3D.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Src/Model3/Real3D.cpp b/Src/Model3/Real3D.cpp index 3f11283..4034a23 100644 --- a/Src/Model3/Real3D.cpp +++ b/Src/Model3/Real3D.cpp @@ -232,8 +232,12 @@ void CReal3D::BeginFrame(void) // If multi-threaded, perform now any queued texture uploads to renderer before rendering begins if (g_Config.gpuMultiThreaded) { - for (vector::iterator it = queuedUploadTexturesRO.begin(), end = queuedUploadTexturesRO.end(); it != end; it++) - Render3D->UploadTextures(it->x, it->y, it->width, it->height); + for (const auto &it : queuedUploadTexturesRO) { + Render3D->UploadTextures(it.x, it.y, it.width, it.height); + } + + // done syncing data + queuedUploadTexturesRO.clear(); } Render3D->BeginFrame();