summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_aaline.h2
-rw-r--r--src/mesa/swrast/s_aatriangle.h2
-rw-r--r--src/mesa/swrast/s_alpha.h3
-rw-r--r--src/mesa/swrast/s_atifragshader.c2
-rw-r--r--src/mesa/swrast/s_atifragshader.h3
-rw-r--r--src/mesa/swrast/s_blend.h3
-rw-r--r--src/mesa/swrast/s_context.c1
-rw-r--r--src/mesa/swrast/s_context.h1
-rw-r--r--src/mesa/swrast/s_depth.c1
-rw-r--r--src/mesa/swrast/s_depth.h3
-rw-r--r--src/mesa/swrast/s_feedback.c1
-rw-r--r--src/mesa/swrast/s_fog.c1
-rw-r--r--src/mesa/swrast/s_fog.h3
-rw-r--r--src/mesa/swrast/s_fragprog.c2
-rw-r--r--src/mesa/swrast/s_fragprog.h3
-rw-r--r--src/mesa/swrast/s_logic.h3
-rw-r--r--src/mesa/swrast/s_masking.h3
-rw-r--r--src/mesa/swrast/s_points.c1
-rw-r--r--src/mesa/swrast/s_readpix.c1
-rw-r--r--src/mesa/swrast/s_span.c18
-rw-r--r--src/mesa/swrast/s_stencil.h3
-rw-r--r--src/mesa/swrast/s_texcombine.h3
-rw-r--r--src/mesa/swrast/s_texfilter.h3
-rw-r--r--src/mesa/swrast/s_zoom.h3
24 files changed, 46 insertions, 23 deletions
diff --git a/src/mesa/swrast/s_aaline.h b/src/mesa/swrast/s_aaline.h
index f1d708ec801..922eb230e51 100644
--- a/src/mesa/swrast/s_aaline.h
+++ b/src/mesa/swrast/s_aaline.h
@@ -28,7 +28,7 @@
#define S_AALINE_H
-#include "swrast.h"
+#include "main/mtypes.h"
extern void
diff --git a/src/mesa/swrast/s_aatriangle.h b/src/mesa/swrast/s_aatriangle.h
index 4b57fa73a27..9aed41a1915 100644
--- a/src/mesa/swrast/s_aatriangle.h
+++ b/src/mesa/swrast/s_aatriangle.h
@@ -28,7 +28,7 @@
#define S_AATRIANGLE_H
-#include "swrast.h"
+#include "main/mtypes.h"
extern void
diff --git a/src/mesa/swrast/s_alpha.h b/src/mesa/swrast/s_alpha.h
index 7a5b72e650a..239484a9743 100644
--- a/src/mesa/swrast/s_alpha.h
+++ b/src/mesa/swrast/s_alpha.h
@@ -28,7 +28,8 @@
#define S_ALPHA_H
-#include "s_context.h"
+#include "main/mtypes.h"
+#include "s_span.h"
extern GLint
diff --git a/src/mesa/swrast/s_atifragshader.c b/src/mesa/swrast/s_atifragshader.c
index fa280e72e40..1338b6802d4 100644
--- a/src/mesa/swrast/s_atifragshader.c
+++ b/src/mesa/swrast/s_atifragshader.c
@@ -21,10 +21,10 @@
#include "main/glheader.h"
#include "main/colormac.h"
-#include "main/context.h"
#include "main/macros.h"
#include "main/atifragshader.h"
#include "swrast/s_atifragshader.h"
+#include "swrast/s_context.h"
/**
diff --git a/src/mesa/swrast/s_atifragshader.h b/src/mesa/swrast/s_atifragshader.h
index 871a0c04559..cce455a0465 100644
--- a/src/mesa/swrast/s_atifragshader.h
+++ b/src/mesa/swrast/s_atifragshader.h
@@ -27,7 +27,8 @@
#define S_ATIFRAGSHADER_H
-#include "s_context.h"
+#include "main/mtypes.h"
+#include "s_span.h"
extern void
diff --git a/src/mesa/swrast/s_blend.h b/src/mesa/swrast/s_blend.h
index 8d5a81635d5..9cedde3bf20 100644
--- a/src/mesa/swrast/s_blend.h
+++ b/src/mesa/swrast/s_blend.h
@@ -27,7 +27,8 @@
#define S_BLEND_H
-#include "s_context.h"
+#include "main/mtypes.h"
+#include "s_span.h"
extern void
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 6d2d17c61d9..d8d8a80b7d7 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -28,7 +28,6 @@
#include "main/imports.h"
#include "main/bufferobj.h"
-#include "main/context.h"
#include "main/colormac.h"
#include "main/mtypes.h"
#include "main/teximage.h"
diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h
index c9755e6da18..6d81f74768f 100644
--- a/src/mesa/swrast/s_context.h
+++ b/src/mesa/swrast/s_context.h
@@ -43,6 +43,7 @@
#ifndef S_CONTEXT_H
#define S_CONTEXT_H
+#include "main/compiler.h"
#include "main/mtypes.h"
#include "program/prog_execute.h"
#include "swrast.h"
diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c
index ed637cac124..f952fd6baa7 100644
--- a/src/mesa/swrast/s_depth.c
+++ b/src/mesa/swrast/s_depth.c
@@ -30,7 +30,6 @@
#include "main/imports.h"
#include "s_depth.h"
-#include "s_context.h"
#include "s_span.h"
diff --git a/src/mesa/swrast/s_depth.h b/src/mesa/swrast/s_depth.h
index 7eae3667428..878d242f5e5 100644
--- a/src/mesa/swrast/s_depth.h
+++ b/src/mesa/swrast/s_depth.h
@@ -27,7 +27,8 @@
#define S_DEPTH_H
-#include "s_context.h"
+#include "main/mtypes.h"
+#include "s_span.h"
extern GLuint
diff --git a/src/mesa/swrast/s_feedback.c b/src/mesa/swrast/s_feedback.c
index 373b1416e28..6ac8ac73b0b 100644
--- a/src/mesa/swrast/s_feedback.c
+++ b/src/mesa/swrast/s_feedback.c
@@ -24,7 +24,6 @@
#include "main/glheader.h"
#include "main/colormac.h"
-#include "main/context.h"
#include "main/feedback.h"
#include "main/macros.h"
diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c
index 3fc84392133..689500a613a 100644
--- a/src/mesa/swrast/s_fog.c
+++ b/src/mesa/swrast/s_fog.c
@@ -25,7 +25,6 @@
#include "main/glheader.h"
#include "main/colormac.h"
-#include "main/context.h"
#include "main/macros.h"
#include "s_context.h"
diff --git a/src/mesa/swrast/s_fog.h b/src/mesa/swrast/s_fog.h
index 06107de3f9d..a496746d106 100644
--- a/src/mesa/swrast/s_fog.h
+++ b/src/mesa/swrast/s_fog.h
@@ -28,7 +28,8 @@
#define S_FOG_H
-#include "swrast.h"
+#include "main/mtypes.h"
+#include "s_span.h"
extern GLfloat
diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c
index 413f136cd59..9facb44d9bf 100644
--- a/src/mesa/swrast/s_fragprog.c
+++ b/src/mesa/swrast/s_fragprog.c
@@ -24,9 +24,9 @@
#include "main/glheader.h"
#include "main/colormac.h"
-#include "main/context.h"
#include "program/prog_instruction.h"
+#include "s_context.h"
#include "s_fragprog.h"
#include "s_span.h"
diff --git a/src/mesa/swrast/s_fragprog.h b/src/mesa/swrast/s_fragprog.h
index e1b7e679185..92b9d01e173 100644
--- a/src/mesa/swrast/s_fragprog.h
+++ b/src/mesa/swrast/s_fragprog.h
@@ -27,7 +27,8 @@
#define S_FRAGPROG_H
-#include "s_context.h"
+#include "main/mtypes.h"
+#include "s_span.h"
extern void
diff --git a/src/mesa/swrast/s_logic.h b/src/mesa/swrast/s_logic.h
index e8cfae33f23..d609513348d 100644
--- a/src/mesa/swrast/s_logic.h
+++ b/src/mesa/swrast/s_logic.h
@@ -27,7 +27,8 @@
#define S_LOGIC_H
-#include "swrast.h"
+#include "main/mtypes.h"
+#include "s_span.h"
extern void
_swrast_logicop_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb,
diff --git a/src/mesa/swrast/s_masking.h b/src/mesa/swrast/s_masking.h
index 3ba4f8356cb..cb000da0fd8 100644
--- a/src/mesa/swrast/s_masking.h
+++ b/src/mesa/swrast/s_masking.h
@@ -27,7 +27,8 @@
#define S_MASKING_H
-#include "swrast.h"
+#include "main/mtypes.h"
+#include "s_span.h"
extern void
diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c
index 1663ece8294..12431662c47 100644
--- a/src/mesa/swrast/s_points.c
+++ b/src/mesa/swrast/s_points.c
@@ -25,7 +25,6 @@
#include "main/glheader.h"
#include "main/colormac.h"
-#include "main/context.h"
#include "main/macros.h"
#include "s_context.h"
#include "s_feedback.h"
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index 6ad9aceec77..553fd9a76d8 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -27,7 +27,6 @@
#include "main/bufferobj.h"
#include "main/colormac.h"
#include "main/convolve.h"
-#include "main/context.h"
#include "main/feedback.h"
#include "main/formats.h"
#include "main/image.h"
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 687c8eb0bf8..8931cdec1bc 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -33,7 +33,6 @@
#include "main/glheader.h"
#include "main/colormac.h"
-#include "main/context.h"
#include "main/macros.h"
#include "main/imports.h"
#include "main/image.h"
@@ -971,6 +970,10 @@ shade_texture_span(GLcontext *ctx, SWspan *span)
if (span->primitive == GL_BITMAP && span->array->ChanType != GL_FLOAT) {
convert_color_type(span, GL_FLOAT, 0);
}
+ else {
+ span->array->rgba = (void *) span->array->attribs[FRAG_ATTRIB_COL0];
+ }
+
if (span->primitive != GL_POINT ||
(span->interpMask & SPAN_RGBA) ||
ctx->Point.PointSprite) {
@@ -1222,9 +1225,22 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
GLchan rgbaSave[MAX_WIDTH][4];
const GLuint fragOutput = multiFragOutputs ? buf : 0;
+ /* set span->array->rgba to colors for render buffer's datatype */
if (rb->DataType != span->array->ChanType || fragOutput > 0) {
convert_color_type(span, rb->DataType, fragOutput);
}
+ else {
+ if (rb->DataType == GL_UNSIGNED_BYTE) {
+ span->array->rgba = span->array->rgba8;
+ }
+ else if (rb->DataType == GL_UNSIGNED_SHORT) {
+ span->array->rgba = (void *) span->array->rgba16;
+ }
+ else {
+ span->array->rgba = (void *)
+ span->array->attribs[FRAG_ATTRIB_COL0];
+ }
+ }
if (!multiFragOutputs && numBuffers > 1) {
/* save colors for second, third renderbuffer writes */
diff --git a/src/mesa/swrast/s_stencil.h b/src/mesa/swrast/s_stencil.h
index cd6cbc57b0b..c076ebbe2a1 100644
--- a/src/mesa/swrast/s_stencil.h
+++ b/src/mesa/swrast/s_stencil.h
@@ -27,7 +27,8 @@
#define S_STENCIL_H
-#include "swrast.h"
+#include "main/mtypes.h"
+#include "s_span.h"
diff --git a/src/mesa/swrast/s_texcombine.h b/src/mesa/swrast/s_texcombine.h
index 9ed96efb879..4f5dfbe1afe 100644
--- a/src/mesa/swrast/s_texcombine.h
+++ b/src/mesa/swrast/s_texcombine.h
@@ -27,7 +27,8 @@
#define S_TEXCOMBINE_H
-#include "swrast.h"
+#include "main/mtypes.h"
+#include "s_span.h"
extern void
_swrast_texture_span( GLcontext *ctx, SWspan *span );
diff --git a/src/mesa/swrast/s_texfilter.h b/src/mesa/swrast/s_texfilter.h
index 2e265d685c5..eceab59658e 100644
--- a/src/mesa/swrast/s_texfilter.h
+++ b/src/mesa/swrast/s_texfilter.h
@@ -27,7 +27,8 @@
#define S_TEXFILTER_H
-#include "swrast.h"
+#include "main/mtypes.h"
+#include "s_context.h"
extern texture_sample_func
diff --git a/src/mesa/swrast/s_zoom.h b/src/mesa/swrast/s_zoom.h
index 43917be65fc..09f624efad5 100644
--- a/src/mesa/swrast/s_zoom.h
+++ b/src/mesa/swrast/s_zoom.h
@@ -25,7 +25,8 @@
#ifndef S_ZOOM_H
#define S_ZOOM_H
-#include "swrast.h"
+#include "main/mtypes.h"
+#include "s_span.h"
extern void