]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
saturated bloom subtract
authoreihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 20 Mar 2011 16:00:58 +0000 (16:00 +0000)
committereihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 20 Mar 2011 16:00:58 +0000 (16:00 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10949 d7cf8633-e32d-0410-b094-e92efae38249

dpsoftrast.c

index 5d173cbb6c2fe423f956103095be17d3c5b754f8..969b88d144b21d532d577bf1fc6803e4284ec9b3 100644 (file)
@@ -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