summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_span.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast/s_span.c')
-rw-r--r--src/mesa/swrast/s_span.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 07248c71af0..874a37b2241 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -1278,7 +1278,7 @@ void
_swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
{
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
- const GLuint colorMask = *((GLuint *) ctx->Color.ColorMask);
+ const GLuint *colorMask = (GLuint *) ctx->Color.ColorMask;
const GLbitfield origInterpMask = span->interpMask;
const GLbitfield origArrayMask = span->arrayMask;
const GLbitfield origArrayAttribs = span->arrayAttribs;
@@ -1396,7 +1396,7 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
/* We had to wait until now to check for glColorMask(0,0,0,0) because of
* the occlusion test.
*/
- if (colorMask == 0x0) {
+ if (fb->_NumColorDrawBuffers == 1 && colorMask[0] == 0x0) {
/* no colors to write */
goto end;
}
@@ -1486,12 +1486,12 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
if (ctx->Color._LogicOpEnabled) {
_swrast_logicop_rgba_span(ctx, rb, span);
}
- else if (ctx->Color.BlendEnabled) {
+ else if ((ctx->Color.BlendEnabled >> buf) & 1) {
_swrast_blend_span(ctx, rb, span);
}
- if (colorMask != 0xffffffff) {
- _swrast_mask_rgba_span(ctx, rb, span);
+ if (colorMask[buf] != 0xffffffff) {
+ _swrast_mask_rgba_span(ctx, rb, span, buf);
}
if (span->arrayMask & SPAN_XY) {