i965: stop passing gl_shader_program to brw_assign_common_binding_table_offsets()
authorTimothy Arceri <timothy.arceri@collabora.com>
Fri, 4 Nov 2016 22:34:52 +0000 (09:34 +1100)
committerTimothy Arceri <timothy.arceri@collabora.com>
Fri, 6 Jan 2017 00:21:41 +0000 (11:21 +1100)
We now get everything we need directly from gl_program so there is
no need for this.

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_shader.cpp
src/mesa/drivers/dri/i965/brw_shader.h
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 f220846aa2cfe738c945a0cbe825d06bb9c05140..c39637306eb960b507608e5d0eedf2aa69b7c82f 100644 (file)
@@ -36,7 +36,6 @@
 
 static void
 assign_cs_binding_table_offsets(const struct gen_device_info *devinfo,
-                                const struct gl_shader_program *shader_prog,
                                 const struct gl_program *prog,
                                 struct brw_cs_prog_data *prog_data)
 {
@@ -46,8 +45,7 @@ assign_cs_binding_table_offsets(const struct gen_device_info *devinfo,
    prog_data->binding_table.work_groups_start = next_binding_table_offset;
    next_binding_table_offset++;
 
-   brw_assign_common_binding_table_offsets(MESA_SHADER_COMPUTE, devinfo,
-                                           shader_prog, prog, &prog_data->base,
+   brw_assign_common_binding_table_offsets(devinfo, prog, &prog_data->base,
                                            next_binding_table_offset);
 }
 
@@ -81,7 +79,7 @@ brw_codegen_cs_prog(struct brw_context *brw,
       prog_data.base.total_shared = cp->program.info.cs.shared_size;
    }
 
-   assign_cs_binding_table_offsets(devinfo, prog, &cp->program, &prog_data);
+   assign_cs_binding_table_offsets(devinfo, &cp->program, &prog_data);
 
    /* Allocate the references to the uniforms that will end up in the
     * prog_data associated with the compiled program, and which will be freed
index 7886737c7ab1c40d464c681dd3411555e5034df8..53ed07b55b93f2d8d84ee3f045c001a3b3e68bb4 100644 (file)
@@ -74,7 +74,6 @@ brw_gs_debug_recompile(struct brw_context *brw, struct gl_program *prog,
 
 static void
 assign_gs_binding_table_offsets(const struct gen_device_info *devinfo,
-                                const struct gl_shader_program *shader_prog,
                                 const struct gl_program *prog,
                                 struct brw_gs_prog_data *prog_data)
 {
@@ -83,10 +82,8 @@ assign_gs_binding_table_offsets(const struct gen_device_info *devinfo,
     */
    uint32_t reserved = devinfo->gen == 6 ? BRW_MAX_SOL_BINDINGS : 0;
 
-   brw_assign_common_binding_table_offsets(MESA_SHADER_GEOMETRY, devinfo,
-                                           shader_prog, prog,
-                                           &prog_data->base.base,
-                                           reserved);
+   brw_assign_common_binding_table_offsets(devinfo, prog,
+                                           &prog_data->base.base, reserved);
 }
 
 bool
@@ -104,7 +101,7 @@ brw_codegen_gs_prog(struct brw_context *brw,
 
    memset(&prog_data, 0, sizeof(prog_data));
 
-   assign_gs_binding_table_offsets(devinfo, prog, &gp->program, &prog_data);
+   assign_gs_binding_table_offsets(devinfo, &gp->program, &prog_data);
 
    /* Allocate the references to the uniforms that will end up in the
     * prog_data associated with the compiled program, and which will be freed
index cabaf622a6f0a07ce92a8b10b44b50983b33b0cd..a07084364c333adf05f6f8ccfebba2553cb53992 100644 (file)
@@ -1191,19 +1191,13 @@ backend_shader::calculate_cfg()
  * trigger some of our asserts that surface indices are < BRW_MAX_SURFACES.
  */
 uint32_t
-brw_assign_common_binding_table_offsets(gl_shader_stage stage,
-                                        const struct gen_device_info *devinfo,
-                                        const struct gl_shader_program *shader_prog,
+brw_assign_common_binding_table_offsets(const struct gen_device_info *devinfo,
                                         const struct gl_program *prog,
                                         struct brw_stage_prog_data *stage_prog_data,
                                         uint32_t next_binding_table_offset)
 {
-   const struct gl_linked_shader *shader = NULL;
    int num_textures = util_last_bit(prog->SamplersUsed);
 
-   if (shader_prog)
-      shader = shader_prog->_LinkedShaders[stage];
-
    stage_prog_data->binding_table.texture_start = next_binding_table_offset;
    next_binding_table_offset += num_textures;
 
index 6b5ee3719a9a1f1642995adc29ad5443dd8fc413..f6a9d1b58d9af7ecb0beda631e81df94a9952f07 100644 (file)
@@ -272,9 +272,7 @@ struct brw_gs_compile
 };
 
 uint32_t
-brw_assign_common_binding_table_offsets(gl_shader_stage stage,
-                                        const struct gen_device_info *devinfo,
-                                        const struct gl_shader_program *shader_prog,
+brw_assign_common_binding_table_offsets(const struct gen_device_info *devinfo,
                                         const struct gl_program *prog,
                                         struct brw_stage_prog_data *stage_prog_data,
                                         uint32_t next_binding_table_offset);
index 3f8798a82aeba2d72df8aeac015c58642c5301b5..1ae116b47d07d04c2b99c244c863d04948e8c9c2 100644 (file)
@@ -210,8 +210,7 @@ brw_codegen_tcs_prog(struct brw_context *brw,
    prog_data.base.base.nr_params = param_count;
 
    if (tcp) {
-      brw_assign_common_binding_table_offsets(MESA_SHADER_TESS_CTRL, devinfo,
-                                              shader_prog, &tcp->program,
+      brw_assign_common_binding_table_offsets(devinfo, &tcp->program,
                                               &prog_data.base.base, 0);
 
       prog_data.base.base.image_param =
index 9adde20e5ab7550edc202f943e879a85ac48a32f..d53c9c36b13d48ca24a015da29405daf9927460a 100644 (file)
@@ -91,8 +91,7 @@ brw_codegen_tes_prog(struct brw_context *brw,
 
    memset(&prog_data, 0, sizeof(prog_data));
 
-   brw_assign_common_binding_table_offsets(MESA_SHADER_TESS_EVAL, devinfo,
-                                           shader_prog, &tep->program,
+   brw_assign_common_binding_table_offsets(devinfo, &tep->program,
                                            &prog_data.base.base, 0);
 
    switch (tep->program.info.tes.spacing) {
index 24b76a89ab6ccc7126a18f0fe8241594dd18cf24..f9044ebf3e347a92bedec6985a6558b49d46cfcf 100644 (file)
@@ -161,9 +161,8 @@ brw_codegen_vs_prog(struct brw_context *brw,
 
    mem_ctx = ralloc_context(NULL);
 
-   brw_assign_common_binding_table_offsets(MESA_SHADER_VERTEX, devinfo, prog,
-                                           &vp->program, &prog_data.base.base,
-                                           0);
+   brw_assign_common_binding_table_offsets(devinfo, &vp->program,
+                                           &prog_data.base.base, 0);
 
    /* Allocate the references to the uniforms that will end up in the
     * prog_data associated with the compiled program, and which will be freed
index 3a800ad96d9ebf10ae3650630dde7aa481cdba98..e67208c1ee8ba23dd6d84bada2f440d1c83b1e21 100644 (file)
@@ -43,7 +43,6 @@
 
 static void
 assign_fs_binding_table_offsets(const struct gen_device_info *devinfo,
-                                const struct gl_shader_program *shader_prog,
                                 const struct gl_program *prog,
                                 const struct brw_wm_prog_key *key,
                                 struct brw_wm_prog_data *prog_data)
@@ -57,8 +56,7 @@ assign_fs_binding_table_offsets(const struct gen_device_info *devinfo,
    next_binding_table_offset += MAX2(key->nr_color_regions, 1);
 
    next_binding_table_offset =
-      brw_assign_common_binding_table_offsets(MESA_SHADER_FRAGMENT, devinfo,
-                                              shader_prog, prog, &prog_data->base,
+      brw_assign_common_binding_table_offsets(devinfo, prog, &prog_data->base,
                                               next_binding_table_offset);
 
    if (prog->nir->info->outputs_read && !key->coherent_fb_fetch) {
@@ -156,8 +154,7 @@ brw_codegen_wm_prog(struct brw_context *brw,
    if (!prog)
       prog_data.base.use_alt_mode = true;
 
-   assign_fs_binding_table_offsets(devinfo, prog, &fp->program, key,
-                                   &prog_data);
+   assign_fs_binding_table_offsets(devinfo, &fp->program, key, &prog_data);
 
    /* Allocate the references to the uniforms that will end up in the
     * prog_data associated with the compiled program, and which will be freed