diff options
author | Marek Olšák <[email protected]> | 2014-09-30 15:12:09 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2014-10-04 15:16:14 +0200 |
commit | 5233568861b082ee288d845f447012fa47e8bd1e (patch) | |
tree | ebae8d3e34c3d22ac58bf698f3ade833a1fa7683 /src/gallium/drivers/radeonsi/si_shader.c | |
parent | af4f5a7c97f3ab47bbd21aa7c27d0c0aaf01f959 (diff) |
radeonsi: get tgsi_shader_info only once before compilation
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_shader.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 9d2cc803c2d..276ba814d1d 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -2805,7 +2805,6 @@ int si_shader_create(struct si_screen *sscreen, struct si_shader *shader) { struct si_shader_selector *sel = shader->selector; struct si_shader_context si_shader_ctx; - struct tgsi_shader_info shader_info; struct lp_build_tgsi_context * bld_base; LLVMModuleRef mod; int r = 0; @@ -2826,13 +2825,11 @@ int si_shader_create(struct si_screen *sscreen, struct si_shader *shader) radeon_llvm_context_init(&si_shader_ctx.radeon_bld); bld_base = &si_shader_ctx.radeon_bld.soa.bld_base; - tgsi_scan_shader(sel->tokens, &shader_info); - - if (shader_info.uses_kill) + if (sel->info.uses_kill) shader->db_shader_control |= S_02880C_KILL_ENABLE(1); - shader->uses_instanceid = shader_info.uses_instanceid; - bld_base->info = &shader_info; + shader->uses_instanceid = sel->info.uses_instanceid; + bld_base->info = &sel->info; bld_base->emit_fetch_funcs[TGSI_FILE_CONSTANT] = fetch_constant; bld_base->op_actions[TGSI_OPCODE_TEX] = tex_action; @@ -2876,16 +2873,16 @@ int si_shader_create(struct si_screen *sscreen, struct si_shader *shader) bld_base->emit_fetch_funcs[TGSI_FILE_INPUT] = fetch_input_gs; bld_base->emit_epilogue = si_llvm_emit_gs_epilogue; - for (i = 0; i < shader_info.num_properties; i++) { - switch (shader_info.properties[i].name) { + for (i = 0; i < sel->info.num_properties; i++) { + switch (sel->info.properties[i].name) { case TGSI_PROPERTY_GS_INPUT_PRIM: - shader->gs_input_prim = shader_info.properties[i].data[0]; + shader->gs_input_prim = sel->info.properties[i].data[0]; break; case TGSI_PROPERTY_GS_OUTPUT_PRIM: - shader->gs_output_prim = shader_info.properties[i].data[0]; + shader->gs_output_prim = sel->info.properties[i].data[0]; break; case TGSI_PROPERTY_GS_MAX_OUTPUT_VERTICES: - shader->gs_max_out_vertices = shader_info.properties[i].data[0]; + shader->gs_max_out_vertices = sel->info.properties[i].data[0]; break; } } @@ -2897,10 +2894,10 @@ int si_shader_create(struct si_screen *sscreen, struct si_shader *shader) si_shader_ctx.radeon_bld.load_input = declare_input_fs; bld_base->emit_epilogue = si_llvm_emit_fs_epilogue; - for (i = 0; i < shader_info.num_properties; i++) { - switch (shader_info.properties[i].name) { + for (i = 0; i < sel->info.num_properties; i++) { + switch (sel->info.properties[i].name) { case TGSI_PROPERTY_FS_DEPTH_LAYOUT: - switch (shader_info.properties[i].data[0]) { + switch (sel->info.properties[i].data[0]) { case TGSI_FS_DEPTH_LAYOUT_GREATER: shader->db_shader_control |= S_02880C_CONSERVATIVE_Z_EXPORT(V_02880C_EXPORT_GREATER_THAN_Z); |