From 03772df45016010e19fbd89564d587e0eef25e61 Mon Sep 17 00:00:00 2001 From: Jonathan Marek Date: Mon, 14 Oct 2019 11:16:02 -0400 Subject: [PATCH] turnip: fix 32 vertex attributes case Signed-off-by: Jonathan Marek Reviewed-by: Kristian H. Kristensen --- src/freedreno/vulkan/tu_pipeline.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c index 0e6463e2abc..29f394c82f0 100644 --- a/src/freedreno/vulkan/tu_pipeline.c +++ b/src/freedreno/vulkan/tu_pipeline.c @@ -989,9 +989,7 @@ tu6_emit_vertex_input(struct tu_cs *cs, { uint32_t vfd_decode_idx = 0; - /* why do we go beyond inputs_count? */ - assert(vs->inputs_count + 1 <= MAX_VERTEX_ATTRIBS); - for (uint32_t i = 0; i <= vs->inputs_count; i++) { + for (uint32_t i = 0; i < vs->inputs_count; i++) { if (vs->inputs[i].sysval || !vs->inputs[i].compmask) continue; @@ -1032,6 +1030,7 @@ tu6_emit_vertex_input(struct tu_cs *cs, offsets[vfd_decode_idx] = vi_attr->offset; vfd_decode_idx++; + assert(vfd_decode_idx <= MAX_VERTEX_ATTRIBS); } tu_cs_emit_pkt4(cs, REG_A6XX_VFD_CONTROL_0, 1); -- 2.30.2