radeonsi: move param_offset out of shader->input[] and output[]
authorMarek Olšák <marek.olsak@amd.com>
Sat, 4 Oct 2014 20:15:07 +0000 (22:15 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Sun, 12 Oct 2014 21:53:57 +0000 (23:53 +0200)
Those are going away.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader.h
src/gallium/drivers/radeonsi/si_state_draw.c

index a4073a7c2fe3d9ec4239fb735b1617be657aa170..8fc895a62b67cccf7e9e524ac6851e071ca48697 100644 (file)
@@ -490,9 +490,9 @@ static void declare_input_fs(
                return;
        }
 
-       shader->input[input_index].param_offset = shader->nparam++;
+       shader->ps_input_param_offset[input_index] = shader->nparam++;
        attr_number = lp_build_const_int32(gallivm,
-                                          shader->input[input_index].param_offset);
+                                          shader->ps_input_param_offset[input_index]);
 
        switch (decl->Interp.Interpolate) {
        case TGSI_INTERPOLATE_CONSTANT:
@@ -534,7 +534,7 @@ static void declare_input_fs(
                LLVMValueRef face, is_face_positive;
                LLVMValueRef back_attr_number =
                        lp_build_const_int32(gallivm,
-                                            shader->input[input_index].param_offset + 1);
+                                            shader->ps_input_param_offset[input_index] + 1);
 
                face = LLVMGetParam(main_fn, SI_PARAM_FRONT_FACE);
 
@@ -1168,7 +1168,7 @@ handle_semantic:
                case TGSI_SEMANTIC_COLOR:
                case TGSI_SEMANTIC_BCOLOR:
                        target = V_008DFC_SQ_EXP_PARAM + param_count;
-                       shader->output[i].param_offset = param_count;
+                       shader->vs_output_param_offset[i] = param_count;
                        param_count++;
                        break;
                case TGSI_SEMANTIC_CLIPDIST:
@@ -1183,7 +1183,7 @@ handle_semantic:
                case TGSI_SEMANTIC_FOG:
                case TGSI_SEMANTIC_GENERIC:
                        target = V_008DFC_SQ_EXP_PARAM + param_count;
-                       shader->output[i].param_offset = param_count;
+                       shader->vs_output_param_offset[i] = param_count;
                        param_count++;
                        break;
                default:
index 80a3decebcdb73d6e36f46b2364fafc1cd5c80ac..3c9c2c21dc58035a4efc71a6bf499394db8ac3e3 100644 (file)
@@ -174,6 +174,9 @@ struct si_shader {
        struct si_shader_output output[40];
 
        unsigned                nparam;
+       unsigned                vs_output_param_offset[PIPE_MAX_SHADER_OUTPUTS];
+       unsigned                ps_input_param_offset[PIPE_MAX_SHADER_INPUTS];
+
        bool                    uses_instanceid;
        bool                    vs_out_misc_write;
        bool                    vs_out_point_size;
index 0a614a11e98c0ebdc4c570b7c90d253e7b020748..f2dc22ff60a62b83b400536e090f4bd24f66fd5e 100644 (file)
@@ -502,7 +502,7 @@ static void si_update_spi_map(struct si_context *sctx)
                unsigned name = psinfo->input_semantic_name[i];
                unsigned index = psinfo->input_semantic_index[i];
                unsigned interpolate = psinfo->input_interpolate[i];
-               unsigned param_offset = ps->input[i].param_offset;
+               unsigned param_offset = ps->ps_input_param_offset[i];
 
                if (name == TGSI_SEMANTIC_POSITION)
                        /* Read from preloaded VGPRs, not parameters */
@@ -525,7 +525,7 @@ bcolor:
                for (j = 0; j < vsinfo->num_outputs; j++) {
                        if (name == vsinfo->output_semantic_name[j] &&
                            index == vsinfo->output_semantic_index[j]) {
-                               tmp |= S_028644_OFFSET(vs->output[j].param_offset);
+                               tmp |= S_028644_OFFSET(vs->vs_output_param_offset[j]);
                                break;
                        }
                }