zink: clamp scissors
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Fri, 21 Jun 2019 13:37:42 +0000 (15:37 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 28 Oct 2019 08:51:45 +0000 (08:51 +0000)
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
src/gallium/drivers/zink/zink_context.c

index 81a28288f3bafd28afff6fc1f187d1b758d921b0..8ea635363ec409b683140d5be1122bb64b3c88a0 100644 (file)
@@ -763,6 +763,10 @@ zink_clear(struct pipe_context *pctx,
    if (ctx->num_scissors) {
       for (unsigned i = 0 ; i < ctx->num_scissors; ++i) {
          rects[i].rect = ctx->scissors[i];
+         rects[i].rect.extent.width = MIN2(rects[i].rect.extent.width,
+                                           fb->width);
+         rects[i].rect.extent.height = MIN2(rects[i].rect.extent.height,
+                                            fb->height);
          rects[i].baseArrayLayer = 0;
          rects[i].layerCount = num_layers;
       }