From 8b057ddaeaa1e5ef65f1dbd548b59f8bd0a943b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 4 Oct 2014 22:15:07 +0200 Subject: [PATCH] radeonsi: move param_offset out of shader->input[] and output[] MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Those are going away. Reviewed-by: Michel Dänzer --- src/gallium/drivers/radeonsi/si_shader.c | 10 +++++----- src/gallium/drivers/radeonsi/si_shader.h | 3 +++ src/gallium/drivers/radeonsi/si_state_draw.c | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index a4073a7c2fe..8fc895a62b6 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -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: diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h index 80a3decebcd..3c9c2c21dc5 100644 --- a/src/gallium/drivers/radeonsi/si_shader.h +++ b/src/gallium/drivers/radeonsi/si_shader.h @@ -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; diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c index 0a614a11e98..f2dc22ff60a 100644 --- a/src/gallium/drivers/radeonsi/si_state_draw.c +++ b/src/gallium/drivers/radeonsi/si_state_draw.c @@ -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; } } -- 2.30.2