From: Jason Ekstrand Date: Wed, 15 Jun 2016 21:30:33 +0000 (-0700) Subject: anv/cmd_buffer: Don't crash if push constants are provided for missing stages X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b65f2e4163c9180e6a022c0afec018b08e4c5aa5;p=mesa.git anv/cmd_buffer: Don't crash if push constants are provided for missing stages Signed-off-by: Jason Ekstrand Reviewed-by: Kenneth Graunke Cc: "12.0" --- diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c index 5be5f3e5ee3..24c18fec4ec 100644 --- a/src/intel/vulkan/anv_cmd_buffer.c +++ b/src/intel/vulkan/anv_cmd_buffer.c @@ -1038,7 +1038,7 @@ anv_cmd_buffer_push_constants(struct anv_cmd_buffer *cmd_buffer, cmd_buffer->state.pipeline->prog_data[stage]; /* If we don't actually have any push constants, bail. */ - if (data == NULL || prog_data->nr_params == 0) + if (data == NULL || prog_data == NULL || prog_data->nr_params == 0) return (struct anv_state) { .offset = 0 }; struct anv_state state =