llvmpipe: avoid left-shifting a negative number.
authorMaya Rashish <coypu@sdf.org>
Tue, 3 Sep 2019 10:04:15 +0000 (13:04 +0300)
committerMatt Turner <mattst88@gmail.com>
Wed, 9 Oct 2019 20:20:40 +0000 (20:20 +0000)
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Maya Rashish <coypu@sdf.org>
src/gallium/drivers/llvmpipe/lp_setup_line.c
src/gallium/drivers/llvmpipe/lp_setup_point.c
src/gallium/drivers/llvmpipe/lp_setup_tri.c

index c1d8237a8acab9cbfb246e349163a7d94220116e..5e26b1e9ffc08a8eca2e3b297d6428c7829f019f 100644 (file)
@@ -724,7 +724,7 @@ try_setup_line( struct lp_setup_context *setup,
       struct lp_rast_plane *plane_s = &plane[4];
 
       if (s_planes[0]) {
-         plane_s->dcdx = -1 << 8;
+         plane_s->dcdx = ~0U << 8;
          plane_s->dcdy = 0;
          plane_s->c = (1-scissor->x0) << 8;
          plane_s->eo = 1 << 8;
@@ -746,7 +746,7 @@ try_setup_line( struct lp_setup_context *setup,
       }
       if (s_planes[3]) {
          plane_s->dcdx = 0;
-         plane_s->dcdy = -1 << 8;
+         plane_s->dcdy = ~0U << 8;
          plane_s->c = (scissor->y1+1) << 8;
          plane_s->eo = 0;
          plane_s++;
index fc1d5ef6e36fa7489b018d4fe38613406158b71e..0c4b1b758f921568dcdf0e8c7c37376849d7e14c 100644 (file)
@@ -491,7 +491,7 @@ try_setup_point( struct lp_setup_context *setup,
    {
       struct lp_rast_plane *plane = GET_PLANES(point);
 
-      plane[0].dcdx = -1 << 8;
+      plane[0].dcdx = ~0U << 8;
       plane[0].dcdy = 0;
       plane[0].c = (1-bbox.x0) << 8;
       plane[0].eo = 1 << 8;
@@ -507,7 +507,7 @@ try_setup_point( struct lp_setup_context *setup,
       plane[2].eo = 1 << 8;
 
       plane[3].dcdx = 0;
-      plane[3].dcdy = -1 << 8;
+      plane[3].dcdy = ~0U << 8;
       plane[3].c = (bbox.y1+1) << 8;
       plane[3].eo = 0;
    }
index 1852ec05d563f8fbc868a729d4205ee7c0c172a8..0fa3443d51958f991b12dafce118364bcddd014e 100644 (file)
@@ -687,7 +687,7 @@ do_triangle_ccw(struct lp_setup_context *setup,
       struct lp_rast_plane *plane_s = &plane[3];
 
       if (s_planes[0]) {
-         plane_s->dcdx = -1 << 8;
+         plane_s->dcdx = ~0U << 8;
          plane_s->dcdy = 0;
          plane_s->c = (1-scissor->x0) << 8;
          plane_s->eo = 1 << 8;
@@ -709,7 +709,7 @@ do_triangle_ccw(struct lp_setup_context *setup,
       }
       if (s_planes[3]) {
          plane_s->dcdx = 0;
-         plane_s->dcdy = -1 << 8;
+         plane_s->dcdy = ~0U << 8;
          plane_s->c = (scissor->y1+1) << 8;
          plane_s->eo = 0;
          plane_s++;