Check if FRAG_RESULT_COLR is written and update span->interpMask, arrayMask.
authorBrian <brian@yutani.localnet.net>
Tue, 13 Mar 2007 16:53:16 +0000 (10:53 -0600)
committerBrian <brian@yutani.localnet.net>
Tue, 13 Mar 2007 16:53:16 +0000 (10:53 -0600)
Also, fix an assertion.

src/mesa/swrast/s_fragprog.c

index 7260759..7f7c0d6 100644 (file)
@@ -201,12 +201,19 @@ _swrast_exec_fragment_program( GLcontext *ctx, SWspan *span )
    const struct gl_fragment_program *program = ctx->FragmentProgram._Current;
 
    /* incoming colors should be floats */
-   ASSERT(span->array->ChanType == GL_FLOAT);
+   if (program->Base.InputsRead & FRAG_BIT_COL0) {
+      ASSERT(span->array->ChanType == GL_FLOAT);
+   }
 
    ctx->_CurrentProgram = GL_FRAGMENT_PROGRAM_ARB; /* or NV, doesn't matter */
 
    run_program(ctx, span, 0, span->end);
 
+   if (program->Base.OutputsWritten & (1 << FRAG_RESULT_COLR)) {
+      span->interpMask &= ~SPAN_RGBA;
+      span->arrayMask |= SPAN_RGBA;
+   }
+
    if (program->Base.OutputsWritten & (1 << FRAG_RESULT_DEPR)) {
       span->interpMask &= ~SPAN_Z;
       span->arrayMask |= SPAN_Z;