diff --git a/src/gallium/drivers/zink/zink_blit.c b/src/gallium/drivers/zink/zink_blit.c index 20fa51987d8..82dc303d246 100644 --- a/src/gallium/drivers/zink/zink_blit.c +++ b/src/gallium/drivers/zink/zink_blit.c @@ -278,3 +278,15 @@ zink_blit_region_fills(struct u_rect region, unsigned width, unsigned height) 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; +} diff --git a/src/gallium/drivers/zink/zink_context.h b/src/gallium/drivers/zink/zink_context.h index 347e613e171..13943f1afa6 100644 --- a/src/gallium/drivers/zink/zink_context.h +++ b/src/gallium/drivers/zink/zink_context.h @@ -284,6 +284,9 @@ zink_blit(struct pipe_context *pctx, bool 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 zink_rect_from_box(const struct pipe_box *box) {