From: Eric Anholt Date: Tue, 9 Jun 2020 18:03:12 +0000 (-0700) Subject: turnip: Fix crashes in compute with no descriptors to load. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=58dd904c592850a4886c02e65b56e87641d2ecbf;p=mesa.git turnip: Fix crashes in compute with no descriptors to load. 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: --- diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index 02cae98e3e9..af0eca07096 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -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);