summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2015-06-22 11:42:15 -0700
committerMatt Turner <[email protected]>2015-06-23 12:24:42 -0700
commitae097580ac49fbfaf184c89c68cb42b755f62939 (patch)
treebc3bddfc1834e31fc9c5108eb5bc7728248e31ad
parentd8eeb4917ca39a0698731f64933c85a7c44e9247 (diff)
i965: Initialize backend_shader::mem_ctx in its constructor.
We were initializing it in each subclasses' constructors for some reason. Reviewed-by: Jordan Justen <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_visitor.cpp4
-rw-r--r--src/mesa/drivers/dri/i965/brw_shader.cpp2
-rw-r--r--src/mesa/drivers/dri/i965/brw_shader.h1
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp3
4 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index 4770838b26f..dc992dd332e 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -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;
diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index 545ec2679ae..7a26939cbe9 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -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)
{
diff --git a/src/mesa/drivers/dri/i965/brw_shader.h b/src/mesa/drivers/dri/i965/brw_shader.h
index da01d2f7185..e64774901bc 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.h
+++ b/src/mesa/drivers/dri/i965/brw_shader.h
@@ -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,
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 0a76bde7726..669f76973ea 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -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;