[Mesa-dev] [PATCH 07/17] i965/vs: Make vec4_vs_visitor class derived from vec4_visitor.
Paul Berry
stereotype441 at gmail.com
Sun Apr 7 15:54:00 PDT 2013
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.
---
src/mesa/drivers/dri/i965/brw_vec4.cpp | 2 +-
src/mesa/drivers/dri/i965/brw_vec4.h | 11 +++++++++++
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 11 +++++++++++
src/mesa/drivers/dri/i965/test_vec4_register_coalesce.cpp | 15 ++++++++++++++-
4 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index eadbd9b..c88d373 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -1518,7 +1518,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);
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h
index c7d08c4..f3c500a 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.h
+++ b/src/mesa/drivers/dri/i965/brw_vec4.h
@@ -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.
*
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index 68d7bb2..fabab5c 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -3022,6 +3022,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, ...)
{
diff --git a/src/mesa/drivers/dri/i965/test_vec4_register_coalesce.cpp b/src/mesa/drivers/dri/i965/test_vec4_register_coalesce.cpp
index fb55714..48d55fd 100644
--- a/src/mesa/drivers/dri/i965/test_vec4_register_coalesce.cpp
+++ b/src/mesa/drivers/dri/i965/test_vec4_register_coalesce.cpp
@@ -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 *prog)
+ : vec4_visitor(brw, c, NULL, 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);
--
1.8.2
More information about the mesa-dev
mailing list