diff options
author | Brian Paul <[email protected]> | 2003-01-14 04:55:45 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2003-01-14 04:55:45 +0000 |
commit | 610d59981a9f43fefe29b34ef19c184d28e2bef5 (patch) | |
tree | 6bac42c2fd25b19ed35260538c6d945de8d699d8 /src/mesa/swrast/s_span.c | |
parent | cf01d97dc3e23af067dd9633a2bfa61a6a794ce6 (diff) |
First batch of code for GL_NV_fragment_program.
Re-org of some GL_NV_vertex_program code.
Replace MAX_TEXTURE_UNITS with MAX_TEXTURE_COORD_UNITS and MAX_TEXTURE_IMAGE_UNITS.
Diffstat (limited to 'src/mesa/swrast/s_span.c')
-rw-r--r-- | src/mesa/swrast/s_span.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index a03eec8b2aa..4e00c645faf 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -1,4 +1,4 @@ -/* $Id: s_span.c,v 1.53 2002/11/26 03:00:04 brianp Exp $ */ +/* $Id: s_span.c,v 1.54 2003/01/14 04:55:46 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -47,6 +47,7 @@ #include "s_fog.h" #include "s_logic.h" #include "s_masking.h" +#include "s_nvfragprog.h" #include "s_span.h" #include "s_stencil.h" #include "s_texture.h" @@ -949,6 +950,18 @@ _mesa_write_rgba_span( GLcontext *ctx, struct sw_span *span) stipple_polygon_span(ctx, span); } + /* Fragment program */ + if (ctx->FragmentProgram.Enabled) { + /* Now we may need to interpolate the colors */ + if ((span->interpMask & SPAN_RGBA) && + (span->arrayMask & SPAN_RGBA) == 0) { + interpolate_colors(ctx, span); + span->interpMask &= ~SPAN_RGBA; + } + _swrast_exec_nv_fragment_program(ctx, span); + monoColor = GL_FALSE; + } + /* Do the alpha test */ if (ctx->Color.AlphaEnabled) { if (!_mesa_alpha_test(ctx, span)) { @@ -1183,7 +1196,10 @@ _mesa_write_texture_span( GLcontext *ctx, struct sw_span *span) /* Texturing without alpha is done after depth-testing which * gives a potential speed-up. */ - _swrast_texture_span( ctx, span ); + if (ctx->FragmentProgram.Enabled) + _swrast_exec_nv_fragment_program( ctx, span ); + else + _swrast_texture_span( ctx, span ); /* Do the alpha test */ if (!_mesa_alpha_test(ctx, span)) { @@ -1232,7 +1248,10 @@ _mesa_write_texture_span( GLcontext *ctx, struct sw_span *span) if ((span->interpMask & SPAN_RGBA) && (span->arrayMask & SPAN_RGBA) == 0) interpolate_colors(ctx, span); - _swrast_texture_span( ctx, span ); + if (ctx->FragmentProgram.Enabled) + _swrast_exec_nv_fragment_program( ctx, span ); + else + _swrast_texture_span( ctx, span ); } ASSERT(span->arrayMask & SPAN_RGBA); |