summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl/t_pipeline.c
diff options
context:
space:
mode:
authorJouk Jansen <[email protected]>2000-11-22 07:32:16 +0000
committerJouk Jansen <[email protected]>2000-11-22 07:32:16 +0000
commit5e3bc0c2a2bcdf59949410f94c9b705fc1281ce8 (patch)
treeee6c08673fe9a228afc6960699a3dfff32e9cbab /src/mesa/tnl/t_pipeline.c
parentfbe3726050f2cd69694df9f24986e951b4c2737e (diff)
Committing in .
Modified Files: Mesa/macos/gli_api/gliapi1.h Mesa/macos/gli_api/gliapi2.h Mesa/macos/gli_api/gliapiext.h Mesa/macos/src-gli/fxgli.c Mesa/macos/src-gli/fxgli.h Mesa/macos/src-gli/fxgli2.c Mesa/macos/src-gli/fxgli_tridebug.c Mesa/src/accum.c Mesa/src/accum.h Mesa/src/all.h Mesa/src/alpha.c Mesa/src/alpha.h Mesa/src/attrib.c Mesa/src/attrib.h Mesa/src/bitmap.c Mesa/src/bitmap.h Mesa/src/blend.c Mesa/src/blend.h Mesa/src/buffers.c Mesa/src/buffers.h Mesa/src/clip.c Mesa/src/clip.h Mesa/src/colortab.h Mesa/src/config.c Mesa/src/context.c Mesa/src/context.h Mesa/src/convolve.c Mesa/src/convolve.h Mesa/src/copypix.c Mesa/src/copypix.h Mesa/src/debug.c Mesa/src/depth.c Mesa/src/depth.h Mesa/src/dlist.c Mesa/src/dlist.h Mesa/src/drawpix.c Mesa/src/drawpix.h Mesa/src/enable.c Mesa/src/enable.h Mesa/src/eval.c Mesa/src/eval.h Mesa/src/extensions.c Mesa/src/extensions.h Mesa/src/feedback.c Mesa/src/feedback.h Mesa/src/fog.c Mesa/src/fog.h Mesa/src/get.c Mesa/src/get.h Mesa/src/glapi.c Mesa/src/glthread.h Mesa/src/highpc.c Mesa/src/hint.h Mesa/src/histogram.h Mesa/src/image.c Mesa/src/image.h Mesa/src/imports.c Mesa/src/light.c Mesa/src/light.h Mesa/src/lines.c Mesa/src/lines.h Mesa/src/logic.c Mesa/src/logic.h Mesa/src/masking.c Mesa/src/masking.h Mesa/src/matrix.c Mesa/src/matrix.h Mesa/src/pixel.c Mesa/src/pixel.h Mesa/src/points.c Mesa/src/points.h Mesa/src/polygon.c Mesa/src/polygon.h Mesa/src/rastpos.c Mesa/src/readpix.c Mesa/src/scissor.c Mesa/src/scissor.h Mesa/src/state.c Mesa/src/state.h Mesa/src/stencil.c Mesa/src/stencil.h Mesa/src/teximage.c Mesa/src/teximage.h Mesa/src/texobj.c Mesa/src/texobj.h Mesa/src/texstate.c Mesa/src/texstate.h Mesa/src/texture.c Mesa/src/texture.h Mesa/src/texutil.c Mesa/src/texutil.h Mesa/src/varray.c Mesa/src/varray.h Mesa/src/X/fakeglx.c Mesa/src/X/xm_api.c Mesa/src/X/xm_dd.c Mesa/src/X/xm_line.c Mesa/src/X/xm_span.c Mesa/src/X/xm_tri.c Mesa/src/swrast/s_aaline.c Mesa/src/swrast/s_aaline.h Mesa/src/swrast/s_aatriangle.h Mesa/src/swrast/s_accum.h Mesa/src/swrast/s_alpha.h Mesa/src/swrast/s_alphabuf.h Mesa/src/swrast/s_blend.h Mesa/src/swrast/s_context.c Mesa/src/swrast/s_context.h Mesa/src/swrast/s_depth.h Mesa/src/swrast/s_drawpix.h Mesa/src/swrast/s_feedback.h Mesa/src/swrast/s_fog.h Mesa/src/swrast/s_histogram.h Mesa/src/swrast/s_lines.h Mesa/src/swrast/s_logic.h Mesa/src/swrast/s_masking.h Mesa/src/swrast/s_pb.h Mesa/src/swrast/s_pixeltex.h Mesa/src/swrast/s_points.h Mesa/src/swrast/s_quads.c Mesa/src/swrast/s_quads.h Mesa/src/swrast/s_scissor.h Mesa/src/swrast/s_span.h Mesa/src/swrast/s_stencil.h Mesa/src/swrast/s_texture.h Mesa/src/swrast/s_triangle.h Mesa/src/swrast/s_zoom.h Mesa/src/swrast/swrast.h Mesa/src/swrast_setup/ss_context.h Mesa/src/swrast_setup/ss_triangle.c Mesa/src/swrast_setup/ss_triangle.h Mesa/src/swrast_setup/ss_vb.h Mesa/src/tnl/t_clip.c Mesa/src/tnl/t_clip.h Mesa/src/tnl/t_context.c Mesa/src/tnl/t_context.h Mesa/src/tnl/t_cva.c Mesa/src/tnl/t_cva.h Mesa/src/tnl/t_debug.c Mesa/src/tnl/t_debug.h Mesa/src/tnl/t_dlist.h Mesa/src/tnl/t_eval.c Mesa/src/tnl/t_eval.h Mesa/src/tnl/t_fog.c Mesa/src/tnl/t_fog.h Mesa/src/tnl/t_light.c Mesa/src/tnl/t_light.h Mesa/src/tnl/t_pipeline.c Mesa/src/tnl/t_pipeline.h Mesa/src/tnl/t_shade.c Mesa/src/tnl/t_shade.h Mesa/src/tnl/t_stages.c Mesa/src/tnl/t_stages.h Mesa/src/tnl/t_texture.c Mesa/src/tnl/t_texture.h Mesa/src/tnl/t_trans_elt.c Mesa/src/tnl/t_trans_elt.h Mesa/src/tnl/t_varray.c Mesa/src/tnl/t_varray.h Mesa/src/tnl/t_vb.c Mesa/src/tnl/t_vb.h Mesa/src/tnl/t_vbcull.c Mesa/src/tnl/t_vbcull.h Mesa/src/tnl/t_vbfill.c Mesa/src/tnl/t_vbfill.h Mesa/src/tnl/t_vbindirect.c Mesa/src/tnl/t_vbindirect.h Mesa/src/tnl/t_vbrender.c Mesa/src/tnl/t_vbrender.h Mesa/src/tnl/t_vbxform.c Mesa/src/tnl/t_vbxform.h Mesa/src/tnl/tnl.h Added Files: Mesa/src/mtypes.h Removed Files: Mesa/src/types.h Changed Mesa/src/types to Mesa/src/mtypes.h to avoid conflicts while compiling on a VMS system. ----------------------------------------------------------------------
Diffstat (limited to 'src/mesa/tnl/t_pipeline.c')
-rw-r--r--src/mesa/tnl/t_pipeline.c112
1 files changed, 56 insertions, 56 deletions
diff --git a/src/mesa/tnl/t_pipeline.c b/src/mesa/tnl/t_pipeline.c
index f323885422c..d61f63f9b3d 100644
--- a/src/mesa/tnl/t_pipeline.c
+++ b/src/mesa/tnl/t_pipeline.c
@@ -1,21 +1,21 @@
-/* $Id: t_pipeline.c,v 1.2 2000/11/20 18:06:13 brianp Exp $ */
+/* $Id: t_pipeline.c,v 1.3 2000/11/22 07:32:18 joukj Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
- *
+ *
* Copyright (C) 1999-2000 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"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
+ *
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
@@ -33,7 +33,7 @@
#include "mem.h"
#include "mmath.h"
#include "state.h"
-#include "types.h"
+#include "mtypes.h"
#include "math/m_translate.h"
#include "math/m_xform.h"
@@ -57,7 +57,7 @@
void gl_print_pipe_ops( const char *msg, GLuint flags )
{
- fprintf(stderr,
+ fprintf(stderr,
"%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s\n",
msg,
flags,
@@ -86,9 +86,9 @@ void gl_reset_cva_vb( struct vertex_buffer *VB, GLuint stages )
TNLcontext *tnl = TNL_CONTEXT(ctx);
if (MESA_VERBOSE&VERBOSE_PIPELINE)
- gl_print_pipe_ops( "reset cva vb", stages );
+ gl_print_pipe_ops( "reset cva vb", stages );
- if (stages & PIPE_OP_VERT_XFORM)
+ if (stages & PIPE_OP_VERT_XFORM)
{
if (VB->ClipOrMask & CLIP_USER_BIT)
MEMSET(VB->UserClipMask, 0, VB->Count);
@@ -104,18 +104,18 @@ void gl_reset_cva_vb( struct vertex_buffer *VB, GLuint stages )
VB->NormalPtr = &tnl->CVA.v.Normal;
}
- if (stages & PIPE_OP_LIGHT)
+ if (stages & PIPE_OP_LIGHT)
{
VB->ColorPtr = VB->Color[0] = VB->Color[1] = &tnl->CVA.v.Color;
VB->IndexPtr = VB->Index[0] = VB->Index[1] = &tnl->CVA.v.Index;
}
- else if (stages & PIPE_OP_FOG)
+ else if (stages & PIPE_OP_FOG)
{
if (ctx->Light.Enabled) {
VB->Color[0] = VB->LitColor[0];
- VB->Color[1] = VB->LitColor[1];
+ VB->Color[1] = VB->LitColor[1];
VB->Index[0] = VB->LitIndex[0];
- VB->Index[1] = VB->LitIndex[1];
+ VB->Index[1] = VB->LitIndex[1];
} else {
VB->Color[0] = VB->Color[1] = &tnl->CVA.v.Color;
VB->Index[0] = VB->Index[1] = &tnl->CVA.v.Index;
@@ -142,7 +142,7 @@ static void pipeline_ctr( struct gl_pipeline *p, GLcontext *ctx, GLuint type )
p->type = type;
p->ops = 0;
- for (i = 0 ; i < gl_default_nr_stages ; i++)
+ for (i = 0 ; i < gl_default_nr_stages ; i++)
p->state_change |= gl_default_pipeline[i].state_change;
}
@@ -151,12 +151,12 @@ void _tnl_pipeline_init( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
- MEMCPY( tnl->PipelineStage,
- gl_default_pipeline,
+ MEMCPY( tnl->PipelineStage,
+ gl_default_pipeline,
sizeof(*gl_default_pipeline) * gl_default_nr_stages );
-
+
tnl->NrPipelineStages = gl_default_nr_stages;
-
+
pipeline_ctr( &tnl->CVA.elt, ctx, PIPE_IMMEDIATE);
pipeline_ctr( &tnl->CVA.pre, ctx, PIPE_PRECALC );
}
@@ -189,16 +189,16 @@ static void build_full_precalc_pipeline( GLcontext *ctx )
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct gl_pipeline_stage *pipeline = tnl->PipelineStage;
struct gl_cva *cva = &tnl->CVA;
- struct gl_pipeline *pre = &cva->pre;
+ struct gl_pipeline *pre = &cva->pre;
struct gl_pipeline_stage **stages = pre->stages;
GLuint i;
GLuint newstate = pre->new_state;
GLuint changed_ops = 0;
GLuint oldoutputs = pre->outputs;
GLuint oldinputs = pre->inputs;
- GLuint fallback = (VERT_CURRENT_DATA & tnl->_CurrentFlag &
+ GLuint fallback = (VERT_CURRENT_DATA & tnl->_CurrentFlag &
~tnl->_ArraySummary);
- GLuint changed_outputs = (tnl->_ArrayNewState |
+ GLuint changed_outputs = (tnl->_ArrayNewState |
(fallback & cva->orflag));
GLuint available = fallback | tnl->_ArrayFlags;
@@ -213,12 +213,12 @@ static void build_full_precalc_pipeline( GLcontext *ctx )
*/
newstate = ~0;
- if (tnl->_ArraySummary & VERT_ELT)
+ if (tnl->_ArraySummary & VERT_ELT)
cva->orflag &= VERT_MATERIAL;
-
+
cva->orflag &= ~(tnl->_ArraySummary & ~VERT_OBJ_ANY);
available &= ~cva->orflag;
-
+
pre->outputs = available;
pre->inputs = available;
@@ -226,8 +226,8 @@ static void build_full_precalc_pipeline( GLcontext *ctx )
fprintf(stderr, ": Rebuild pipeline\n");
gl_print_vert_flags("orflag", cva->orflag);
}
-
-
+
+
/* If something changes in the pipeline, tag all subsequent stages
* using this value for recalcuation. Also used to build the full
@@ -237,16 +237,16 @@ static void build_full_precalc_pipeline( GLcontext *ctx )
* are enough to fully specify what needs to be calculated, and a
* single pass identifies all stages requiring recalculation.
*/
- for (i = 0 ; i < tnl->NrPipelineStages ; i++)
+ for (i = 0 ; i < tnl->NrPipelineStages ; i++)
{
pipeline[i].check(ctx, &pipeline[i]);
- if (pipeline[i].type & PIPE_PRECALC)
+ if (pipeline[i].type & PIPE_PRECALC)
{
if ((newstate & pipeline[i].cva_state_change) ||
(changed_outputs & pipeline[i].inputs) ||
!pipeline[i].inputs)
- {
+ {
changed_ops |= pipeline[i].ops;
changed_outputs |= pipeline[i].outputs;
pipeline[i].active &= ~PIPE_PRECALC;
@@ -256,9 +256,9 @@ static void build_full_precalc_pipeline( GLcontext *ctx )
{
pipeline[i].active |= PIPE_PRECALC;
*stages++ = &pipeline[i];
- }
+ }
}
-
+
/* Incompatible with multiple stages structs implementing
* the same stage.
*/
@@ -271,8 +271,8 @@ static void build_full_precalc_pipeline( GLcontext *ctx )
available |= pipeline[i].outputs;
pre->forbidden_inputs |= pipeline[i].pre_forbidden_inputs;
}
- }
- else if (pipeline[i].active & PIPE_PRECALC)
+ }
+ else if (pipeline[i].active & PIPE_PRECALC)
{
pipeline[i].active &= ~PIPE_PRECALC;
changed_outputs |= pipeline[i].outputs;
@@ -293,8 +293,8 @@ static void build_full_precalc_pipeline( GLcontext *ctx )
void gl_build_precalc_pipeline( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct gl_pipeline *pre = &tnl->CVA.pre;
- struct gl_pipeline *elt = &tnl->CVA.elt;
+ struct gl_pipeline *pre = &tnl->CVA.pre;
+ struct gl_pipeline *elt = &tnl->CVA.elt;
if (!ctx->Driver.BuildPrecalcPipeline ||
!ctx->Driver.BuildPrecalcPipeline( ctx ))
@@ -303,11 +303,11 @@ void gl_build_precalc_pipeline( GLcontext *ctx )
pre->data_valid = 0;
pre->pipeline_valid = 1;
elt->pipeline_valid = 0;
-
+
tnl->CVA.orflag = 0;
-
+
if (MESA_VERBOSE&VERBOSE_PIPELINE)
- gl_print_pipeline( ctx, pre );
+ gl_print_pipeline( ctx, pre );
}
@@ -316,7 +316,7 @@ static void build_full_immediate_pipeline( GLcontext *ctx )
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct gl_pipeline_stage *pipeline = tnl->PipelineStage;
struct gl_cva *cva = &tnl->CVA;
- struct gl_pipeline *pre = &cva->pre;
+ struct gl_pipeline *pre = &cva->pre;
struct gl_pipeline *elt = &cva->elt;
struct gl_pipeline_stage **stages = elt->stages;
GLuint i;
@@ -340,17 +340,17 @@ static void build_full_immediate_pipeline( GLcontext *ctx )
pipeline[i].active &= ~PIPE_IMMEDIATE;
if ((pipeline[i].state_change & newstate) ||
- (pipeline[i].elt_forbidden_inputs & available))
+ (pipeline[i].elt_forbidden_inputs & available))
{
pipeline[i].check(ctx, &pipeline[i]);
}
if ((pipeline[i].type & PIPE_IMMEDIATE) &&
- (pipeline[i].ops & active_ops) == 0 &&
+ (pipeline[i].ops & active_ops) == 0 &&
(pipeline[i].elt_forbidden_inputs & available) == 0
)
{
- if (pipeline[i].inputs & ~available)
+ if (pipeline[i].inputs & ~available)
elt->forbidden_inputs |= pipeline[i].inputs & ~available;
else
{
@@ -366,7 +366,7 @@ static void build_full_immediate_pipeline( GLcontext *ctx )
}
*stages = 0;
-
+
elt->copy_transformed_data = 1;
elt->replay_copied_vertices = 0;
@@ -381,7 +381,7 @@ static void build_full_immediate_pipeline( GLcontext *ctx )
void gl_build_immediate_pipeline( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct gl_pipeline *elt = &tnl->CVA.elt;
+ struct gl_pipeline *elt = &tnl->CVA.elt;
if (!ctx->Driver.BuildEltPipeline ||
!ctx->Driver.BuildEltPipeline( ctx )) {
@@ -390,11 +390,11 @@ void gl_build_immediate_pipeline( GLcontext *ctx )
elt->pipeline_valid = 1;
tnl->CVA.orflag = 0;
-
+
if (MESA_VERBOSE&VERBOSE_PIPELINE)
- gl_print_pipeline( ctx, elt );
+ gl_print_pipeline( ctx, elt );
}
-
+
#define INTERESTED ~0
void gl_update_pipelines( GLcontext *ctx )
@@ -412,17 +412,17 @@ void gl_update_pipelines( GLcontext *ctx )
cva->lock_changed ||
cva->orflag != cva->last_orflag ||
tnl->_ArrayFlags != cva->last_array_flags)
- {
+ {
GLuint flags = VERT_WIN;
if (ctx->Visual.RGBAflag) {
flags |= VERT_RGBA;
if (ctx->_TriangleCaps && DD_SEPERATE_SPECULAR)
flags |= VERT_SPEC_RGB;
- } else
+ } else
flags |= VERT_INDEX;
- if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY)
+ if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY)
flags |= VERT_TEX0_ANY;
if (ctx->Texture._ReallyEnabled & TEXTURE1_ANY)
@@ -436,10 +436,10 @@ void gl_update_pipelines( GLcontext *ctx )
if (ctx->Texture._ReallyEnabled & TEXTURE3_ANY)
flags |= VERT_TEX3_ANY;
#endif
-
- if (ctx->Polygon._Unfilled)
+
+ if (ctx->Polygon._Unfilled)
flags |= VERT_EDGE;
-
+
if (ctx->Fog.FogCoordinateSource == GL_FOG_COORDINATE_EXT)
flags |= VERT_FOG_COORD;
@@ -485,10 +485,10 @@ void gl_run_pipeline( struct vertex_buffer *VB )
pipe->data_valid = 1; /* optimized stages might want to reset this. */
if (0) gl_print_pipeline( VB->ctx, pipe );
-
+
START_FAST_MATH(x);
-
- for ( VB->Culled = 0; *stages && !VB->Culled ; stages++ )
+
+ for ( VB->Culled = 0; *stages && !VB->Culled ; stages++ )
(*stages)->run( VB );
END_FAST_MATH(x);