radeonsi/nir: fix num_inputs for doubles in vs
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 15 Dec 2017 00:22:56 +0000 (11:22 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Mon, 29 Jan 2018 22:08:47 +0000 (09:08 +1100)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_shader_nir.c

index 8784117833e9cff0ea374f249857f8b224f526c7..34d28b7a728704e7cbeee6a415cf408e92ded52e 100644 (file)
@@ -209,8 +209,13 @@ void si_nir_scan_shader(const struct nir_shader *nir,
                 * tracker has already mapped them to attributes via
                 * variable->data.driver_location.
                 */
-               if (nir->info.stage == MESA_SHADER_VERTEX)
+               if (nir->info.stage == MESA_SHADER_VERTEX) {
+                       if (glsl_type_is_dual_slot(variable->type))
+                               num_inputs += 2;
+                       else
+                               num_inputs++;
                        continue;
+               }
 
                assert(nir->info.stage != MESA_SHADER_FRAGMENT ||
                       (attrib_count == 1 && "not implemented"));
@@ -303,10 +308,8 @@ void si_nir_scan_shader(const struct nir_shader *nir,
                        info->colors_read |= 0xf0;
        }
 
-       if (nir->info.stage != MESA_SHADER_VERTEX)
-               info->num_inputs = num_inputs;
-       else
-               info->num_inputs = nir->num_inputs;
+       info->num_inputs = num_inputs;
+
 
        i = 0;
        uint64_t processed_outputs = 0;