From a5608c67b55d4fad2e48526520fac0c509000868 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Fri, 31 May 2019 05:42:04 +0200 Subject: [PATCH] - upload using all threads --- .../polyrenderer/backend/poly_framebuffer.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/rendering/polyrenderer/backend/poly_framebuffer.cpp b/src/rendering/polyrenderer/backend/poly_framebuffer.cpp index 3d8b75bd8..37e658d9f 100644 --- a/src/rendering/polyrenderer/backend/poly_framebuffer.cpp +++ b/src/rendering/polyrenderer/backend/poly_framebuffer.cpp @@ -147,10 +147,6 @@ void PolyFrameBuffer::Update() Flush3D.Unclock(); FlushDrawCommands(); - DrawerThreads::WaitForWorkers(); - mFrameMemory.Clear(); - FrameDeleteList.Buffers.clear(); - FrameDeleteList.Images.clear(); if (mCanvas) { @@ -162,14 +158,27 @@ void PolyFrameBuffer::Update() uint8_t *dst = I_PolyPresentLock(w, h, pitch); if (dst) { +#if 1 + auto copyqueue = std::make_shared(&mFrameMemory); + copyqueue->Push(dst, pitch / pixelsize, src, w, h, w, pixelsize); + DrawerThreads::Execute(copyqueue); +#else for (int y = 0; y < h; y++) { memcpy(dst + y * pitch, src + y * w * pixelsize, w * pixelsize); } +#endif + + DrawerThreads::WaitForWorkers(); I_PolyPresentUnlock(mOutputLetterbox.left, mOutputLetterbox.top, mOutputLetterbox.width, mOutputLetterbox.height); } } + DrawerThreads::WaitForWorkers(); + mFrameMemory.Clear(); + FrameDeleteList.Buffers.clear(); + FrameDeleteList.Images.clear(); + CheckCanvas(); Super::Update();