draw: fix fog coord export.
authorDave Airlie <airlied@redhat.com>
Sat, 28 Jan 2012 18:29:18 +0000 (18:29 +0000)
committerDave Airlie <airlied@redhat.com>
Sat, 4 Feb 2012 17:50:43 +0000 (17:50 +0000)
This does what we do in the hw drivers, and only export the X.

fixes the fogcoord.dp* tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/auxiliary/draw/draw_vs_exec.c

index eaba4755f53e04d7b5c604177214c6b9272be614..84ce8c1519089220863e6fab7c661f842a14816a 100644 (file)
@@ -168,7 +168,12 @@ vs_exec_run_linear( struct draw_vertex_shader *shader,
                output[slot][2] = CLAMP(machine->Outputs[slot].xyzw[2].f[j], 0.0f, 1.0f);
                output[slot][3] = CLAMP(machine->Outputs[slot].xyzw[3].f[j], 0.0f, 1.0f);
             }
-            else
+            else if (name == TGSI_SEMANTIC_FOG) {
+               output[slot][0] = machine->Outputs[slot].xyzw[0].f[j];
+               output[slot][1] = 0;
+               output[slot][2] = 0;
+               output[slot][3] = 1;
+           } else
             {
                output[slot][0] = machine->Outputs[slot].xyzw[0].f[j];
                output[slot][1] = machine->Outputs[slot].xyzw[1].f[j];