summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-05-07 15:57:36 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-05-07 15:57:36 +0100
commitffe78987dc01864cdb8f8b74855c3e14cff1c0bb (patch)
tree7c9096f0bc2fc9a8bb7e6a5c46041d49e2d463a3 /src
parent3e1a4c286936abdb4ce1b62a9ebdd93db1777aff (diff)
parentdeceeca18d3a3f18caeac980ad63fafd8bad709c (diff)
Merge commit 'origin/gallium-0.1' into gallium-tex-surfaces
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/ffvertex_prog.c43
1 files changed, 19 insertions, 24 deletions
diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c
index f648d081c0..810af9e33e 100644
--- a/src/mesa/main/ffvertex_prog.c
+++ b/src/mesa/main/ffvertex_prog.c
@@ -946,35 +946,33 @@ static void build_lighting( struct tnl_program *p )
_bfc1 = _bfc0;
}
-
/* If no lights, still need to emit the scenecolor.
*/
- {
- struct ureg res0 = register_output( p, VERT_RESULT_COL0 );
- emit_op1(p, OPCODE_MOV, res0, 0, _col0);
- }
+ {
+ struct ureg res0 = register_output( p, VERT_RESULT_COL0 );
+ emit_op1(p, OPCODE_MOV, res0, 0, _col0);
+ }
- if (separate) {
- struct ureg res1 = register_output( p, VERT_RESULT_COL1 );
- emit_op1(p, OPCODE_MOV, res1, 0, _col1);
- }
+ if (separate) {
+ struct ureg res1 = register_output( p, VERT_RESULT_COL1 );
+ emit_op1(p, OPCODE_MOV, res1, 0, _col1);
+ }
- if (twoside) {
- struct ureg res0 = register_output( p, VERT_RESULT_BFC0 );
- emit_op1(p, OPCODE_MOV, res0, 0, _bfc0);
- }
+ if (twoside) {
+ struct ureg res0 = register_output( p, VERT_RESULT_BFC0 );
+ emit_op1(p, OPCODE_MOV, res0, 0, _bfc0);
+ }
- if (twoside && separate) {
- struct ureg res1 = register_output( p, VERT_RESULT_BFC1 );
- emit_op1(p, OPCODE_MOV, res1, 0, _bfc1);
- }
+ if (twoside && separate) {
+ struct ureg res1 = register_output( p, VERT_RESULT_BFC1 );
+ emit_op1(p, OPCODE_MOV, res1, 0, _bfc1);
+ }
if (nr_lights == 0) {
release_temps(p);
return;
}
-
for (i = 0; i < MAX_LIGHTS; i++) {
if (p->state->unit[i].light_enabled) {
struct ureg half = undef;
@@ -1006,7 +1004,7 @@ static void build_lighting( struct tnl_program *p )
VPpli = get_temp(p);
half = get_temp(p);
- /* Calulate VPpli vector
+ /* Calculate VPpli vector
*/
emit_op2(p, OPCODE_SUB, VPpli, 0, Ppli, V);
@@ -1017,15 +1015,13 @@ static void build_lighting( struct tnl_program *p )
emit_op1(p, OPCODE_RSQ, dist, 0, dist);
emit_op2(p, OPCODE_MUL, VPpli, 0, VPpli, dist);
-
- /* Calculate attenuation:
+ /* Calculate attenuation:
*/
if (!p->state->unit[i].light_spotcutoff_is_180 ||
p->state->unit[i].light_attenuated) {
att = calculate_light_attenuation(p, i, VPpli, dist);
}
-
-
+
/* Calculate viewer direction, or use infinite viewer:
*/
if (p->state->light_local_viewer) {
@@ -1047,7 +1043,6 @@ static void build_lighting( struct tnl_program *p )
emit_op2(p, OPCODE_DP3, dots, WRITEMASK_X, normal, VPpli);
emit_op2(p, OPCODE_DP3, dots, WRITEMASK_Y, normal, half);
-
/* Front face lighting:
*/
{