zink: add another helper for checking whether one rect covers another
this is going to be used for no-oping writes Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9206>
This commit is contained in:
parent
72653ade81
commit
f6cf5a64cc
|
@ -278,3 +278,15 @@ zink_blit_region_fills(struct u_rect region, unsigned width, unsigned height)
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
zink_blit_region_covers(struct u_rect region, struct u_rect covers)
|
||||||
|
{
|
||||||
|
struct u_rect intersect;
|
||||||
|
if (!u_rect_test_intersection(®ion, &covers))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
u_rect_union(&intersect, ®ion, &covers);
|
||||||
|
return intersect.x0 == covers.x0 && intersect.y0 == covers.y0 &&
|
||||||
|
intersect.x1 == covers.x1 && intersect.y1 == covers.y1;
|
||||||
|
}
|
||||||
|
|
|
@ -284,6 +284,9 @@ zink_blit(struct pipe_context *pctx,
|
||||||
bool
|
bool
|
||||||
zink_blit_region_fills(struct u_rect region, unsigned width, unsigned height);
|
zink_blit_region_fills(struct u_rect region, unsigned width, unsigned height);
|
||||||
|
|
||||||
|
bool
|
||||||
|
zink_blit_region_covers(struct u_rect region, struct u_rect covers);
|
||||||
|
|
||||||
static inline struct u_rect
|
static inline struct u_rect
|
||||||
zink_rect_from_box(const struct pipe_box *box)
|
zink_rect_from_box(const struct pipe_box *box)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue