From ab18de05efdcaecf80665e49fe2762411e925b39 Mon Sep 17 00:00:00 2001 From: rogerman Date: Mon, 12 Feb 2018 13:42:42 -0800 Subject: [PATCH] SoftRasterizer: Oops! Fix a performance regression in SoftRasterizerRenderer_SSE2::ClearUsingValues() where the framebuffer was accidentally being cleared twice. (Regression from commit 7509d46.) --- desmume/src/rasterize.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/desmume/src/rasterize.cpp b/desmume/src/rasterize.cpp index 8bda77eec..23d1d92aa 100644 --- a/desmume/src/rasterize.cpp +++ b/desmume/src/rasterize.cpp @@ -2384,7 +2384,6 @@ Render3DError SoftRasterizerRenderer_SSE2::ClearUsingValues(const FragmentColor this->_clearAttrIsFogged_v128u8 = _mm_set1_epi8(clearAttributes.isFogged); this->_clearAttrIsTranslucentPoly_v128u8 = _mm_set1_epi8(clearAttributes.isTranslucentPoly); - size_t i = 0; const bool doMultithreadedClear = (this->_threadCount > 0); if (doMultithreadedClear) @@ -2397,13 +2396,12 @@ Render3DError SoftRasterizerRenderer_SSE2::ClearUsingValues(const FragmentColor else { this->ClearUsingValuesLoop(0, this->_framebufferSIMDPixCount); - i = this->_framebufferSIMDPixCount; } #ifdef ENABLE_SSE2 #pragma LOOPVECTORIZE_DISABLE #endif - for (; i < this->_framebufferPixCount; i++) + for (size_t i = this->_framebufferSIMDPixCount; i < this->_framebufferPixCount; i++) { this->_framebufferColor[i] = clearColor6665; this->_framebufferAttributes->SetAtIndex(i, clearAttributes);