[Mesa-dev] [PATCH 04/17] st/mesa: remove unused outputSlotToAttr

Marek Olšák maraeo at gmail.com
Mon May 1 12:52:53 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

---
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 1 -
 src/mesa/state_tracker/st_glsl_to_tgsi.h   | 1 -
 src/mesa/state_tracker/st_program.c        | 9 ---------
 3 files changed, 11 deletions(-)

diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 664dd61..175daaf 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -6203,21 +6203,20 @@ st_translate_program(
    glsl_to_tgsi_visitor *program,
    const struct gl_program *proginfo,
    GLuint numInputs,
    const ubyte inputMapping[],
    const GLuint inputSlotToAttr[],
    const ubyte inputSemanticName[],
    const ubyte inputSemanticIndex[],
    const GLuint interpMode[],
    GLuint numOutputs,
    const ubyte outputMapping[],
-   const GLuint outputSlotToAttr[],
    const ubyte outputSemanticName[],
    const ubyte outputSemanticIndex[])
 {
    struct st_translate *t;
    unsigned i;
    struct gl_program_constants *frag_const =
       &ctx->Const.Program[MESA_SHADER_FRAGMENT];
    enum pipe_error ret = PIPE_OK;
 
    assert(numInputs <= ARRAY_SIZE(t->inputs));
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.h b/src/mesa/state_tracker/st_glsl_to_tgsi.h
index dec68c5..542ddc6 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.h
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.h
@@ -42,21 +42,20 @@ enum pipe_error st_translate_program(
    struct glsl_to_tgsi_visitor *program,
    const struct gl_program *proginfo,
    GLuint numInputs,
    const ubyte inputMapping[],
    const GLuint inputSlotToAttr[],
    const ubyte inputSemanticName[],
    const ubyte inputSemanticIndex[],
    const GLuint interpMode[],
    GLuint numOutputs,
    const ubyte outputMapping[],
-   const GLuint outputSlotToAttr[],
    const ubyte outputSemanticName[],
    const ubyte outputSemanticIndex[]);
 
 void free_glsl_to_tgsi_visitor(struct glsl_to_tgsi_visitor *v);
 
 GLboolean st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog);
 
 void
 st_translate_stream_output_info(struct glsl_to_tgsi_visitor *glsl_to_tgsi,
                                 const ubyte *outputMapping,
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 65377b9..88eaebd 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -370,21 +370,20 @@ st_release_cp_variants(struct st_context *st, struct st_compute_program *stcp)
  */
 bool
 st_translate_vertex_program(struct st_context *st,
                             struct st_vertex_program *stvp)
 {
    struct ureg_program *ureg;
    enum pipe_error error;
    unsigned num_outputs = 0;
    unsigned attr;
    ubyte input_to_index[VERT_ATTRIB_MAX] = {0};
-   unsigned output_slot_to_attr[VARYING_SLOT_MAX] = {0};
    ubyte output_semantic_name[VARYING_SLOT_MAX] = {0};
    ubyte output_semantic_index[VARYING_SLOT_MAX] = {0};
 
    stvp->num_inputs = 0;
 
    if (stvp->Base.arb.IsPositionInvariant)
       _mesa_insert_mvp_code(st->ctx, &stvp->Base);
 
    /*
     * Determine number of inputs, the mappings between VERT_ATTRIB_x
@@ -410,21 +409,20 @@ st_translate_vertex_program(struct st_context *st,
    /* Compute mapping of vertex program outputs to slots.
     */
    for (attr = 0; attr < VARYING_SLOT_MAX; attr++) {
       if ((stvp->Base.info.outputs_written & BITFIELD64_BIT(attr)) == 0) {
          stvp->result_to_output[attr] = ~0;
       }
       else {
          unsigned slot = num_outputs++;
 
          stvp->result_to_output[attr] = slot;
-         output_slot_to_attr[slot] = attr;
 
          switch (attr) {
          case VARYING_SLOT_POS:
             output_semantic_name[slot] = TGSI_SEMANTIC_POSITION;
             output_semantic_index[slot] = 0;
             break;
          case VARYING_SLOT_COL0:
             output_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
             output_semantic_index[slot] = 0;
             break;
@@ -567,21 +565,20 @@ st_translate_vertex_program(struct st_context *st,
                                    /* inputs */
                                    stvp->num_inputs,
                                    input_to_index,
                                    NULL, /* inputSlotToAttr */
                                    NULL, /* input semantic name */
                                    NULL, /* input semantic index */
                                    NULL, /* interp mode */
                                    /* outputs */
                                    num_outputs,
                                    stvp->result_to_output,
-                                   output_slot_to_attr,
                                    output_semantic_name,
                                    output_semantic_index);
 
       st_translate_stream_output_info(stvp->glsl_to_tgsi,
                                       stvp->result_to_output,
                                       &stvp->tgsi.stream_output);
 
       free_glsl_to_tgsi_visitor(stvp->glsl_to_tgsi);
    } else
       error = st_translate_mesa_program(st->ctx,
@@ -1025,21 +1022,20 @@ st_translate_fragment_program(struct st_context *st,
                            /* inputs */
                            fs_num_inputs,
                            inputMapping,
                            inputSlotToAttr,
                            input_semantic_name,
                            input_semantic_index,
                            interpMode,
                            /* outputs */
                            fs_num_outputs,
                            outputMapping,
-                           NULL,
                            fs_output_semantic_name,
                            fs_output_semantic_index);
 
       free_glsl_to_tgsi_visitor(stfp->glsl_to_tgsi);
    } else if (stfp->ati_fs)
       st_translate_atifs_program(ureg,
                                  stfp->ati_fs,
                                  &stfp->Base,
                                  /* inputs */
                                  fs_num_inputs,
@@ -1343,37 +1339,35 @@ st_get_fp_variant(struct st_context *st,
 static void
 st_translate_program_common(struct st_context *st,
                             struct gl_program *prog,
                             struct glsl_to_tgsi_visitor *glsl_to_tgsi,
                             struct ureg_program *ureg,
                             unsigned tgsi_processor,
                             struct pipe_shader_state *out_state)
 {
    GLuint inputSlotToAttr[VARYING_SLOT_TESS_MAX];
    ubyte inputMapping[VARYING_SLOT_TESS_MAX];
-   GLuint outputSlotToAttr[VARYING_SLOT_TESS_MAX];
    ubyte outputMapping[VARYING_SLOT_TESS_MAX];
    GLuint attr;
 
    ubyte input_semantic_name[PIPE_MAX_SHADER_INPUTS];
    ubyte input_semantic_index[PIPE_MAX_SHADER_INPUTS];
    uint num_inputs = 0;
 
    ubyte output_semantic_name[PIPE_MAX_SHADER_OUTPUTS];
    ubyte output_semantic_index[PIPE_MAX_SHADER_OUTPUTS];
    uint num_outputs = 0;
 
    GLint i;
 
    memset(inputSlotToAttr, 0, sizeof(inputSlotToAttr));
    memset(inputMapping, 0, sizeof(inputMapping));
-   memset(outputSlotToAttr, 0, sizeof(outputSlotToAttr));
    memset(outputMapping, 0, sizeof(outputMapping));
    memset(out_state, 0, sizeof(*out_state));
 
    if (prog->info.clip_distance_array_size)
       ureg_property(ureg, TGSI_PROPERTY_NUM_CLIPDIST_ENABLED,
                     prog->info.clip_distance_array_size);
    if (prog->info.cull_distance_array_size)
       ureg_property(ureg, TGSI_PROPERTY_NUM_CULLDIST_ENABLED,
                     prog->info.cull_distance_array_size);
 
@@ -1477,21 +1471,20 @@ st_translate_program_common(struct st_context *st,
 
    /*
     * Determine number of outputs, the (default) output register
     * mapping and the semantic information for each output.
     */
    for (attr = 0; attr < VARYING_SLOT_MAX; attr++) {
       if (prog->info.outputs_written & BITFIELD64_BIT(attr)) {
          GLuint slot = num_outputs++;
 
          outputMapping[attr] = slot;
-         outputSlotToAttr[slot] = attr;
 
          switch (attr) {
          case VARYING_SLOT_POS:
             assert(slot == 0);
             output_semantic_name[slot] = TGSI_SEMANTIC_POSITION;
             output_semantic_index[slot] = 0;
             break;
          case VARYING_SLOT_COL0:
             output_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
             output_semantic_index[slot] = 0;
@@ -1580,42 +1573,40 @@ st_translate_program_common(struct st_context *st,
       }
    }
 
    /* Also add patch outputs. */
    for (attr = 0; attr < 32; attr++) {
       if (prog->info.patch_outputs_written & (1u << attr)) {
          GLuint slot = num_outputs++;
          GLuint patch_attr = VARYING_SLOT_PATCH0 + attr;
 
          outputMapping[patch_attr] = slot;
-         outputSlotToAttr[slot] = patch_attr;
          output_semantic_name[slot] = TGSI_SEMANTIC_PATCH;
          output_semantic_index[slot] = attr;
       }
    }
 
    st_translate_program(st->ctx,
                         tgsi_processor,
                         ureg,
                         glsl_to_tgsi,
                         prog,
                         /* inputs */
                         num_inputs,
                         inputMapping,
                         inputSlotToAttr,
                         input_semantic_name,
                         input_semantic_index,
                         NULL,
                         /* outputs */
                         num_outputs,
                         outputMapping,
-                        outputSlotToAttr,
                         output_semantic_name,
                         output_semantic_index);
 
    unsigned num_tokens;
    out_state->tokens = ureg_get_tokens(ureg, &num_tokens);
    ureg_destroy(ureg);
 
    st_translate_stream_output_info(glsl_to_tgsi,
                                    outputMapping,
                                    &out_state->stream_output);
-- 
2.7.4



More information about the mesa-dev mailing list