[Mesa-dev] [PATCH 14/28] i965/blorp: Add a prog_data_init helper

Jason Ekstrand jason at jlekstrand.net
Tue May 10 23:16:34 UTC 2016


---
 src/mesa/drivers/dri/i965/brw_blorp.c         | 8 ++++++++
 src/mesa/drivers/dri/i965/brw_blorp.h         | 2 ++
 src/mesa/drivers/dri/i965/brw_blorp_blit.cpp  | 2 +-
 src/mesa/drivers/dri/i965/brw_blorp_clear.cpp | 2 +-
 4 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
index 247fd75..4bbe45f 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -135,6 +135,14 @@ 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->first_curbe_grf = 0;
+   prog_data->persample_msaa_dispatch = false;
+}
+
+
+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 c5c2c4e..4a0e46e 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.h
+++ b/src/mesa/drivers/dri/i965/brw_blorp.h
@@ -214,6 +214,8 @@ struct brw_blorp_prog_data
    bool persample_msaa_dispatch;
 };
 
+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 897ce99..ed43184 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -632,7 +632,7 @@ brw_blorp_blit_program::compile(struct brw_context *brw, bool debug_flag,
           (key->dst_samples == 0));
 
    /* Set up prog_data */
-   memset(&prog_data, 0, sizeof(prog_data));
+   brw_blorp_prog_data_init(&prog_data);
    prog_data.persample_msaa_dispatch = key->persample_msaa_dispatch;
 
    alloc_regs();
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
index ed537ba..5ed46e1 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
@@ -160,7 +160,7 @@ brw_blorp_const_color_program::compile(struct brw_context *brw,
                                        GLuint *program_size)
 {
    /* Set up prog_data */
-   memset(&prog_data, 0, sizeof(prog_data));
+   brw_blorp_prog_data_init(&prog_data);
    prog_data.persample_msaa_dispatch = false;
 
    alloc_regs();
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list