mesa: pre-swizzle normal scale state value
authorKeith Whitwell <keith@tungstengraphics.com>
Sat, 24 May 2008 12:23:06 +0000 (13:23 +0100)
committerKeith Whitwell <keith@tungstengraphics.com>
Sat, 24 May 2008 12:23:06 +0000 (13:23 +0100)
src/mesa/main/ffvertex_prog.c
src/mesa/shader/prog_statevars.c

index e36f1f69a409014aaead738bfcace860a62634d5..7a099b23767b08a10dc503c658dd2d0ff07fde1d 100644 (file)
@@ -775,8 +775,7 @@ static struct ureg get_transformed_normal( struct tnl_program *p )
         struct ureg rescale = register_param2(p, STATE_INTERNAL,
                                                STATE_NORMAL_SCALE);
 
-        emit_op2( p, OPCODE_MUL, transformed_normal, 0, normal,
-                  swizzle1(rescale, X));
+        emit_op2( p, OPCODE_MUL, transformed_normal, 0, normal, rescale );
          normal = transformed_normal;
       }
       
index 37bd17ba4a0f58051c41109cac1fd4713e5bf30e..44fbfdcd041f845546be3d058a4addbc8d9f8950 100644 (file)
@@ -397,7 +397,11 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[],
    case STATE_INTERNAL:
       switch (state[1]) {
       case STATE_NORMAL_SCALE:
-         ASSIGN_4V(value, ctx->_ModelViewInvScale, 0, 0, 1);
+         ASSIGN_4V(value, 
+                   ctx->_ModelViewInvScale, 
+                   ctx->_ModelViewInvScale, 
+                   ctx->_ModelViewInvScale, 
+                   1);
          return;
       case STATE_TEXRECT_SCALE:
          {