summaryrefslogtreecommitdiff
path: root/src/mesa/shader/prog_execute.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-04-14 22:14:30 -0600
committerBrian Paul <brianp@vmware.com>2009-04-14 22:14:30 -0600
commit7db7ff878d3e5a6b345228e6eaee4797bb68b360 (patch)
tree9dbdcfc3d9bc37d88f7e86f22f7c8f18b9420b14 /src/mesa/shader/prog_execute.c
parent0115a4f8f1952b166eaad09f317ff8bc465e0f28 (diff)
mesa: merge the prog_src_register::NegateBase and NegateAbs fields
There's really no need for two negation fields. This came from the GL_NV_fragment_program extension. The new, unified Negate bitfield applies after the absolute value step.
Diffstat (limited to 'src/mesa/shader/prog_execute.c')
-rw-r--r--src/mesa/shader/prog_execute.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c
index bdac1d4f8a..68a59350a1 100644
--- a/src/mesa/shader/prog_execute.c
+++ b/src/mesa/shader/prog_execute.c
@@ -212,19 +212,14 @@ fetch_vector4(const struct prog_src_register *source,
result[3] = src[GET_SWZ(source->Swizzle, 3)];
}
- if (source->NegateBase) {
- result[0] = -result[0];
- result[1] = -result[1];
- result[2] = -result[2];
- result[3] = -result[3];
- }
if (source->Abs) {
result[0] = FABSF(result[0]);
result[1] = FABSF(result[1]);
result[2] = FABSF(result[2]);
result[3] = FABSF(result[3]);
}
- if (source->NegateAbs) {
+ if (source->Negate) {
+ ASSERT(source->Negate == NEGATE_XYZW);
result[0] = -result[0];
result[1] = -result[1];
result[2] = -result[2];
@@ -259,7 +254,7 @@ fetch_vector4ui(const struct prog_src_register *source,
result[3] = src[GET_SWZ(source->Swizzle, 3)];
}
- /* Note: no NegateBase, Abs, NegateAbs here */
+ /* Note: no Negate or Abs here */
}
@@ -299,19 +294,14 @@ fetch_vector4_deriv(GLcontext * ctx,
result[2] = deriv[GET_SWZ(source->Swizzle, 2)];
result[3] = deriv[GET_SWZ(source->Swizzle, 3)];
- if (source->NegateBase) {
- result[0] = -result[0];
- result[1] = -result[1];
- result[2] = -result[2];
- result[3] = -result[3];
- }
if (source->Abs) {
result[0] = FABSF(result[0]);
result[1] = FABSF(result[1]);
result[2] = FABSF(result[2]);
result[3] = FABSF(result[3]);
}
- if (source->NegateAbs) {
+ if (source->Negate) {
+ ASSERT(source->Negate == NEGATE_XYZW);
result[0] = -result[0];
result[1] = -result[1];
result[2] = -result[2];
@@ -336,13 +326,10 @@ fetch_vector1(const struct prog_src_register *source,
result[0] = src[GET_SWZ(source->Swizzle, 0)];
- if (source->NegateBase) {
- result[0] = -result[0];
- }
if (source->Abs) {
result[0] = FABSF(result[0]);
}
- if (source->NegateAbs) {
+ if (source->Negate) {
result[0] = -result[0];
}
}
@@ -1514,7 +1501,7 @@ _mesa_execute_program(GLcontext * ctx,
ASSERT(swz <= 3);
result[i] = src[swz];
}
- if (source->NegateBase & (1 << i))
+ if (source->Negate & (1 << i))
result[i] = -result[i];
}
store_vector4(inst, machine, result);