From bdf02ea67ca64380fdaf790207a7a943698d872d Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Tue, 11 Apr 2017 01:11:30 +0200 Subject: [PATCH] - move masked reads --- src/polyrenderer/drawers/poly_drawer32_sse2.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/polyrenderer/drawers/poly_drawer32_sse2.h b/src/polyrenderer/drawers/poly_drawer32_sse2.h index 407054337..5125c93c7 100644 --- a/src/polyrenderer/drawers/poly_drawer32_sse2.h +++ b/src/polyrenderer/drawers/poly_drawer32_sse2.h @@ -505,12 +505,13 @@ private: { // Load bgcolor uint32_t desttmp[2]; - if (mask0 & (1 << 31)) desttmp[0] = dest[x * 2]; - if (mask0 & (1 << 30)) desttmp[1] = dest[x * 2 + 1]; - __m128i bgcolor; if (BlendT::Mode != (int)BlendModes::Opaque) + { + if (mask0 & (1 << 31)) desttmp[0] = dest[x * 2]; + if (mask0 & (1 << 30)) desttmp[1] = dest[x * 2 + 1]; bgcolor = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i*)desttmp), _mm_setzero_si128()); + } else bgcolor = _mm_setzero_si128(); @@ -593,12 +594,13 @@ private: { // Load bgcolor uint32_t desttmp[2]; - if (mask1 & (1 << 31)) desttmp[0] = dest[x * 2]; - if (mask1 & (1 << 30)) desttmp[1] = dest[x * 2 + 1]; - __m128i bgcolor; if (BlendT::Mode != (int)BlendModes::Opaque) + { + if (mask1 & (1 << 31)) desttmp[0] = dest[x * 2]; + if (mask1 & (1 << 30)) desttmp[1] = dest[x * 2 + 1]; bgcolor = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i*)desttmp), _mm_setzero_si128()); + } else bgcolor = _mm_setzero_si128();