diff options
author | Roland Scheidegger <[email protected]> | 2016-02-03 00:36:15 +0100 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2016-02-03 01:25:45 +0100 |
commit | 848a023c053b312ba5e76a124d7088bbf0b69df0 (patch) | |
tree | 934e0a1c7447855a367553bad61b78273d99eb6e /src/gallium/drivers/llvmpipe/lp_setup_context.h | |
parent | 141ef75569aa9ffe392f19d7a375bbadebfd08be (diff) |
llvmpipe: use scissor_planes_needed helper function
So it doesn't get out of sync in multiple places.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_setup_context.h')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup_context.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_context.h b/src/gallium/drivers/llvmpipe/lp_setup_context.h index 03bb8ce2b6f..5ab297d7e1a 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_context.h +++ b/src/gallium/drivers/llvmpipe/lp_setup_context.h @@ -168,6 +168,21 @@ struct lp_setup_context const float (*v2)[4]); }; +static inline void +scissor_planes_needed(boolean scis_planes[4], struct u_rect *bbox, + struct u_rect *scissor) +{ + /* left */ + scis_planes[0] = (bbox->x0 < scissor->x0); + /* right */ + scis_planes[1] = (bbox->x1 > scissor->x1); + /* top */ + scis_planes[2] = (bbox->y0 < scissor->y0); + /* bottom */ + scis_planes[3] = (bbox->y1 > scissor->y1); +} + + void lp_setup_choose_triangle( struct lp_setup_context *setup ); void lp_setup_choose_line( struct lp_setup_context *setup ); void lp_setup_choose_point( struct lp_setup_context *setup ); |