i965: don't swizzle fogcoord if FogOption is FOG_NONE.
authorXiang, Haihao <haihao.xiang@intel.com>
Fri, 15 Feb 2008 08:13:11 +0000 (16:13 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Fri, 15 Feb 2008 08:13:11 +0000 (16:13 +0800)
fix #10788 issue on 965.

src/mesa/drivers/dri/i965/brw_vs_tnl.c

index b8231fc1d2ffc0b193a78efbbf4e358b318c835b..d58fd4c0da29f6abc868e49278c029d9bb7acb01 100644 (file)
@@ -1172,6 +1172,11 @@ static void build_fog( struct tnl_program *p )
    }
    else {
       input = swizzle1(register_input(p, VERT_ATTRIB_FOG), X);
+      if (p->state->fog_option &&
+         p->state->tnl_do_vertex_fog)
+         input = swizzle1(register_input(p, VERT_ATTRIB_FOG), X);
+      else
+         input = register_input(p, VERT_ATTRIB_FOG);
    }
 
    if (p->state->fog_option &&