From a798cbe9ade6c3d59feebb0c2154b8c25f201030 Mon Sep 17 00:00:00 2001 From: eihrul Date: Sun, 20 Mar 2011 16:00:58 +0000 Subject: [PATCH] saturated bloom subtract git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10949 d7cf8633-e32d-0410-b094-e92efae38249 --- dpsoftrast.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.39.2