X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fradeonsi%2Fsi_shader.h;h=3cc77570c31e7106c7a7a25f58b7a487d5d851bf;hb=8c37c16cbc4fd84bbb648cac2189b02633e3f806;hp=9c6b2387ac16410cbd8ba01a124ca08048e059a8;hpb=dba4c5baf449108f8d1f910af33998ce3c21b47a;p=mesa.git 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