[Mesa-dev] [PATCH 29/28] i965/blorp: Get rid of the blorp_prog_data_int() helper

Jason Ekstrand jason at jlekstrand.net
Wed May 11 18:37:10 UTC 2016


The helper was initially created to allow us to set reasonable defaults as
we mutated the brw_blorp_prog_data structure in preparation for NIR.  Now
that everything is going through brw_blorp_compile_nir_shader() which fully
fills out the brw_blorp_prog_data structure, we don't need the helper.
---
 src/mesa/drivers/dri/i965/brw_blorp.c         | 16 ----------------
 src/mesa/drivers/dri/i965/brw_blorp.h         |  2 --
 src/mesa/drivers/dri/i965/brw_blorp_blit.cpp  |  8 ++------
 src/mesa/drivers/dri/i965/brw_blorp_clear.cpp |  2 --
 4 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
index 161fb90..626a750 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -137,22 +137,6 @@ brw_blorp_compute_tile_offsets(const struct brw_blorp_surface_info *info,
 
 
 void
-brw_blorp_prog_data_init(struct brw_blorp_prog_data *prog_data)
-{
-   prog_data->dispatch_8 = false;
-   prog_data->dispatch_16 = true;
-   prog_data->first_curbe_grf_0 = 0;
-   prog_data->first_curbe_grf_2 = 0;
-   prog_data->ksp_offset_2 = 0;
-   prog_data->persample_msaa_dispatch = false;
-
-   prog_data->nr_params = BRW_BLORP_NUM_PUSH_CONSTANT_DWORDS;
-   for (unsigned i = 0; i < BRW_BLORP_NUM_PUSH_CONSTANT_DWORDS; i++)
-      prog_data->param[i] = i;
-}
-
-
-void
 brw_blorp_params_init(struct brw_blorp_params *params)
 {
    memset(params, 0, sizeof(*params));
diff --git a/src/mesa/drivers/dri/i965/brw_blorp.h b/src/mesa/drivers/dri/i965/brw_blorp.h
index 51e7975..9d71ca4 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.h
+++ b/src/mesa/drivers/dri/i965/brw_blorp.h
@@ -234,8 +234,6 @@ struct brw_blorp_prog_data
    uint8_t param[BRW_BLORP_NUM_PUSH_CONSTANT_DWORDS];
 };
 
-void brw_blorp_prog_data_init(struct brw_blorp_prog_data *prog_data);
-
 struct brw_blorp_params
 {
    uint32_t x0;
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index 314034e..455330f 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -1267,8 +1267,7 @@ blorp_nir_manual_blend_bilinear(nir_builder *b, nir_ssa_def *pos,
  */
 static nir_shader *
 brw_blorp_build_nir_shader(struct brw_context *brw,
-                           const brw_blorp_blit_prog_key *key,
-                           struct brw_blorp_prog_data *prog_data)
+                           const brw_blorp_blit_prog_key *key)
 {
    nir_ssa_def *src_pos, *dst_pos, *color;
 
@@ -1312,9 +1311,6 @@ brw_blorp_build_nir_shader(struct brw_context *brw,
    assert((key->dst_layout == INTEL_MSAA_LAYOUT_NONE) ==
           (key->dst_samples == 0));
 
-   /* Set up prog_data */
-   brw_blorp_prog_data_init(prog_data);
-
    nir_builder b;
    nir_builder_init_simple_shader(&b, NULL, MESA_SHADER_FRAGMENT, NULL);
 
@@ -1467,7 +1463,7 @@ brw_blorp_get_blit_kernel(struct brw_context *brw,
    /* Try and compile with NIR first.  If that fails, fall back to the old
     * method of building shaders manually.
     */
-   nir_shader *nir = brw_blorp_build_nir_shader(brw, prog_key, &prog_data);
+   nir_shader *nir = brw_blorp_build_nir_shader(brw, prog_key);
    struct brw_wm_prog_key wm_key;
    brw_blorp_init_wm_prog_key(&wm_key);
    wm_key.tex.compressed_multisample_layout_mask =
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
index 3925d28..fe02301 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
@@ -82,8 +82,6 @@ brw_blorp_params_get_clear_kernel(struct brw_context *brw,
    brw_blorp_init_wm_prog_key(&wm_key);
 
    struct brw_blorp_prog_data prog_data;
-   brw_blorp_prog_data_init(&prog_data);
-
    unsigned program_size;
    const unsigned *program =
       brw_blorp_compile_nir_shader(brw, b.shader, &wm_key, use_replicated_data,
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list