From 54cfe69436c7b4749b01c5f8b74ba3d790ea2657 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 21 Oct 2005 15:22:36 +0000 Subject: fix broken SWZ instruction --- src/mesa/swrast/s_nvfragprog.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa/swrast/s_nvfragprog.c') diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c index 44a3b6d8449..441d1e8ca7d 100644 --- a/src/mesa/swrast/s_nvfragprog.c +++ b/src/mesa/swrast/s_nvfragprog.c @@ -1155,15 +1155,15 @@ execute_program( GLcontext *ctx, GLuint i; /* do extended swizzling here */ - for (i = 0; i < 3; i++) { + for (i = 0; i < 4; i++) { if (GET_SWZ(source->Swizzle, i) == SWIZZLE_ZERO) result[i] = 0.0; else if (GET_SWZ(source->Swizzle, i) == SWIZZLE_ONE) - result[i] = -1.0; + result[i] = 1.0; else - result[i] = -src[GET_SWZ(source->Swizzle, i)]; + result[i] = src[GET_SWZ(source->Swizzle, i)]; - if (source->NegateBase) + if (source->NegateBase & (1 << i)) result[i] = -result[i]; } store_vector4( inst, machine, result ); -- cgit v1.2.3