summaryrefslogtreecommitdiff
path: root/src/mesa/main/ffvertex_prog.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-06-11 20:50:26 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-06-11 20:50:26 -0600
commit34ff12ca1fe7153671eea2fe084f3991094ec3ce (patch)
treeefd1eef74db5ff8f8376c92086512843d495a7b4 /src/mesa/main/ffvertex_prog.c
parent11461f52be35d12bfe59ce0e9271cde8f118ed8e (diff)
Revert "mesa: further degenerate the special case lit substitute"
This reverts commit e841b92d9c8bf48085b4996df828ae745977f931. This fixes two specular lighting conform failures.
Diffstat (limited to 'src/mesa/main/ffvertex_prog.c')
-rw-r--r--src/mesa/main/ffvertex_prog.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c
index 06710f405d..d71e0c00fd 100644
--- a/src/mesa/main/ffvertex_prog.c
+++ b/src/mesa/main/ffvertex_prog.c
@@ -975,19 +975,19 @@ static void emit_degenerate_lit( struct tnl_program *p,
{
struct ureg id = get_identity_param(p);
- /* Note that result.x & result.w will not be examined. Note also that
- * dots.xyzw == dots.xxxx.
+ /* 1, 0, 0, 1
*/
+ emit_op1(p, OPCODE_MOV, lit, 0, swizzle(id, Z, X, X, Z));
- /* result[1] = MAX2(in, 0)
+ /* 1, MAX2(in[0], 0), 0, 1
*/
- emit_op2(p, OPCODE_MAX, lit, 0, id, dots);
+ emit_op2(p, OPCODE_MAX, lit, WRITEMASK_Y, lit, swizzle1(dots, X));
- /* result[2] = (in > 0 ? 1 : 0)
+ /* 1, MAX2(in[0], 0), (in[0] > 0 ? 1 : 0), 1
*/
emit_op2(p, OPCODE_SLT, lit, WRITEMASK_Z,
lit, /* 0 */
- dots); /* in[0] */
+ swizzle1(dots, X)); /* in[0] */
}
@@ -1144,13 +1144,10 @@ static void build_lighting( struct tnl_program *p )
/* Calculate dot products:
*/
- if (p->state->material_shininess_is_zero) {
- emit_op2(p, OPCODE_DP3, dots, 0, normal, VPpli);
- }
- else {
- emit_op2(p, OPCODE_DP3, dots, WRITEMASK_X, normal, VPpli);
+ emit_op2(p, OPCODE_DP3, dots, WRITEMASK_X, normal, VPpli);
+
+ if (!p->state->material_shininess_is_zero)
emit_op2(p, OPCODE_DP3, dots, WRITEMASK_Y, normal, half);
- }
/* Front face lighting:
*/