i965: stop passing gl_shader_program to brw_nir_setup_glsl_uniforms()
authorTimothy Arceri <timothy.arceri@collabora.com>
Mon, 7 Nov 2016 09:54:45 +0000 (20:54 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Fri, 6 Jan 2017 00:21:41 +0000 (11:21 +1100)
We can now just get the data needed from the gl_shader_program_data
pointer in gl_program.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/mesa/drivers/dri/i965/brw_cs.c
src/mesa/drivers/dri/i965/brw_gs.c
src/mesa/drivers/dri/i965/brw_nir.h
src/mesa/drivers/dri/i965/brw_nir_uniforms.cpp
src/mesa/drivers/dri/i965/brw_tcs.c
src/mesa/drivers/dri/i965/brw_tes.c
src/mesa/drivers/dri/i965/brw_vs.c
src/mesa/drivers/dri/i965/brw_wm.c

index c39637306eb960b507608e5d0eedf2aa69b7c82f..824e6e527f3f8b27aea5fd60512daa2765595643 100644 (file)
@@ -102,8 +102,8 @@ brw_codegen_cs_prog(struct brw_context *brw,
    prog_data.base.nr_params = param_count;
    prog_data.base.nr_image_params = cp->program.info.num_images;
 
-   brw_nir_setup_glsl_uniforms(cp->program.nir, prog, &cp->program,
-                               &prog_data.base, true);
+   brw_nir_setup_glsl_uniforms(cp->program.nir, &cp->program,&prog_data.base,
+                               true);
 
    if (unlikely(brw->perf_debug)) {
       start_busy = (brw->batch.last_bo &&
index 53ed07b55b93f2d8d84ee3f045c001a3b3e68bb4..613dd62db13741275999a15fe3dc202cdf7fd879 100644 (file)
@@ -123,7 +123,7 @@ brw_codegen_gs_prog(struct brw_context *brw,
    prog_data.base.base.nr_params = param_count;
    prog_data.base.base.nr_image_params = gp->program.info.num_images;
 
-   brw_nir_setup_glsl_uniforms(gp->program.nir, prog, &gp->program,
+   brw_nir_setup_glsl_uniforms(gp->program.nir, &gp->program,
                                &prog_data.base.base,
                                compiler->scalar_stage[MESA_SHADER_GEOMETRY]);
 
index 8cfb6c1be6830bdb03b3c7c213492b00c5d7fba3..a7189c12165d4a4651602e47b1ef9cac97b3310d 100644 (file)
@@ -135,7 +135,6 @@ enum brw_reg_type brw_type_for_nir_type(nir_alu_type type);
 enum glsl_base_type brw_glsl_base_type_for_nir_type(nir_alu_type type);
 
 void brw_nir_setup_glsl_uniforms(nir_shader *shader,
-                                 struct gl_shader_program *shader_prog,
                                  const struct gl_program *prog,
                                  struct brw_stage_prog_data *stage_prog_data,
                                  bool is_scalar);
index 2407bac86cce93e7ce01179458810f884228c763..a2e0001e1a361db4ba6413d41c316cf10ca6f747 100644 (file)
@@ -68,7 +68,7 @@ brw_nir_setup_glsl_builtin_uniform(nir_variable *var,
 
 static void
 brw_nir_setup_glsl_uniform(gl_shader_stage stage, nir_variable *var,
-                           struct gl_shader_program *shader_prog,
+                           const struct gl_program *prog,
                            struct brw_stage_prog_data *stage_prog_data,
                            bool is_scalar)
 {
@@ -81,9 +81,9 @@ brw_nir_setup_glsl_uniform(gl_shader_stage stage, nir_variable *var,
     * with our name, or the prefix of a component that starts with our name.
     */
    unsigned uniform_index = var->data.driver_location / 4;
-   for (unsigned u = 0; u < shader_prog->data->NumUniformStorage; u++) {
+   for (unsigned u = 0; u < prog->sh.data->NumUniformStorage; u++) {
       struct gl_uniform_storage *storage =
-         &shader_prog->data->UniformStorage[u];
+         &prog->sh.data->UniformStorage[u];
 
       if (storage->builtin)
          continue;
@@ -131,9 +131,7 @@ brw_nir_setup_glsl_uniform(gl_shader_stage stage, nir_variable *var,
 }
 
 void
-brw_nir_setup_glsl_uniforms(nir_shader *shader,
-                            struct gl_shader_program *shader_prog,
-                            const struct gl_program *prog,
+brw_nir_setup_glsl_uniforms(nir_shader *shader, const struct gl_program *prog,
                             struct brw_stage_prog_data *stage_prog_data,
                             bool is_scalar)
 {
@@ -147,8 +145,8 @@ brw_nir_setup_glsl_uniforms(nir_shader *shader,
          brw_nir_setup_glsl_builtin_uniform(var, prog, stage_prog_data,
                                             is_scalar);
       } else {
-         brw_nir_setup_glsl_uniform(shader->stage, var, shader_prog,
-                                    stage_prog_data, is_scalar);
+         brw_nir_setup_glsl_uniform(shader->stage, var, prog, stage_prog_data,
+                                    is_scalar);
       }
    }
 }
index 1ae116b47d07d04c2b99c244c863d04948e8c9c2..0794f0f5948627095abb7024d0961a6152b2187d 100644 (file)
@@ -218,8 +218,7 @@ brw_codegen_tcs_prog(struct brw_context *brw,
                        tcp->program.info.num_images);
       prog_data.base.base.nr_image_params = tcp->program.info.num_images;
 
-      brw_nir_setup_glsl_uniforms(nir, shader_prog, &tcp->program,
-                                  &prog_data.base.base,
+      brw_nir_setup_glsl_uniforms(nir, &tcp->program, &prog_data.base.base,
                                   compiler->scalar_stage[MESA_SHADER_TESS_CTRL]);
    } else {
       /* Upload the Patch URB Header as the first two uniforms.
index d53c9c36b13d48ca24a015da29405daf9927460a..fbd6081464a0ff94f8118bfa3911a027052b23e4 100644 (file)
@@ -160,8 +160,7 @@ brw_codegen_tes_prog(struct brw_context *brw,
    prog_data.base.base.nr_params = param_count;
    prog_data.base.base.nr_image_params = tep->program.info.num_images;
 
-   brw_nir_setup_glsl_uniforms(nir, shader_prog, &tep->program,
-                               &prog_data.base.base,
+   brw_nir_setup_glsl_uniforms(nir, &tep->program, &prog_data.base.base,
                                compiler->scalar_stage[MESA_SHADER_TESS_EVAL]);
 
    int st_index = -1;
index f9044ebf3e347a92bedec6985a6558b49d46cfcf..70373504c936cfea90d9d775e3e6ba6bb3cf4edc 100644 (file)
@@ -187,7 +187,7 @@ brw_codegen_vs_prog(struct brw_context *brw,
    stage_prog_data->nr_params = param_count;
 
    if (prog) {
-      brw_nir_setup_glsl_uniforms(vp->program.nir, prog, &vp->program,
+      brw_nir_setup_glsl_uniforms(vp->program.nir, &vp->program,
                                   &prog_data.base.base,
                                   compiler->scalar_stage[MESA_SHADER_VERTEX]);
    } else {
index e67208c1ee8ba23dd6d84bada2f440d1c83b1e21..7a2cf9b84d6ed12476c105d874ca0d15c788f2d5 100644 (file)
@@ -174,7 +174,7 @@ brw_codegen_wm_prog(struct brw_context *brw,
    prog_data.base.nr_params = param_count;
 
    if (prog) {
-      brw_nir_setup_glsl_uniforms(fp->program.nir, prog, &fp->program,
+      brw_nir_setup_glsl_uniforms(fp->program.nir, &fp->program,
                                   &prog_data.base, true);
    } else {
       brw_nir_setup_arb_uniforms(fp->program.nir, &fp->program,