summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl
diff options
context:
space:
mode:
authorJouk <[email protected]>2007-10-02 15:17:23 +0200
committerJouk <[email protected]>2007-10-02 15:17:23 +0200
commit584b84256b07e106cd7295495355eb21226465d7 (patch)
tree028d47d265d01f3f96787792fbd41d495d60856c /src/mesa/tnl
parenteb9a5b6d5127858b01ec12672c999e7d25cd7aed (diff)
parentde1d725f442caa4d8ecbac3256b5a33d1f4a1257 (diff)
Merge branch 'master' of git+ssh://[email protected]/git/mesa/mesa
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_draw.c7
-rw-r--r--src/mesa/tnl/t_vp_build.c28
2 files changed, 27 insertions, 8 deletions
diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c
index 5b2b2ae5495..46b8b536a27 100644
--- a/src/mesa/tnl/t_draw.c
+++ b/src/mesa/tnl/t_draw.c
@@ -1,9 +1,8 @@
-
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 7.1
*
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -368,7 +367,7 @@ void _tnl_draw_prims( GLcontext *ctx,
_tnl_draw_prims );
return;
}
- else if (max_index >= max) {
+ else if (max_index > max) {
/* The software TNL pipeline has a fixed amount of storage for
* vertices and it is necessary to split incoming drawing commands
* if they exceed that limit.
diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c
index ee1a2498b32..63f7890205d 100644
--- a/src/mesa/tnl/t_vp_build.c
+++ b/src/mesa/tnl/t_vp_build.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 7.1
*
- * Copyright (C) 2006 Tungsten Graphics All Rights Reserved.
+ * Copyright (C) 2007 Tungsten Graphics All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -457,9 +457,13 @@ static void register_matrix_param5( struct tnl_program *p,
}
+/**
+ * Convert a ureg source register to a prog_src_register.
+ */
static void emit_arg( struct prog_src_register *src,
struct ureg reg )
{
+ assert(reg.file != PROGRAM_OUTPUT);
src->File = reg.file;
src->Index = reg.idx;
src->Swizzle = reg.swz;
@@ -469,9 +473,18 @@ static void emit_arg( struct prog_src_register *src,
src->RelAddr = 0;
}
+/**
+ * Convert a ureg dest register to a prog_dst_register.
+ */
static void emit_dst( struct prog_dst_register *dst,
struct ureg reg, GLuint mask )
{
+ /* Check for legal output register type. UNDEFINED will occur in
+ * instruction that don't produce a result (like END).
+ */
+ assert(reg.file == PROGRAM_TEMPORARY ||
+ reg.file == PROGRAM_OUTPUT ||
+ reg.file == PROGRAM_UNDEFINED);
dst->File = reg.file;
dst->Index = reg.idx;
/* allow zero as a shorthand for xyzw */
@@ -956,13 +969,19 @@ static void build_lighting( struct tnl_program *p )
STATE_POSITION);
struct ureg V = get_eye_position(p);
struct ureg dist = get_temp(p);
+ struct ureg tmpPpli = get_temp(p);
VPpli = get_temp(p);
half = get_temp(p);
- /* Calulate VPpli vector
+ /* In homogeneous object coordinates
+ */
+ emit_op1(p, OPCODE_RCP, dist, 0, swizzle1(Ppli, W));
+ emit_op2(p, OPCODE_MUL, tmpPpli, 0, Ppli, dist);
+
+ /* Calculate VPpli vector
*/
- emit_op2(p, OPCODE_SUB, VPpli, 0, Ppli, V);
+ emit_op2(p, OPCODE_SUB, VPpli, 0, tmpPpli, V);
/* Normalize VPpli. The dist value also used in
* attenuation below.
@@ -994,6 +1013,7 @@ static void build_lighting( struct tnl_program *p )
emit_normalize_vec3(p, half, half);
release_temp(p, dist);
+ release_temp(p, tmpPpli);
}
/* Calculate dot products: