r300: Remove ugly PSIZ hack
authorNicolai Hähnle <nhaehnle@gmail.com>
Fri, 24 Jul 2009 22:50:53 +0000 (00:50 +0200)
committerNicolai Hähnle <nhaehnle@gmail.com>
Mon, 27 Jul 2009 20:51:37 +0000 (22:51 +0200)
Instead of setting Sourced, we simply force writemasks to begin with.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c

index c05b488645b7520091fa8167a2196a9b14877ed2..14dd36354d6ee22f63d5c9f34ff120be51f50f12 100644 (file)
@@ -607,12 +607,8 @@ static void nqssadceInit(struct nqssadce_state* s)
        int i;
 
        for(i = 0; i < VERT_RESULT_MAX; ++i) {
-               if (compiler->RequiredOutputs & (1 << i)) {
-                       if (i != VERT_RESULT_PSIZ)
-                               s->Outputs[i].Sourced = WRITEMASK_XYZW;
-                       else
-                               s->Outputs[i].Sourced = WRITEMASK_X; /* ugly hack! */
-               }
+               if (compiler->RequiredOutputs & (1 << i))
+                       s->Outputs[i].Sourced = WRITEMASK_XYZW;
        }
 }
 
@@ -631,6 +627,8 @@ void r3xx_compile_vertex_program(struct r300_vertex_program_compiler* compiler)
        rc_mesa_to_rc_program(&compiler->Base, compiler->program);
        compiler->program = 0;
 
+       rc_move_output(&compiler->Base, VERT_RESULT_PSIZ, VERT_RESULT_PSIZ, WRITEMASK_X);
+
        if (compiler->state.WPosAttr != FRAG_ATTRIB_MAX) {
                rc_copy_output(&compiler->Base,
                        VERT_RESULT_HPOS,