From: eihrul Date: Sun, 20 Mar 2011 16:00:58 +0000 (+0000) Subject: saturated bloom subtract X-Git-Tag: xonotic-v0.6.0~163^2~597 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a798cbe9ade6c3d59feebb0c2154b8c25f201030;p=xonotic%2Fdarkplaces.git saturated bloom subtract git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10949 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/dpsoftrast.c b/dpsoftrast.c index 5d173cbb..969b88d1 100644 --- a/dpsoftrast.c +++ b/dpsoftrast.c @@ -2998,14 +2998,14 @@ void DPSOFTRAST_Draw_Span_AddBloomBGRA8(const DPSOFTRAST_State_Triangle * RESTRI { __m128i pix1 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)&ina4ub[x*4]), _mm_setzero_si128()); __m128i pix2 = _mm_unpacklo_epi8(_mm_loadl_epi64((const __m128i *)&inb4ub[x*4]), _mm_setzero_si128()); - pix1 = _mm_add_epi16(pix1, _mm_sub_epi16(pix2, localcolor)); + pix1 = _mm_add_epi16(pix1, _mm_subs_epu16(pix2, localcolor)); _mm_storel_epi64((__m128i *)&out4ub[x*4], _mm_packus_epi16(pix1, pix1)); } if (x < endx) { __m128i pix1 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(*(const int *)&ina4ub[x*4]), _mm_setzero_si128()); __m128i pix2 = _mm_unpacklo_epi8(_mm_cvtsi32_si128(*(const int *)&inb4ub[x*4]), _mm_setzero_si128()); - pix1 = _mm_add_epi16(pix1, _mm_sub_epi16(pix2, localcolor)); + pix1 = _mm_add_epi16(pix1, _mm_subs_epu16(pix2, localcolor)); *(int *)&out4ub[x*4] = _mm_cvtsi128_si32(_mm_packus_epi16(pix1, pix1)); } #endif