radeonsi: merge si_pipe_shader into si_shader
[mesa.git] / src / gallium / drivers / radeonsi / si_shader.h
index 9c6b2387ac16410cbd8ba01a124ca08048e059a8..3cc77570c31e7106c7a7a25f58b7a487d5d851bf 100644 (file)
@@ -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