summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/virgl')
-rw-r--r--src/gallium/drivers/virgl/virgl_context.c8
-rw-r--r--src/gallium/drivers/virgl/virgl_context.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/virgl/virgl_context.c b/src/gallium/drivers/virgl/virgl_context.c
index 69b56bfd036..b3119ee95cc 100644
--- a/src/gallium/drivers/virgl/virgl_context.c
+++ b/src/gallium/drivers/virgl/virgl_context.c
@@ -756,6 +756,12 @@ static void virgl_flush_eq(struct virgl_context *ctx, void *closure,
{
struct virgl_screen *rs = virgl_screen(ctx->base.screen);
+ /* skip empty cbuf */
+ if (ctx->cbuf->cdw == ctx->cbuf_initial_cdw &&
+ ctx->queue.num_dwords == 0 &&
+ !fence)
+ return;
+
if (ctx->num_draws)
u_upload_unmap(ctx->uploader);
@@ -773,6 +779,8 @@ static void virgl_flush_eq(struct virgl_context *ctx, void *closure,
/* add back current framebuffer resources to reference list? */
virgl_reemit_res(ctx);
+
+ ctx->cbuf_initial_cdw = ctx->cbuf->cdw;
}
static void virgl_flush_from_st(struct pipe_context *ctx,
diff --git a/src/gallium/drivers/virgl/virgl_context.h b/src/gallium/drivers/virgl/virgl_context.h
index 1ac4ddb0541..828e72514a4 100644
--- a/src/gallium/drivers/virgl/virgl_context.h
+++ b/src/gallium/drivers/virgl/virgl_context.h
@@ -59,6 +59,7 @@ struct virgl_rasterizer_state {
struct virgl_context {
struct pipe_context base;
struct virgl_cmd_buf *cbuf;
+ unsigned cbuf_initial_cdw;
struct virgl_textures_info samplers[PIPE_SHADER_TYPES];
struct virgl_vertex_elements_state *vertex_elements;