From c606edb578a5a98d7afe7c66dc340548c3d12add Mon Sep 17 00:00:00 2001 From: Tim Rowley Date: Mon, 22 May 2017 18:56:59 -0500 Subject: [PATCH] swr/rast: code cleanup (no functional change) Reviewed-by: Bruce Cherniak --- src/gallium/drivers/swr/rasterizer/core/binner.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/swr/rasterizer/core/binner.cpp b/src/gallium/drivers/swr/rasterizer/core/binner.cpp index b3fe4cfcdfe..daadd5f3d33 100644 --- a/src/gallium/drivers/swr/rasterizer/core/binner.cpp +++ b/src/gallium/drivers/swr/rasterizer/core/binner.cpp @@ -674,10 +674,14 @@ void BinTriangles( scisYmax = _simd_set1_epi32(state.scissorsInFixedPoint[0].ymax); } + // Make triangle bbox inclusive + bbox.xmax = _simd_sub_epi32(bbox.xmax, _simd_set1_epi32(1)); + bbox.ymax = _simd_sub_epi32(bbox.ymax, _simd_set1_epi32(1)); + bbox.xmin = _simd_max_epi32(bbox.xmin, scisXmin); bbox.ymin = _simd_max_epi32(bbox.ymin, scisYmin); - bbox.xmax = _simd_min_epi32(_simd_sub_epi32(bbox.xmax, _simd_set1_epi32(1)), scisXmax); - bbox.ymax = _simd_min_epi32(_simd_sub_epi32(bbox.ymax, _simd_set1_epi32(1)), scisYmax); + bbox.xmax = _simd_min_epi32(bbox.xmax, scisXmax); + bbox.ymax = _simd_min_epi32(bbox.ymax, scisYmax); if (CT::IsConservativeT::value) { -- 2.30.2