i965: Rename backend_visitor::prog to shader_prog.
authorPaul Berry <stereotype441@gmail.com>
Tue, 9 Apr 2013 00:17:44 +0000 (17:17 -0700)
committerPaul Berry <stereotype441@gmail.com>
Thu, 11 Apr 2013 16:25:24 +0000 (09:25 -0700)
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.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs.cpp
src/mesa/drivers/dri/i965/brw_fs.h
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
src/mesa/drivers/dri/i965/brw_shader.h
src/mesa/drivers/dri/i965/brw_vec4.cpp
src/mesa/drivers/dri/i965/brw_vec4.h
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp

index c12ba4571a9339dfab26685d763f525516031702..4338ae6db0e7dc093210191e29abc72d2aad06e3 100644 (file)
@@ -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 &&
index 60e3e0a9c5be45c060b443e29a60f58323685985..115a878d99ac16dceda78cb8223cd80c0f112960 100644 (file)
@@ -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();
index d54d13410ae112f4d0645c9101988f700d27d8ae..422816d5abd6e7e982bcd1ad900e0ce9c7f07d0c 100644 (file)
@@ -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;
index 9d21d8f5eb8ebf476db5535af103c92165d2b857..a29618f734390e9b79d379ea5f208b2e93f4acac 100644 (file)
@@ -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;
index 67dd17a45e32a7d4b4e8c276c8771822ca1059be..672beb78a054516c5c863d986857f4098518252d 100644 (file)
@@ -1376,8 +1376,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));
index e286925a0ea060cfe2cc331099143573e1fa1f9d..10f0c9d7abc2fffaa022f69ab5fda896758ac3c1 100644 (file)
@@ -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();
index ed8e65deb33349758013f2de3e42de77a16909df..20b5330de43c0d9c6a0d8ccc8fef1470236391bd 100644 (file)
@@ -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);
@@ -2984,7 +2985,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)
 {
@@ -2992,7 +2993,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;