Module: Mesa Branch: staging/20.2 Commit: 2e620304230e7b41519f9e178c9ddc249dc8c187 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2e620304230e7b41519f9e178c9ddc249dc8c187
Author: Jose Maria Casanova Crespo <[email protected]> Date: Fri Oct 2 00:55:07 2020 +0100 vc4: Avoid negative scissor caused by no intersection This fixes 6 tests that were crashing on VC4 since EGL_KHR_swap_buffers_with_damage was enabled. dEQP-EGL.functional.swap_buffers_with_damage.*.buffer_age_render Cc: 20.2 <mesa-stable> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6976> (cherry picked from commit 961a8d71cdc2c0b13dccfd644cca84a2b97912e4) --- .pick_status.json | 2 +- src/gallium/drivers/vc4/vc4_emit.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index f1c8cde17cf..07232a4efbb 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -175,7 +175,7 @@ "description": "vc4: Avoid negative scissor caused by no intersection", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/vc4/vc4_emit.c b/src/gallium/drivers/vc4/vc4_emit.c index b45ffb75aa9..73eca2caa50 100644 --- a/src/gallium/drivers/vc4/vc4_emit.c +++ b/src/gallium/drivers/vc4/vc4_emit.c @@ -50,13 +50,13 @@ vc4_emit_state(struct pipe_context *pctx) if (!vc4->rasterizer->base.scissor) { minx = MAX2(vp_minx, 0); miny = MAX2(vp_miny, 0); - maxx = MIN2(vp_maxx, job->draw_width); - maxy = MIN2(vp_maxy, job->draw_height); + maxx = MAX2(MIN2(vp_maxx, job->draw_width), minx); + maxy = MAX2(MIN2(vp_maxy, job->draw_height), miny); } else { minx = MAX2(vp_minx, vc4->scissor.minx); miny = MAX2(vp_miny, vc4->scissor.miny); - maxx = MIN2(vp_maxx, vc4->scissor.maxx); - maxy = MIN2(vp_maxy, vc4->scissor.maxy); + maxx = MAX2(MIN2(vp_maxx, vc4->scissor.maxx), minx); + maxy = MAX2(MIN2(vp_maxy, vc4->scissor.maxy), miny); } cl_emit(&job->bcl, CLIP_WINDOW, clip) { _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
