radeonsi: allow fewer input SGPRs in 2nd shader of merged shaders
authorMarek Olšák <marek.olsak@amd.com>
Wed, 7 Feb 2018 00:09:32 +0000 (01:09 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 26 Feb 2018 11:01:03 +0000 (12:01 +0100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader.c

index 7af0bdb99ce6a1d5fc7332ae7bc1cdca27c49d9c..288f7434bb21dfd1508e6d7fa15bec2a71911dff 100644 (file)
@@ -6600,9 +6600,13 @@ static void si_build_wrapper_function(struct si_shader_context *ctx,
 
                        if (is_sgpr)
                                lp_add_function_attr(parts[part], param_idx + 1, LP_FUNC_ATTR_INREG);
+                       else if (out_idx < num_out_sgpr) {
+                               /* Skip returned SGPRs the current part doesn't
+                                * declare on the input. */
+                               out_idx = num_out_sgpr;
+                       }
 
                        assert(out_idx + param_size <= (is_sgpr ? num_out_sgpr : num_out));
-                       assert(is_sgpr || out_idx >= num_out_sgpr);
 
                        if (param_size == 1)
                                arg = out[out_idx];