i965/vs: Make vec4_vs_visitor class derived from vec4_visitor.
authorPaul Berry <stereotype441@gmail.com>
Sat, 16 Feb 2013 04:12:13 +0000 (20:12 -0800)
committerPaul Berry <stereotype441@gmail.com>
Thu, 11 Apr 2013 16:25:25 +0000 (09:25 -0700)
This patch just creates the derived class; later patches will migrate
VS-specific functions and data structures from the base class into the
derived class.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
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
src/mesa/drivers/dri/i965/test_vec4_register_coalesce.cpp

index 279637ec108a601e3f7d2ac705e351bc8ead5c57..5164411cc4a387a082e32ced2593afc901e91e4f 100644 (file)
@@ -1532,7 +1532,7 @@ brw_vs_emit(struct brw_context *brw,
       }
    }
 
-   vec4_visitor v(brw, c, prog_data, prog, shader, mem_ctx);
+   vec4_vs_visitor v(brw, c, prog_data, prog, shader, mem_ctx);
    if (!v.run()) {
       prog->LinkStatus = false;
       ralloc_strcat(&prog->InfoLog, v.fail_msg);
index cc2b95ff495a3fcf9207f4df339b1005dc62758d..73dd8ec6532ee0f68c99724abeb20851952b28b8 100644 (file)
@@ -486,6 +486,17 @@ public:
    void dump_instructions();
 };
 
+class vec4_vs_visitor : public vec4_visitor
+{
+public:
+   vec4_vs_visitor(struct brw_context *brw,
+                   struct brw_vs_compile *c,
+                   struct brw_vs_prog_data *prog_data,
+                   struct gl_shader_program *prog,
+                   struct brw_shader *shader,
+                   void *mem_ctx);
+};
+
 /**
  * The vertex shader code generator.
  *
index 12f7f02d8b8f01db7e2f60fe45f8117cb2a65dc9..43af033cc9ae21575d28da1cc4936445f50a08e0 100644 (file)
@@ -3033,6 +3033,17 @@ vec4_visitor::~vec4_visitor()
 }
 
 
+vec4_vs_visitor::vec4_vs_visitor(struct brw_context *brw,
+                                 struct brw_vs_compile *c,
+                                 struct brw_vs_prog_data *prog_data,
+                                 struct gl_shader_program *prog,
+                                 struct brw_shader *shader,
+                                 void *mem_ctx)
+   : vec4_visitor(brw, c, prog_data, prog, shader, mem_ctx)
+{
+}
+
+
 void
 vec4_visitor::fail(const char *format, ...)
 {
index fb55714f73f6833316ce703b1317634e1618e1c1..418edd2297816bf65af90126bd453e0d7330cb28 100644 (file)
@@ -42,6 +42,19 @@ public:
    vec4_visitor *v;
 };
 
+
+class register_coalesce_vec4_visitor : public vec4_visitor
+{
+public:
+   register_coalesce_vec4_visitor(struct brw_context *brw,
+                                  struct brw_vs_compile *c,
+                                  struct gl_shader_program *shader_prog)
+      : vec4_visitor(brw, c, NULL, shader_prog, NULL, NULL)
+   {
+   }
+};
+
+
 void register_coalesce_test::SetUp()
 {
    brw = (struct brw_context *)calloc(1, sizeof(*brw));
@@ -53,7 +66,7 @@ void register_coalesce_test::SetUp()
 
    shader_prog = ralloc(NULL, struct gl_shader_program);
 
-   v = new vec4_visitor(brw, c, NULL, shader_prog, NULL, NULL);
+   v = new register_coalesce_vec4_visitor(brw, c, shader_prog);
 
    _mesa_init_vertex_program(ctx, &c->vp->program, GL_VERTEX_SHADER, 0);