radeonsi: remove si_shader::ps_input_interpolate
authorMarek Olšák <marek.olsak@amd.com>
Sat, 2 Jan 2016 02:18:03 +0000 (03:18 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 9 Feb 2016 20:19:51 +0000 (21:19 +0100)
tgsi_shader_info has this too.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader.h

index 79255004f28168ab30bceea5cc362032733ceca3..c595f20827403c17c2cf1a0e509109ff1826352a 100644 (file)
@@ -914,7 +914,6 @@ static void declare_input_fs(
 
        attr_number = lp_build_const_int32(gallivm, input_index);
 
-       shader->ps_input_interpolate[input_index] = decl->Interp.Interpolate;
        interp_param_idx = lookup_interp_param_index(decl->Interp.Interpolate,
                                                     decl->Interp.Location);
        if (interp_param_idx == -1)
@@ -3257,17 +3256,17 @@ static void build_interp_intrinsic(const struct lp_build_tgsi_action *action,
        LLVMValueRef interp_param;
        const struct tgsi_full_instruction *inst = emit_data->inst;
        const char *intr_name;
-       int input_index;
+       int input_index = inst->Src[0].Register.Index;
        int chan;
        int i;
        LLVMValueRef attr_number;
        LLVMTypeRef input_type = LLVMFloatTypeInContext(gallivm->context);
        LLVMValueRef params = LLVMGetParam(si_shader_ctx->radeon_bld.main_fn, SI_PARAM_PRIM_MASK);
        int interp_param_idx;
+       unsigned interp = shader->selector->info.input_interpolate[input_index];
        unsigned location;
 
        assert(inst->Src[0].Register.File == TGSI_FILE_INPUT);
-       input_index = inst->Src[0].Register.Index;
 
        if (inst->Instruction.Opcode == TGSI_OPCODE_INTERP_OFFSET ||
            inst->Instruction.Opcode == TGSI_OPCODE_INTERP_SAMPLE)
@@ -3275,8 +3274,7 @@ static void build_interp_intrinsic(const struct lp_build_tgsi_action *action,
        else
                location = TGSI_INTERPOLATE_LOC_CENTROID;
 
-       interp_param_idx = lookup_interp_param_index(shader->ps_input_interpolate[input_index],
-                                                    location);
+       interp_param_idx = lookup_interp_param_index(interp, location);
        if (interp_param_idx == -1)
                return;
        else if (interp_param_idx)
index 86d8f725cb63afe58045f25ff8c195610ac6eb9e..d3609d463344d95d1dd2bf95cf22d248f5eda4e2 100644 (file)
@@ -291,7 +291,6 @@ struct si_shader {
        struct si_shader_config         config;
 
        unsigned                vs_output_param_offset[PIPE_MAX_SHADER_OUTPUTS];
-       unsigned                ps_input_interpolate[PIPE_MAX_SHADER_INPUTS];
        bool                    uses_instanceid;
        unsigned                nr_pos_exports;
        unsigned                nr_param_exports;