iris: maybe-flush before blorp operations
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 26 Jun 2018 14:31:56 +0000 (07:31 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:07 +0000 (10:26 -0800)
otherwise if we have a lot of back-to-back blorp operations we can
potentially overflow even the chained batch

src/gallium/drivers/iris/iris_blit.c
src/gallium/drivers/iris/iris_clear.c

index 79d98792f931b7f2bbc72ad69967e90416d5daf4..da23a9d524c0ea576756188ff852541721c70b05 100644 (file)
@@ -99,8 +99,12 @@ iris_blit(struct pipe_context *ctx, const struct pipe_blit_info *info)
    GLenum filter =
       info->filter == PIPE_TEX_FILTER_LINEAR ? GL_LINEAR : GL_NEAREST;
 
+   struct iris_batch *batch = &ice->render_batch;
+
+   iris_batch_maybe_flush(batch, 1500);
+
    struct blorp_batch blorp_batch;
-   blorp_batch_init(&ice->blorp, &blorp_batch, &ice->render_batch, 0);
+   blorp_batch_init(&ice->blorp, &blorp_batch, batch, 0);
    blorp_blit(&blorp_batch, &src_surf, info->src.level, src_layer,
               src_isl_format, src_isl_swizzle,
               &dst_surf, info->dst.level, dst_layer,
@@ -130,8 +134,12 @@ iris_resource_copy_region(struct pipe_context *ctx,
    unsigned dst_layer = dstz;
    unsigned src_layer = src_box->z;
 
+   struct iris_batch *batch = &ice->render_batch;
+
+   iris_batch_maybe_flush(batch, 1500);
+
    struct blorp_batch blorp_batch;
-   blorp_batch_init(&ice->blorp, &blorp_batch, &ice->render_batch, 0);
+   blorp_batch_init(&ice->blorp, &blorp_batch, batch, 0);
    blorp_copy(&blorp_batch, &src_surf, src_level, src_layer,
               &dst_surf, dst_level, dst_layer,
               src_box->x, src_box->y, dstx, dsty,
index 08453789078613cb55d793cdd99d289f0dd8d3a2..01f6459051bd2ce3b04122df6fcb8551370d70c8 100644 (file)
@@ -45,8 +45,12 @@ iris_clear(struct pipe_context *ctx,
    struct iris_context *ice = (void *) ctx;
    assert(buffers != 0);
 
+   struct iris_batch *batch = &ice->render_batch;
+
+   iris_batch_maybe_flush(batch, 1500);
+
    struct blorp_batch blorp_batch;
-   blorp_batch_init(&ice->blorp, &blorp_batch, &ice->render_batch, 0);
+   blorp_batch_init(&ice->blorp, &blorp_batch, batch, 0);
 
    if (buffers & PIPE_CLEAR_DEPTHSTENCIL) {
       fprintf(stderr, "XXX: depth/stencil clears not implemented\n");