Mesa (master): r300/compiler: Adapt AllocateHwInputs interface to common usage pattern

Nicolai Hähnle nh at kemper.freedesktop.org
Wed Jul 29 19:15:32 UTC 2009


Module: Mesa
Branch: master
Commit: d3a1fc62f47f1a7f4422585c8c60bf8dcb0dfe4b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d3a1fc62f47f1a7f4422585c8c60bf8dcb0dfe4b

Author: Nicolai Hähnle <nhaehnle at gmail.com>
Date:   Wed Jul 29 19:41:07 2009 +0200

r300/compiler: Adapt AllocateHwInputs interface to common usage pattern

Signed-off-by: Nicolai Hähnle <nhaehnle at gmail.com>

---

 .../drivers/dri/r300/compiler/radeon_compiler.h    |    2 +-
 .../dri/r300/compiler/radeon_program_pair.c        |    2 +-
 src/mesa/drivers/dri/r300/r300_fragprog_common.c   |    7 ++++---
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h
index 5bdc075..e63ab88 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h
@@ -86,7 +86,7 @@ struct r300_fragment_program_compiler {
 
 	void * UserData;
 	void (*AllocateHwInputs)(
-		void * yourdata,
+		struct r300_fragment_program_compiler * c,
 		void (*allocate)(void * data, unsigned input, unsigned hwreg),
 		void * mydata);
 };
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c
index 8cf1f1a..48616ac 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c
@@ -848,7 +848,7 @@ void radeonPairProgram(
 		_mesa_printf("Emit paired program\n");
 
 	scan_instructions(&s);
-	s.Compiler->AllocateHwInputs(s.Compiler->UserData, &alloc_helper, &s);
+	s.Compiler->AllocateHwInputs(s.Compiler, &alloc_helper, &s);
 
 	while(!s.Compiler->Base.Error &&
 	      (s.ReadyTEX || s.ReadyRGB || s.ReadyAlpha || s.ReadyFullALU)) {
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c
index 3bfe8a9..6674efc 100644
--- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c
+++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c
@@ -154,9 +154,11 @@ static void rewriteFog(struct r300_fragment_program_compiler *compiler, struct r
  * @note This allocation is performed explicitly, because the order of inputs
  * is determined by the RS hardware.
  */
-static void allocate_hw_inputs(void * yourdata, void (*allocate)(void * data, unsigned input, unsigned hwreg), void * mydata)
+static void allocate_hw_inputs(
+	struct r300_fragment_program_compiler * c,
+	void (*allocate)(void * data, unsigned input, unsigned hwreg),
+	void * mydata)
 {
-	struct r300_fragment_program_compiler * c = yourdata;
 	GLuint InputsRead = c->Base.Program.InputsRead;
 	int i;
 	GLuint hwindex = 0;
@@ -208,7 +210,6 @@ static void translate_fragment_program(GLcontext *ctx, struct r300_fragment_prog
 	compiler.OutputDepth = FRAG_RESULT_DEPTH;
 	compiler.OutputColor = FRAG_RESULT_COLOR;
 	compiler.AllocateHwInputs = &allocate_hw_inputs;
-	compiler.UserData = &compiler;
 
 	if (compiler.Base.Debug) {
 		fflush(stdout);




More information about the mesa-commit mailing list