From 227df2a2badf0047a3e6e2c1d196aa1b26427b10 Mon Sep 17 00:00:00 2001 From: Hyunjun Ko Date: Thu, 23 Apr 2020 02:28:34 +0000 Subject: [PATCH] turnip: Fix crashes when geometry shader constants aren't used Fixes dEQP-VK.transform_feedback.fuzz.2_level_array.float.geometry, for example. Signed-off-by: Hyunjun Ko Reviewed-by: Jonathan Marek Part-of: --- src/freedreno/vulkan/tu_pipeline.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c index b2d5b69393c..e3ac144603a 100644 --- a/src/freedreno/vulkan/tu_pipeline.c +++ b/src/freedreno/vulkan/tu_pipeline.c @@ -897,6 +897,8 @@ tu6_emit_link_map(struct tu_cs *cs, int size = DIV_ROUND_UP(num_loc, 4); size = (MIN2(size + base, consumer->constlen) - base) * 4; + if (size <= 0) + return; tu6_emit_const(cs, CP_LOAD_STATE6_GEOM, base, SB6_GS_SHADER, 0, size, patch_locs); -- 2.30.2