From 1f60446f3f4a05517149abe42a774c0a182fc22c Mon Sep 17 00:00:00 2001 From: rogerman Date: Wed, 5 Jul 2017 23:30:31 -0700 Subject: [PATCH] GPU: Fix bug on SSE2 builds where the window test mask would be undefined if the output color format is RGB666 or RGB888. --- desmume/src/GPU.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/desmume/src/GPU.cpp b/desmume/src/GPU.cpp index b5282da12..1793c6656 100644 --- a/desmume/src/GPU.cpp +++ b/desmume/src/GPU.cpp @@ -1859,6 +1859,10 @@ FORCEINLINE void GPUEngineBase::_RenderPixel16_SSE2(GPUEngineCompositorInfo &com passMask8 = _mm_and_si128(passMask8, didPassWindowTest); passMask16[0] = _mm_unpacklo_epi8(passMask8, passMask8); passMask16[1] = _mm_unpackhi_epi8(passMask8, passMask8); + passMask32[0] = _mm_unpacklo_epi16(passMask16[0], passMask16[0]); + passMask32[1] = _mm_unpackhi_epi16(passMask16[0], passMask16[0]); + passMask32[2] = _mm_unpacklo_epi16(passMask16[1], passMask16[1]); + passMask32[3] = _mm_unpackhi_epi16(passMask16[1], passMask16[1]); enableColorEffectMask = _mm_cmpeq_epi8( _mm_load_si128((__m128i *)(this->_enableColorEffectCustom[compInfo.renderState.selectedLayerID] + compInfo.target.xCustom)), _mm_set1_epi8(1) ); }