r300/compiler: Adapt AllocateHwInputs interface to common usage pattern
authorNicolai Hähnle <nhaehnle@gmail.com>
Wed, 29 Jul 2009 17:41:07 +0000 (19:41 +0200)
committerNicolai Hähnle <nhaehnle@gmail.com>
Wed, 29 Jul 2009 19:15:00 +0000 (21:15 +0200)
Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
src/mesa/drivers/dri/r300/compiler/radeon_compiler.h
src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c
src/mesa/drivers/dri/r300/r300_fragprog_common.c

index 5bdc07544700b90f5c1abeb270616a3bc44cd4dd..e63ab8840abbfc104cdbc39f08d2280b8aa088fe 100644 (file)
@@ -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);
 };
index 8cf1f1aaac20cf0b6b15b80d7634cb3693111d25..48616ac461cbd2dd0654bc86e7248497a40fdea6 100644 (file)
@@ -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)) {
index 3bfe8a9dedee62468a95a7ad1262fd8f7050ea79..6674efc5bcaa8d89d6da6c5b7ee9e30ec26e67f4 100644 (file)
@@ -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);