From 80dc78407d0d1e03ceddf8889b217e8fd113568d Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Thu, 2 May 2019 15:08:42 +0100 Subject: anv: fix crash when application does not provide push constants Found while running Talos Principle. As far as I can tell running a draw call with a pipeline having push constants without the application having called vkCmdPushConstants gives undefined push constant values. Signed-off-by: Lionel Landwerlin Reviewed-by: Jason Ekstrand Cc: mesa-stable@lists.freedesktop.org --- src/intel/vulkan/anv_cmd_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c index 981c071fc23..348764c61f5 100644 --- a/src/intel/vulkan/anv_cmd_buffer.c +++ b/src/intel/vulkan/anv_cmd_buffer.c @@ -797,7 +797,7 @@ anv_cmd_buffer_push_constants(struct anv_cmd_buffer *cmd_buffer, pipeline->shaders[stage]->prog_data; /* If we don't actually have any push constants, bail. */ - if (prog_data == NULL || prog_data->nr_params == 0) + if (prog_data == NULL || prog_data->nr_params == 0 || data == NULL) return (struct anv_state) { .offset = 0 }; struct anv_state state = -- cgit v1.2.3