st/nine: Fix the calculation of the number of vs inputs
authorAxel Davy <axel.davy@ens.fr>
Thu, 29 Sep 2016 22:17:45 +0000 (00:17 +0200)
committerAxel Davy <axel.davy@ens.fr>
Mon, 10 Oct 2016 21:43:50 +0000 (23:43 +0200)
Fixes hangs on radeonsi, and assert on llvmpipe.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
src/gallium/state_trackers/nine/nine_shader.c

index 20b6ed7044cfd4b227b4280d24deda060d8e2bdd..0f8bcdd7d7f30dd7bdb528389a27c198267fd184 100644 (file)
@@ -2141,7 +2141,7 @@ DECL_SPECIAL(DCL)
             ureg_DECL_vs_input(ureg, sem.reg.idx);
             assert(sem.reg.idx < ARRAY_SIZE(tx->info->input_map));
             tx->info->input_map[sem.reg.idx] = sm1_to_nine_declusage(&sem);
-            tx->info->num_inputs = sem.reg.idx + 1;
+            tx->info->num_inputs = MAX2(tx->info->num_inputs, sem.reg.idx + 1);
             /* NOTE: preserving order in case of indirect access */
         } else
         if (tx->version.major >= 3) {