summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_context.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-01-06 10:43:20 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-01-06 10:43:20 -0700
commitff73c783cc47361ff0dd819c82d067b4b85870dd (patch)
tree07706ff913e0db3164ab62eba430938f72efae85 /src/mesa/swrast/s_context.c
parent9f6022d0567dc1288888212d7128acc48795b306 (diff)
Simplify ctx->_NumColorDrawBuffers, _ColorDrawBuffers and fix bug 13835.
These fields are no longer indexed by shader output. Now, we just have a simple array of renderbuffer pointers. If the shader writes to gl_FragData[i], send those colors to the N _ColorDrawBuffers. Otherwise, replicate the single gl_FragColor (or the fixed-function color) to the N _ColorDrawBuffers. A few more changes and simplifications can follow from this...
Diffstat (limited to 'src/mesa/swrast/s_context.c')
-rw-r--r--src/mesa/swrast/s_context.c43
1 files changed, 1 insertions, 42 deletions
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index 314931d467..8e6b28bb4c 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -87,7 +87,7 @@ _swrast_update_rasterflags( GLcontext *ctx )
* MULTI_DRAW_BIT flag. Also set it if we're drawing to no
* buffers or the RGBA or CI mask disables all writes.
*/
- if (ctx->DrawBuffer->_NumColorDrawBuffers[0] != 1) {
+ if (ctx->DrawBuffer->_NumColorDrawBuffers != 1) {
/* more than one color buffer designated for writing (or zero buffers) */
rasterMask |= MULTI_DRAW_BIT;
}
@@ -596,44 +596,6 @@ _swrast_update_active_attribs(GLcontext *ctx)
}
-/**
- * Update the swrast->_ColorOutputsMask which indicates which color
- * renderbuffers (aka rendertargets) are being written to by the current
- * fragment program.
- * We also take glDrawBuffers() into account to skip outputs that are
- * set to GL_NONE.
- */
-static void
-_swrast_update_color_outputs(GLcontext *ctx)
-{
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- const struct gl_framebuffer *fb = ctx->DrawBuffer;
-
- swrast->_ColorOutputsMask = 0;
- swrast->_NumColorOutputs = 0;
-
- if (ctx->FragmentProgram._Current) {
- const GLbitfield outputsWritten
- = ctx->FragmentProgram._Current->Base.OutputsWritten;
- GLuint output;
- for (output = 0; output < ctx->Const.MaxDrawBuffers; output++) {
- if ((outputsWritten & (1 << (FRAG_RESULT_DATA0 + output)))
- && (fb->_NumColorDrawBuffers[output] > 0)) {
- swrast->_ColorOutputsMask |= (1 << output);
- swrast->_NumColorOutputs = output + 1;
- }
- }
- }
- if (swrast->_ColorOutputsMask == 0x0) {
- /* no fragment program, or frag prog didn't write to gl_FragData[] */
- if (fb->_NumColorDrawBuffers[0] > 0) {
- swrast->_ColorOutputsMask = 0x1;
- swrast->_NumColorOutputs = 1;
- }
- }
-}
-
-
void
_swrast_validate_derived( GLcontext *ctx )
{
@@ -683,9 +645,6 @@ _swrast_validate_derived( GLcontext *ctx )
_NEW_TEXTURE))
_swrast_update_active_attribs(ctx);
- if (swrast->NewState & (_NEW_PROGRAM | _NEW_BUFFERS))
- _swrast_update_color_outputs(ctx);
-
swrast->NewState = 0;
swrast->StateChanges = 0;
swrast->InvalidateState = _swrast_invalidate_state;