turnip: fix 32 vertex attributes case
authorJonathan Marek <jonathan@marek.ca>
Mon, 14 Oct 2019 15:16:02 +0000 (11:16 -0400)
committerJonathan Marek <jonathan@marek.ca>
Tue, 15 Oct 2019 11:56:19 +0000 (07:56 -0400)
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
src/freedreno/vulkan/tu_pipeline.c

index 0e6463e2abc1da4999e2a87782af616cc2e48e81..29f394c82f082b1d782aea6d7600f21bdae31d37 100644 (file)
@@ -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);