[Mesa-dev] [PATCH v2 01/19] i965: Rename backend_visitor::prog to shader_prog.
Paul Berry
stereotype441 at gmail.com
Tue Apr 9 15:11:04 PDT 2013
The next patch is going to change the type of vec4_visitor::vp from
struct gl_vertex_program * to struct gl_program *, and rename it. The
sensible name to change it to is vec4_visitor::prog. However, prog is
already used in backend_visitor (which vec4_visitor derives from).
Since backend_visitor::prog is of type struct gl_shader_program *, it
makes sense to rename it to shader_prog.
---
src/mesa/drivers/dri/i965/brw_fs.cpp | 8 ++++----
src/mesa/drivers/dri/i965/brw_fs.h | 2 +-
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 12 +++++++-----
src/mesa/drivers/dri/i965/brw_shader.h | 2 +-
src/mesa/drivers/dri/i965/brw_vec4.cpp | 4 ++--
src/mesa/drivers/dri/i965/brw_vec4.h | 2 +-
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 11 ++++++-----
7 files changed, 22 insertions(+), 19 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index c12ba45..4338ae6 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -616,8 +616,8 @@ void
fs_visitor::emit_shader_time_write(enum shader_time_shader_type type,
fs_reg value)
{
- int shader_time_index = brw_get_shader_time_index(brw, prog, &fp->Base,
- type);
+ int shader_time_index =
+ brw_get_shader_time_index(brw, shader_prog, &fp->Base, type);
fs_reg offset = fs_reg(shader_time_index * SHADER_TIME_STRIDE);
fs_reg payload;
@@ -852,8 +852,8 @@ fs_visitor::setup_uniform_values(ir_variable *ir)
* with our name, or the prefix of a component that starts with our name.
*/
unsigned params_before = c->prog_data.nr_params;
- for (unsigned u = 0; u < prog->NumUserUniformStorage; u++) {
- struct gl_uniform_storage *storage = &prog->UniformStorage[u];
+ for (unsigned u = 0; u < shader_prog->NumUserUniformStorage; u++) {
+ struct gl_uniform_storage *storage = &shader_prog->UniformStorage[u];
if (strncmp(ir->name, storage->name, namelen) != 0 ||
(storage->name[namelen] != 0 &&
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index 60e3e0a..115a878 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -223,7 +223,7 @@ public:
fs_visitor(struct brw_context *brw,
struct brw_wm_compile *c,
- struct gl_shader_program *prog,
+ struct gl_shader_program *shader_prog,
struct gl_fragment_program *fp,
unsigned dispatch_width);
~fs_visitor();
diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
index d54d134..422816d 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
@@ -1361,7 +1361,8 @@ fs_visitor::visit(ir_texture *ir)
{
fs_inst *inst = NULL;
- int sampler = _mesa_get_sampler_uniform_value(ir->sampler, prog, &fp->Base);
+ int sampler =
+ _mesa_get_sampler_uniform_value(ir->sampler, shader_prog, &fp->Base);
/* FINISHME: We're failing to recompile our programs when the sampler is
* updated. This only matters for the texture rectangle scale parameters
* (pre-gen6, or gen6+ with GL_CLAMP).
@@ -2371,7 +2372,7 @@ fs_visitor::resolve_bool_comparison(ir_rvalue *rvalue, fs_reg *reg)
fs_visitor::fs_visitor(struct brw_context *brw,
struct brw_wm_compile *c,
- struct gl_shader_program *prog,
+ struct gl_shader_program *shader_prog,
struct gl_fragment_program *fp,
unsigned dispatch_width)
: dispatch_width(dispatch_width)
@@ -2379,12 +2380,13 @@ fs_visitor::fs_visitor(struct brw_context *brw,
this->c = c;
this->brw = brw;
this->fp = fp;
- this->prog = prog;
+ this->shader_prog = shader_prog;
this->intel = &brw->intel;
this->ctx = &intel->ctx;
this->mem_ctx = ralloc_context(NULL);
- if (prog)
- shader = (struct brw_shader *) prog->_LinkedShaders[MESA_SHADER_FRAGMENT];
+ if (shader_prog)
+ shader = (struct brw_shader *)
+ shader_prog->_LinkedShaders[MESA_SHADER_FRAGMENT];
else
shader = NULL;
this->failed = false;
diff --git a/src/mesa/drivers/dri/i965/brw_shader.h b/src/mesa/drivers/dri/i965/brw_shader.h
index 9d21d8f..a29618f 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.h
+++ b/src/mesa/drivers/dri/i965/brw_shader.h
@@ -42,7 +42,7 @@ public:
struct intel_context *intel;
struct gl_context *ctx;
struct brw_shader *shader;
- struct gl_shader_program *prog;
+ struct gl_shader_program *shader_prog;
/** ralloc context for temporary data used during compile */
void *mem_ctx;
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index c58fb44..c05970a 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -1363,8 +1363,8 @@ void
vec4_visitor::emit_shader_time_write(enum shader_time_shader_type type,
src_reg value)
{
- int shader_time_index = brw_get_shader_time_index(brw, prog, &vp->Base,
- type);
+ int shader_time_index =
+ brw_get_shader_time_index(brw, shader_prog, &vp->Base, type);
dst_reg dst =
dst_reg(this, glsl_type::get_array_instance(glsl_type::vec4_type, 2));
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h
index 8f130e1..ff9f5ab 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.h
+++ b/src/mesa/drivers/dri/i965/brw_vec4.h
@@ -211,7 +211,7 @@ class vec4_visitor : public backend_visitor
public:
vec4_visitor(struct brw_context *brw,
struct brw_vs_compile *c,
- struct gl_shader_program *prog,
+ struct gl_shader_program *shader_prog,
struct brw_shader *shader,
void *mem_ctx);
~vec4_visitor();
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index ca1cfe8..9eacd83 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -586,8 +586,8 @@ vec4_visitor::setup_uniform_values(ir_variable *ir)
* order we'd walk the type, so walk the list of storage and find anything
* with our name, or the prefix of a component that starts with our name.
*/
- for (unsigned u = 0; u < prog->NumUserUniformStorage; u++) {
- struct gl_uniform_storage *storage = &prog->UniformStorage[u];
+ for (unsigned u = 0; u < shader_prog->NumUserUniformStorage; u++) {
+ struct gl_uniform_storage *storage = &shader_prog->UniformStorage[u];
if (strncmp(ir->name, storage->name, namelen) != 0 ||
(storage->name[namelen] != 0 &&
@@ -2077,7 +2077,8 @@ vec4_visitor::visit(ir_call *ir)
void
vec4_visitor::visit(ir_texture *ir)
{
- int sampler = _mesa_get_sampler_uniform_value(ir->sampler, prog, &vp->Base);
+ int sampler =
+ _mesa_get_sampler_uniform_value(ir->sampler, shader_prog, &vp->Base);
/* Should be lowered by do_lower_texture_projection */
assert(!ir->projector);
@@ -2974,7 +2975,7 @@ vec4_visitor::resolve_ud_negate(src_reg *reg)
vec4_visitor::vec4_visitor(struct brw_context *brw,
struct brw_vs_compile *c,
- struct gl_shader_program *prog,
+ struct gl_shader_program *shader_prog,
struct brw_shader *shader,
void *mem_ctx)
{
@@ -2982,7 +2983,7 @@ vec4_visitor::vec4_visitor(struct brw_context *brw,
this->brw = brw;
this->intel = &brw->intel;
this->ctx = &intel->ctx;
- this->prog = prog;
+ this->shader_prog = shader_prog;
this->shader = shader;
this->mem_ctx = mem_ctx;
--
1.8.2.1
More information about the mesa-dev
mailing list