From 8c37c16cbc4fd84bbb648cac2189b02633e3f806 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 16 Sep 2014 18:40:07 +0200 Subject: radeonsi: merge si_pipe_shader into si_shader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One is part of the other anyway. Reviewed-by: Michel Dänzer --- src/gallium/drivers/radeonsi/si_shader.h | 68 ++++++++++++++++---------------- 1 file changed, 33 insertions(+), 35 deletions(-) (limited to 'src/gallium/drivers/radeonsi/si_shader.h') diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h index 9c6b2387ac1..3cc77570c31 100644 --- a/src/gallium/drivers/radeonsi/si_shader.h +++ b/src/gallium/drivers/radeonsi/si_shader.h @@ -110,10 +110,10 @@ struct si_shader_output { unsigned usage; }; -struct si_pipe_shader; +struct si_shader; struct si_pipe_shader_selector { - struct si_pipe_shader *current; + struct si_shader *current; struct tgsi_token *tokens; struct pipe_stream_output_info so; @@ -129,29 +129,6 @@ struct si_pipe_shader_selector { unsigned fs_write_all; }; -struct si_shader { - unsigned ninput; - struct si_shader_input input[40]; - - unsigned noutput; - struct si_shader_output output[40]; - - /* geometry shader properties */ - unsigned gs_input_prim; - unsigned gs_output_prim; - unsigned gs_max_out_vertices; - - unsigned nparam; - bool uses_instanceid; - bool fs_write_all; - bool vs_out_misc_write; - bool vs_out_point_size; - bool vs_out_edgeflag; - bool vs_out_layer; - unsigned nr_pos_exports; - unsigned clip_dist_write; -}; - union si_shader_key { struct { unsigned export_16bpc:8; @@ -169,11 +146,11 @@ union si_shader_key { } vs; }; -struct si_pipe_shader { +struct si_shader { struct si_pipe_shader_selector *selector; - struct si_pipe_shader *next_variant; - struct si_pipe_shader *gs_copy_shader; - struct si_shader shader; + struct si_shader *next_variant; + + struct si_shader *gs_copy_shader; struct si_pm4_state *pm4; struct r600_resource *bo; struct r600_resource *scratch_bo; @@ -187,21 +164,42 @@ struct si_pipe_shader { unsigned db_shader_control; 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]; + + /* geometry shader properties */ + unsigned gs_input_prim; + unsigned gs_output_prim; + unsigned gs_max_out_vertices; + + unsigned nparam; + bool uses_instanceid; + bool fs_write_all; + bool vs_out_misc_write; + bool vs_out_point_size; + bool vs_out_edgeflag; + bool vs_out_layer; + unsigned nr_pos_exports; + unsigned clip_dist_write; }; static inline struct si_shader* si_get_vs_state(struct si_context *sctx) { if (sctx->gs_shader) - return &sctx->gs_shader->current->gs_copy_shader->shader; + return sctx->gs_shader->current->gs_copy_shader; else - return &sctx->vs_shader->current->shader; + return sctx->vs_shader->current; } /* radeonsi_shader.c */ -int si_pipe_shader_create(struct pipe_context *ctx, struct si_pipe_shader *shader); -int si_pipe_shader_create(struct pipe_context *ctx, struct si_pipe_shader *shader); -int si_compile_llvm(struct si_context *sctx, struct si_pipe_shader *shader, +int si_pipe_shader_create(struct pipe_context *ctx, struct si_shader *shader); +int si_pipe_shader_create(struct pipe_context *ctx, struct si_shader *shader); +int si_compile_llvm(struct si_context *sctx, struct si_shader *shader, LLVMModuleRef mod); -void si_pipe_shader_destroy(struct pipe_context *ctx, struct si_pipe_shader *shader); +void si_pipe_shader_destroy(struct pipe_context *ctx, struct si_shader *shader); #endif -- cgit v1.2.3