diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2005-10-21 15:22:36 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2005-10-21 15:22:36 +0000 |
commit | 54cfe69436c7b4749b01c5f8b74ba3d790ea2657 (patch) | |
tree | 4591a928aa38f0177d1ff54c75e59ed9eebef411 /src/mesa/swrast/s_nvfragprog.c | |
parent | b3f2e1503530383de98dfa8e35c24c7b38a37b63 (diff) |
fix broken SWZ instruction
Diffstat (limited to 'src/mesa/swrast/s_nvfragprog.c')
-rw-r--r-- | src/mesa/swrast/s_nvfragprog.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c index 44a3b6d844..441d1e8ca7 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 ); |