use EMIT_1F or EMIT_4F for fog depending on fragment program (bug 10788)
authorBrian <brian@yutani.localnet.net>
Sat, 28 Apr 2007 14:50:07 +0000 (08:50 -0600)
committerBrian <brian@yutani.localnet.net>
Sat, 28 Apr 2007 14:50:07 +0000 (08:50 -0600)
src/mesa/swrast_setup/ss_context.c

index 360cc61cb1422ce53cd26dc4d43c3711eaf43fcb..ccf0eb3d28c8b4586da139c5165c3e21a95651ca 100644 (file)
@@ -131,8 +131,10 @@ setup_vertex_format(GLcontext *ctx)
       if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR_INDEX ))
          EMIT_ATTR( _TNL_ATTRIB_COLOR_INDEX, EMIT_1F, index );
 
-      if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG ))
-         EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F, attrib[FRAG_ATTRIB_FOGC]);
+      if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) {
+         const GLint emit = ctx->FragmentProgram._Current ? EMIT_4F : EMIT_1F;
+         EMIT_ATTR( _TNL_ATTRIB_FOG, emit, attrib[FRAG_ATTRIB_FOGC]);
+      }
 
       if (RENDERINPUTS_TEST_RANGE(index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX))
       {