summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_span.c
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2006-02-15 11:06:00 +0000
committerMichal Krol <[email protected]>2006-02-15 11:06:00 +0000
commita66393120411071b3f3ccce8583ab961a2935959 (patch)
treefccbb4f3704b72c1526484ff702ff5071b38456d /src/mesa/swrast/s_span.c
parent5bc35a823a7bdfd96d8a2428ed5630d04053ad34 (diff)
Add arbshader stage.
Diffstat (limited to 'src/mesa/swrast/s_span.c')
-rw-r--r--src/mesa/swrast/s_span.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 681d4eba11c..91556cae5f3 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -2,7 +2,7 @@
* Mesa 3-D graphics library
* Version: 6.5
*
- * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 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"),
@@ -37,7 +37,8 @@
#include "imports.h"
#include "s_atifragshader.h"
-#include "s_alpha.h"
+#include "s_alpha.h"
+#include "s_arbshader.h"
#include "s_blend.h"
#include "s_context.h"
#include "s_depth.h"
@@ -1154,8 +1155,13 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
if (span->interpMask & SPAN_FOG)
interpolate_fog(ctx, span);
- /* Compute fragment colors with fragment program or texture lookups */
- if (ctx->FragmentProgram._Active) {
+ /* Compute fragment colors with fragment program or texture lookups */
+ if (ctx->ShaderObjects.CurrentProgram != NULL) {
+ if (span->interpMask & SPAN_Z)
+ _swrast_span_interpolate_z (ctx, span);
+ _swrast_exec_arbshader (ctx, span);
+ }
+ else if (ctx->FragmentProgram._Active) {
/* frag prog may need Z values */
if (span->interpMask & SPAN_Z)
_swrast_span_interpolate_z(ctx, span);
@@ -1232,7 +1238,12 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
if (span->interpMask & SPAN_FOG)
interpolate_fog(ctx, span);
- if (ctx->FragmentProgram._Active)
+ if (ctx->ShaderObjects.CurrentProgram != NULL) {
+ if (span->interpMask & SPAN_Z)
+ _swrast_span_interpolate_z (ctx, span);
+ _swrast_exec_arbshader (ctx, span);
+ }
+ else if (ctx->FragmentProgram._Active)
_swrast_exec_fragment_program( ctx, span );
else if (ctx->ATIFragmentShader._Enabled)
_swrast_exec_fragment_shader( ctx, span );