diff options
author | Marek Olšák <[email protected]> | 2014-10-04 22:17:25 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2014-10-12 23:53:57 +0200 |
commit | 80677327404490e1bb4a37c065b4536940e74f73 (patch) | |
tree | 08418ca3a8da5b32209dd1dfee7aae71933a770a /src | |
parent | 8b057ddaeaa1e5ef65f1dbd548b59f8bd0a943b1 (diff) |
radeonsi: remove shader->input[] and output[] arrays and dependencies
They were reinventing tgsi_shader_info. They are unused now.
radeon_llvm_context::load_input can be NULL if input fetching is implemented
in some other way.
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 67 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.h | 21 |
3 files changed, 2 insertions, 89 deletions
diff --git a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c index 119e613c5e5..2fa23ed087c 100644 --- a/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c +++ b/src/gallium/drivers/radeon/radeon_setup_tgsi_llvm.c @@ -275,7 +275,8 @@ static void emit_declaration( { unsigned idx; for (idx = decl->Range.First; idx <= decl->Range.Last; idx++) { - ctx->load_input(ctx, idx, decl); + if (ctx->load_input) + ctx->load_input(ctx, idx, decl); } } break; diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 8fc895a62b6..63b77be73e7 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -233,33 +233,6 @@ static LLVMValueRef get_instance_index_for_fetch( return result; } -static int si_store_shader_io_attribs(struct si_shader *shader, - const struct tgsi_full_declaration *d) -{ - int i = -1; - - switch (d->Declaration.File) { - case TGSI_FILE_INPUT: - i = shader->ninput++; - assert(i < Elements(shader->input)); - shader->input[i].name = d->Semantic.Name; - shader->input[i].sid = d->Semantic.Index; - shader->input[i].index = d->Range.First; - shader->input[i].interpolate = d->Interp.Interpolate; - return -1; - - case TGSI_FILE_OUTPUT: - i = shader->noutput++; - assert(i < Elements(shader->output)); - shader->output[i].name = d->Semantic.Name; - shader->output[i].sid = d->Semantic.Index; - shader->output[i].index = d->Range.First; - break; - } - - return i; -} - static void declare_input_vs( struct radeon_llvm_context *radeon_bld, unsigned input_index, @@ -324,18 +297,6 @@ static void declare_input_vs( } } -static void declare_input_gs( - struct radeon_llvm_context *radeon_bld, - unsigned input_index, - const struct tgsi_full_declaration *decl) -{ - struct si_shader_context *si_shader_ctx = - si_shader_context(&radeon_bld->soa.bld_base); - struct si_shader *shader = si_shader_ctx->shader; - - si_store_shader_io_attribs(shader, decl); -} - static LLVMValueRef fetch_input_gs( struct lp_build_tgsi_context *bld_base, const struct tgsi_full_src_register *reg, @@ -1347,7 +1308,6 @@ static void si_llvm_emit_vs_epilogue(struct lp_build_tgsi_context * bld_base) { struct si_shader_context *si_shader_ctx = si_shader_context(bld_base); struct gallivm_state *gallivm = bld_base->base.gallivm; - struct si_shader *shader = si_shader_ctx->shader; struct tgsi_parse_context *parse = &si_shader_ctx->parse; struct si_shader_output_values *outputs = NULL; unsigned noutput = 0; @@ -1363,10 +1323,6 @@ static void si_llvm_emit_vs_epilogue(struct lp_build_tgsi_context * bld_base) if (parse->FullToken.Token.Type != TGSI_TOKEN_TYPE_DECLARATION) continue; - i = si_store_shader_io_attribs(shader, d); - if (i < 0) - continue; - outputs = REALLOC(outputs, noutput * sizeof(outputs[0]), (noutput + 1) * sizeof(outputs[0])); for (index = d->Range.First; index <= d->Range.Last; index++) { @@ -1399,7 +1355,6 @@ static void si_llvm_emit_fs_epilogue(struct lp_build_tgsi_context * bld_base) LLVMValueRef last_args[9] = { 0 }; unsigned semantic_name; int depth_index = -1, stencil_index = -1, samplemask_index = -1; - int i; while (!tgsi_parse_end_of_tokens(parse)) { struct tgsi_full_declaration *d = @@ -1412,10 +1367,6 @@ static void si_llvm_emit_fs_epilogue(struct lp_build_tgsi_context * bld_base) if (parse->FullToken.Token.Type != TGSI_TOKEN_TYPE_DECLARATION) continue; - i = si_store_shader_io_attribs(shader, d); - if (i < 0) - continue; - semantic_name = d->Semantic.Name; for (index = d->Range.First; index <= d->Range.Last; index++) { /* Select the correct target */ @@ -2251,21 +2202,6 @@ static void si_llvm_emit_vertex( t_list = build_indexed_load(si_shader_ctx, t_list_ptr, lp_build_const_int32(gallivm, SI_RING_GSVS)); - if (shader->noutput == 0) { - struct tgsi_parse_context *parse = &si_shader_ctx->parse; - - while (!tgsi_parse_end_of_tokens(parse)) { - tgsi_parse_token(parse); - - if (parse->FullToken.Token.Type == TGSI_TOKEN_TYPE_DECLARATION) { - struct tgsi_full_declaration *d = &parse->FullToken.FullDeclaration; - - if (d->Declaration.File == TGSI_FILE_OUTPUT) - si_store_shader_io_attribs(shader, d); - } - } - } - /* Write vertex attribute values to GSVS ring */ gs_next_vertex = LLVMBuildLoad(gallivm->builder, si_shader_ctx->gs_next_vertex, ""); @@ -2784,9 +2720,7 @@ int si_shader_create(struct si_screen *sscreen, struct si_shader *shader) si_dump_streamout(&sel->so); } - assert(shader->noutput == 0); assert(shader->nparam == 0); - assert(shader->ninput == 0); memset(&si_shader_ctx, 0, sizeof(si_shader_ctx)); radeon_llvm_context_init(&si_shader_ctx.radeon_bld); @@ -2834,7 +2768,6 @@ int si_shader_create(struct si_screen *sscreen, struct si_shader *shader) } break; case TGSI_PROCESSOR_GEOMETRY: - si_shader_ctx.radeon_bld.load_input = declare_input_gs; bld_base->emit_fetch_funcs[TGSI_FILE_INPUT] = fetch_input_gs; bld_base->emit_epilogue = si_llvm_emit_gs_epilogue; break; diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h index 3c9c2c21dc5..30e6854031e 100644 --- a/src/gallium/drivers/radeonsi/si_shader.h +++ b/src/gallium/drivers/radeonsi/si_shader.h @@ -96,21 +96,6 @@ #define SI_NUM_PARAMS (SI_PARAM_POS_FIXED_PT + 1) -struct si_shader_input { - unsigned name; - int sid; - unsigned param_offset; - unsigned index; - unsigned interpolate; -}; - -struct si_shader_output { - unsigned name; - int sid; - unsigned param_offset; - unsigned index; -}; - struct si_shader; struct si_shader_selector { @@ -167,12 +152,6 @@ struct si_shader { unsigned cb_shader_mask; union si_shader_key key; - unsigned ninput; - struct si_shader_input input[40]; - - unsigned noutput; - 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]; |