aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2019-05-02 15:08:42 +0100
committerLionel Landwerlin <[email protected]>2019-05-03 10:21:40 +0100
commit80dc78407d0d1e03ceddf8889b217e8fd113568d (patch)
tree6d2b91be3ea5ad7287a3d35e8c964aff3242c4c1
parente68d7bec677f61645dc41226df5cfa9b56b01b56 (diff)
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 <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Cc: [email protected]
-rw-r--r--src/intel/vulkan/anv_cmd_buffer.c2
1 files changed, 1 insertions, 1 deletions
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 =