turnip: Fix crashes in compute with no descriptors to load.
authorEric Anholt <eric@anholt.net>
Tue, 9 Jun 2020 18:03:12 +0000 (11:03 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 9 Jun 2020 18:28:17 +0000 (18:28 +0000)
Found when trying to rebase cheza VK CI on top of this change.

Fixes: 334204823eee ("tu: Fix context faults loading unused descriptor sets")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5266>

src/freedreno/vulkan/tu_cmd_buffer.c

index 02cae98e3e96ae8060d5b0f082cedb16a9ed9c57..af0eca07096c7b273aee86449ebe5ce5237c7b72 100644 (file)
@@ -3906,8 +3906,10 @@ tu_dispatch(struct tu_cmd_buffer *cmd,
    if (ib.size)
       tu_cs_emit_ib(cs, &ib);
 
-   if (cmd->state.dirty & TU_CMD_DIRTY_COMPUTE_DESCRIPTOR_SETS)
+   if ((cmd->state.dirty & TU_CMD_DIRTY_COMPUTE_DESCRIPTOR_SETS) &&
+       pipeline->load_state.state_ib.size > 0) {
       tu_cs_emit_ib(cs, &pipeline->load_state.state_ib);
+   }
 
    cmd->state.dirty &=
       ~(TU_CMD_DIRTY_COMPUTE_DESCRIPTOR_SETS | TU_CMD_DIRTY_COMPUTE_PIPELINE);