i965: stop passing gl_shader_program to brw_compile_gs() and gen6_gs_visitor()
authorTimothy Arceri <timothy.arceri@collabora.com>
Mon, 7 Nov 2016 23:28:12 +0000 (10:28 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Tue, 3 Jan 2017 01:20:10 +0000 (12:20 +1100)
Instead we caan just use gl_program.

Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_compiler.h
src/mesa/drivers/dri/i965/brw_gs.c
src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
src/mesa/drivers/dri/i965/gen6_gs_visitor.cpp
src/mesa/drivers/dri/i965/gen6_gs_visitor.h

index 4813f204868cb99f4db25c8105ee5b566245e175..5e706014045b01cf7fa6fa50bd383eebcc9404ce 100644 (file)
@@ -819,7 +819,7 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data,
                const struct brw_gs_prog_key *key,
                struct brw_gs_prog_data *prog_data,
                const struct nir_shader *shader,
-               struct gl_shader_program *shader_prog,
+               struct gl_program *prog,
                int shader_time_index,
                unsigned *final_assembly_size,
                char **error_str);
index 0df83e8bfd2fa78dd0ac00c564232a7d1fa951ae..47b4e5c1fe3476c4b525b8d70d52df58568e0c19 100644 (file)
@@ -152,7 +152,7 @@ brw_codegen_gs_prog(struct brw_context *brw,
    char *error_str;
    const unsigned *program =
       brw_compile_gs(brw->screen->compiler, brw, mem_ctx, key,
-                     &prog_data, gp->program.nir, prog,
+                     &prog_data, gp->program.nir, &gp->program,
                      st_index, &program_size, &error_str);
    if (program == NULL) {
       ralloc_strcat(&gp->program.sh.data->InfoLog, error_str);
index 657e1f07b92472c7f663880b6274f188289cd0e8..18458ca16b499c7220f2af40a3c0d1600de6c634 100644 (file)
@@ -590,7 +590,7 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data,
                const struct brw_gs_prog_key *key,
                struct brw_gs_prog_data *prog_data,
                const nir_shader *src_shader,
-               struct gl_shader_program *shader_prog,
+               struct gl_program *prog,
                int shader_time_index,
                unsigned *final_assembly_size,
                char **error_str)
@@ -643,7 +643,7 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data,
          prog_data->control_data_format = GEN7_GS_CONTROL_DATA_FORMAT_GSCTL_SID;
 
          /* We only have to emit control bits if we are using streams */
-         if (shader_prog && shader_prog->Geom.UsesStreams)
+         if (prog && prog->info.gs.uses_streams)
             c.control_data_bits_per_vertex = 2;
          else
             c.control_data_bits_per_vertex = 0;
@@ -893,8 +893,7 @@ brw_compile_gs(const struct brw_compiler *compiler, void *log_data,
                                shader, mem_ctx, false /* no_spills */,
                                shader_time_index);
    else
-      gs = new gen6_gs_visitor(compiler, log_data, &c, prog_data, shader_prog,
-                               shader_prog->_LinkedShaders[MESA_SHADER_GEOMETRY]->Program,
+      gs = new gen6_gs_visitor(compiler, log_data, &c, prog_data, prog,
                                shader, mem_ctx, false /* no_spills */,
                                shader_time_index);
 
index f2739e3d150919e992e7302b0ea9b60ce21cfc72..075bc4ad487336ce5c6a04bd770621d58c29bab6 100644 (file)
@@ -534,7 +534,7 @@ gen6_gs_visitor::xfb_setup()
    };
 
    const struct gl_transform_feedback_info *linked_xfb_info =
-      this->shader_prog->xfb_program->sh.LinkedTransformFeedback;
+      this->prog->sh.LinkedTransformFeedback;
    int i;
 
    /* Make sure that the VUE slots won't overflow the unsigned chars in
index 556bd158fde8b4a047c5870e5c1308161347c963..1bdcf925880a5ed9d739663d831b055f8a19393b 100644 (file)
@@ -39,7 +39,6 @@ public:
                    void *log_data,
                    struct brw_gs_compile *c,
                    struct brw_gs_prog_data *prog_data,
-                   struct gl_shader_program *sh_prog,
                    struct gl_program *prog,
                    const nir_shader *shader,
                    void *mem_ctx,
@@ -47,7 +46,6 @@ public:
                    int shader_time_index) :
       vec4_gs_visitor(comp, log_data, c, prog_data, shader, mem_ctx, no_spills,
                       shader_time_index),
-      shader_prog(sh_prog),
       prog(prog)
       {
       }
@@ -70,7 +68,6 @@ private:
    void xfb_setup();
    int get_vertex_output_offset_for_varying(int vertex, int varying);
 
-   const struct gl_shader_program *shader_prog;
    const struct gl_program *prog;
 
    src_reg vertex_output;