aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno
diff options
context:
space:
mode:
authorHyunjun Ko <[email protected]>2020-04-23 02:28:34 +0000
committerMarge Bot <[email protected]>2020-04-23 05:19:04 +0000
commit227df2a2badf0047a3e6e2c1d196aa1b26427b10 (patch)
treeaf2bc3dc3a1ee423e8a8800aa85860217518dfed /src/freedreno
parent85f84ea148474554af42ca513b9cb7c43a78a738 (diff)
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 <[email protected]> Reviewed-by: Jonathan Marek <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4693>
Diffstat (limited to 'src/freedreno')
-rw-r--r--src/freedreno/vulkan/tu_pipeline.c2
1 files changed, 2 insertions, 0 deletions
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);