i965: Initialize backend_shader::mem_ctx in its constructor.
authorMatt Turner <mattst88@gmail.com>
Mon, 22 Jun 2015 18:42:15 +0000 (11:42 -0700)
committerMatt Turner <mattst88@gmail.com>
Tue, 23 Jun 2015 19:24:42 +0000 (12:24 -0700)
We were initializing it in each subclasses' constructors for some
reason.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
src/mesa/drivers/dri/i965/brw_shader.cpp
src/mesa/drivers/dri/i965/brw_shader.h
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp

index 4770838b26fcb34e3aaaaa460f14bf0f2814dcb1..dc992dd332ee9de074f72b9490e308c6eea05bbd 100644 (file)
@@ -1984,13 +1984,11 @@ fs_visitor::fs_visitor(struct brw_context *brw,
                        struct gl_shader_program *shader_prog,
                        struct gl_program *prog,
                        unsigned dispatch_width)
-   : backend_shader(brw, shader_prog, prog, prog_data, stage),
+   : backend_shader(brw, mem_ctx, shader_prog, prog, prog_data, stage),
      key(key), prog_data(prog_data),
      dispatch_width(dispatch_width), promoted_constants(0),
      bld(fs_builder(this, dispatch_width).at_end())
 {
-   this->mem_ctx = mem_ctx;
-
    switch (stage) {
    case MESA_SHADER_FRAGMENT:
       key_tex = &((const brw_wm_prog_key *) key)->tex;
index 545ec2679ae56827077e5867dc600c39fa6856ef..7a26939cbe92ad279d702c4fcb82ed7bb98cbd56 100644 (file)
@@ -757,6 +757,7 @@ brw_abs_immediate(enum brw_reg_type type, struct brw_reg *reg)
 }
 
 backend_shader::backend_shader(struct brw_context *brw,
+                               void *mem_ctx,
                                struct gl_shader_program *shader_prog,
                                struct gl_program *prog,
                                struct brw_stage_prog_data *stage_prog_data,
@@ -769,6 +770,7 @@ backend_shader::backend_shader(struct brw_context *brw,
      shader_prog(shader_prog),
      prog(prog),
      stage_prog_data(stage_prog_data),
+     mem_ctx(mem_ctx),
      cfg(NULL),
      stage(stage)
 {
index da01d2f7185b5295a7c66b05bffa768d50dd00d8..e64774901bc7b2d494375b35e7cdfed857ffe5d7 100644 (file)
@@ -215,6 +215,7 @@ class backend_shader {
 protected:
 
    backend_shader(struct brw_context *brw,
+                  void *mem_ctx,
                   struct gl_shader_program *shader_prog,
                   struct gl_program *prog,
                   struct brw_stage_prog_data *stage_prog_data,
index 0a76bde7726940fa036bcbe9df0a88c850931c31..669f76973ea3df074c6a8a1a9c15576f59895f67 100644 (file)
@@ -3691,7 +3691,7 @@ vec4_visitor::vec4_visitor(struct brw_context *brw,
                            shader_time_shader_type st_base,
                            shader_time_shader_type st_written,
                            shader_time_shader_type st_reset)
-   : backend_shader(brw, shader_prog, prog, &prog_data->base, stage),
+   : backend_shader(brw, mem_ctx, shader_prog, prog, &prog_data->base, stage),
      c(c),
      key(key),
      prog_data(prog_data),
@@ -3704,7 +3704,6 @@ vec4_visitor::vec4_visitor(struct brw_context *brw,
      st_written(st_written),
      st_reset(st_reset)
 {
-   this->mem_ctx = mem_ctx;
    this->failed = false;
 
    this->base_ir = NULL;