Skip to content

Commit

Permalink
SoftRasterizer: Oops! Fix a performance regression in SoftRasterizerR…
Browse files Browse the repository at this point in the history
…enderer_SSE2::ClearUsingValues() where the framebuffer was accidentally being cleared twice. (Regression from commit 7509d46.)
  • Loading branch information
rogerman committed Feb 12, 2018
1 parent 7509d46 commit ab18de0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions desmume/src/rasterize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
Expand Down

0 comments on commit ab18de0

Please sign in to comment.