zink: drop nop descriptor-updates
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 29 Oct 2019 13:12:02 +0000 (14:12 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 30 Oct 2019 10:29:23 +0000 (10:29 +0000)
If there's nothing to be done, let's actually do nothing. Seems like a
good idea.

Reviewed-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/zink/zink_context.c

index b97cc16455d195a4140af93ed14fc153bf5c09a4..9219d019811559ffb726e05cd9d94394ececc235 100644 (file)
@@ -1174,10 +1174,11 @@ zink_draw_vbo(struct pipe_context *pctx,
    if (ctx->gfx_pipeline_state.blend_state->need_blend_constants)
       vkCmdSetBlendConstants(batch->cmdbuf, ctx->blend_constants);
 
-   for (int i = 0; i < num_wds; ++i)
-      wds[i].dstSet = desc_set;
-
-   vkUpdateDescriptorSets(screen->dev, num_wds, wds, 0, NULL);
+   if (num_wds > 0) {
+      for (int i = 0; i < num_wds; ++i)
+         wds[i].dstSet = desc_set;
+      vkUpdateDescriptorSets(screen->dev, num_wds, wds, 0, NULL);
+   }
 
    vkCmdBindPipeline(batch->cmdbuf, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
    vkCmdBindDescriptorSets(batch->cmdbuf, VK_PIPELINE_BIND_POINT_GRAPHICS,